Skip to content

Add py and py3 to Python aliases#7791

Open
rvben wants to merge 2 commits intogithub-linguist:mainfrom
rvben:add-py-python-alias
Open

Add py and py3 to Python aliases#7791
rvben wants to merge 2 commits intogithub-linguist:mainfrom
rvben:add-py-python-alias

Conversation

@rvben
Copy link

@rvben rvben commented Feb 4, 2026

Summary

Add py as an alias for Python, matching how other popular languages handle short aliases.

Motivation

Python is the only major language without its common short alias:

Language Short Alias
JavaScript js
TypeScript ts
Ruby rb
Rust rs
Python py

In #4026 (2018), adding py was discussed and the response was:

"Let's keep the python3 alias only for now. We can always add new aliases if/when we see them being used."

Seven years later, py is extensively used in code blocks across GitHub. The alias is so expected that GitHub's markdown renderer added extension-based fallback to support ```py even without it being an official alias.

Impact

  • Tools using Linguist's find_by_alias() will recognize py
  • Aligns official aliases with GitHub's rendering behavior
  • Zero risk: no other language uses py

Changes

Add py to the Python aliases in lib/linguist/languages.yml.

@rvben rvben requested a review from a team as a code owner February 4, 2026 18:48
Co-authored-by: John Gardner <gardnerjohng@gmail.com>
@Alhadis Alhadis changed the title Add py as Python alias Add py and py3 to Python aliases Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants