Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-119535: python𝜋#119536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 5 commits intopython:mainfromhauntsaninja:pythonπ
Oct 6, 2024

The head ref may contain hidden characters:"python\u03C0"

Dismiss
Merged

gh-119535: python𝜋#119536

hugovk merged 5 commits intopython:mainfromhauntsaninja:pythonπ
Oct 6, 2024

Conversation

hauntsaninja
Copy link
Contributor

@hauntsaninjahauntsaninja commentedMay 25, 2024
edited by bedevere-appbot
Loading

devdanzin, dolfinus, and jbosboom reacted with thumbs down emojidanielhollas, Eclips4, emmatyping, nineteendo, DavidRomanovizc, wallseat, magistau, tpvasconcelos, and agriyakhetarpal reacted with laugh emojiAlexWaygood, wallseat, magistau, MartinCura, and agriyakhetarpal reacted with rocket emoji
@hauntsaninjahauntsaninja requested a review fromhugovkMay 25, 2024 06:20

suffixes = ['python', 'python3', f'python3.{sys.version_info[1]}']
if sys.version_info[:2] == (3, 14):
suffixes.append('pythonπ')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think usingpython-pi orpython_pi would be better. I think using special characters may cause garbled characters on some platform.

Copy link
ContributorAuthor

@hauntsaninjahauntsaninjaOct 5, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hmm, what platform / filesystem are you concerned about, and what would the impact to the user on that platform be? (note in this branch we knowos.name == "posix")

A Greek letter isn't really that special. It's fully normalised Unicode (non-normalised Unicode can still be a little surprising). Looks like even FAT has supported this since around the time I was born via LFN.

See alsohttps://peps.python.org/pep-0011/#legacy-c-locale part of PEP 11

This is decidedly one of the advantages of being alive in 2024 :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Linux console with no framebuffer?

Console fonts without this glyph? I sometimes do math with the Diofant in the framebuffer console (yes, it has unicode support). I works well with greek letters, do some pretty-printing to display formulas. But I doubt it's able to display e.g. chinese texts an non-garbadge. (Perhaps, with other font, which I don't have...)

Copy link
ContributorAuthor

@hauntsaninjahauntsaninjaOct 5, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

IIUChttps://wiki.archlinux.org/title/Linux_console says that the Linux console uses UTF-8, but we may indeed have to worry about whether the console font is missing π. The same page says the kernel built-in font can render the CP437 character set, which does have π (and dates back to the original IBM PC).

It's possible I misunderstood something, but even the case where the font is missing the glyph, is the worst thing that can happen that a user will see an unrendered glyph ifls-ing? That doesn't seem that bad, and sounds in line with the vibes of what PEP 11 describes as "won't fix". (And of course, if users report problems during prerelease we can revert)

Edit: note the CP437 stuff probably doesn't apply to U+1d70b which the PR has been updated to use. It might also have worse font support

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Terminals cope with missing glyphs already (usually by rendering an ASCII?, or a dedicated replacement character).

If the active encoding is sufficiently wrong, they don't even see the raw unicode:

$ ls -d _[bd]*_build🐸  _deploy🐸$ LANG=C ls -d _[bd]*'_build'$'\360\237\220\270'  '_deploy'$'\360\237\220\270'

So yeah, as far as easter eggs go, this one is as close to genuinely harmless as they get.

Copy link
Member

@AlexWaygoodAlexWaygood left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM. Easter eggs are fun, and I can't see any serious harm in doing this, because I seriously doubt anybody will use it for any serious use :-)

I don't have a strong opinion onhttps://github.com/python/cpython/pull/119536/files#r1788711396.

Sad that the Windows users won't get the Easter egg! (But I don't think that should block merging this 😆)

Copy link
Member

@AA-TurnerAA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Alex took all I wanted to say!

A


suffixes = ['python', 'python3', f'python3.{sys.version_info[1]}']
if sys.version_info[:2] == (3, 14):
suffixes.append('pythonπ')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

From@ambv , this should use the mathematical symbol variant of 𝜋, rather than the Greek letter variant:

Suggested change
suffixes.append('pythonπ')
suffixes.append('python𝜋')

hugovk, nineteendo, and AlexWaygood reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@hauntsaninja Let's include this, remove the NEWS, and keep the version check. Thanks!

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks, I've made the updates!

(Note that U+1d70b isn't NFKC normalised. I know in some cases non-normalised Unicode can cause issues in filesystems, but I think that's usually about NFC/NFD normalisation)

@nineteendo
Copy link
Contributor

Can you update the title of the PR?

AlexWaygood reacted with laugh emoji

@AlexWaygoodAlexWaygood changed the titlegh-119535: pythonπgh-119535: python𝜋Oct 6, 2024
Copy link
Member

@hugovkhugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Now, everyone: shhh!

ncoghlan, danielhollas, emmatyping-nv, adamchainz, and agriyakhetarpal reacted with laugh emojiMartinCura reacted with hooray emojiAlexWaygood and MartinCura reacted with rocket emoji
@hugovkhugovk merged commit3fc673e intopython:mainOct 6, 2024
32 checks passed
hugovk added a commit to hugovk/cpython that referenced this pull requestMay 15, 2025
hauntsaninja pushed a commit that referenced this pull requestMay 15, 2025
* Revert "gh-119535: Support 𝜋thon in Python 3.14 venvs (#125035)"This reverts commitfcef3fc.* Revert "gh-119535: python𝜋 (#119536)"This reverts commit3fc673e.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ncoghlanncoghlanncoghlan left review comments

@skirpichevskirpichevskirpichev left review comments

@picnixzpicnixzpicnixz left review comments

@nineteendonineteendonineteendo left review comments

@rruuaanngrruuaanngrruuaanng left review comments

@hugovkhugovkhugovk approved these changes

@AA-TurnerAA-TurnerAA-Turner approved these changes

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

@vsajipvsajipAwaiting requested review from vsajipvsajip is a code owner

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

9 participants
@hauntsaninja@nineteendo@ncoghlan@hugovk@skirpichev@AA-Turner@picnixz@AlexWaygood@rruuaanng

[8]ページ先頭

©2009-2025 Movatter.jp