Skip to content

More easter eggs#16

Open
j4ckofalltrades wants to merge 3 commits intoOrkoHunter:masterfrom
j4ckofalltrades:more-easter-eggs
Open

More easter eggs#16
j4ckofalltrades wants to merge 3 commits intoOrkoHunter:masterfrom
j4ckofalltrades:more-easter-eggs

Conversation

@j4ckofalltrades
Copy link

Document three more Python Easter eggs:

#16 — Breakfast of Champions
The phello package is a frozen CPython module used for testing. Importing
phello.spam and calling .main() prints "Hello World!" — a nod to Monty
Python's SPAM sketch.

#17 — Unreachable State
A macro in CPython's C source that marks code paths that should never execute.
The RANDALL_WAS_HERE build flag reveals humorous error messages written by
(and referencing) xkcd author Randall Munroe, alongside an equally self-aware
Py_DEBUG message.

#18 — 𝜋thon
In Python 3.14 virtual environments, typing 𝜋thon (U+1D70B — a valid Unicode
identifier) launches Python. A clever play on the 3.14 (pi) version number.

Add "Breakfast of Champions" entry documenting the __phello__.spam,
__phello__.ham, __phello__.ham.eggs frozen modules references
Monty Python's SPAM sketch.
Add "Unreachable State" entry documenting some funny error messages
in CPython's Py_UNREACHABLE() macro, including the `RANDALL_WAS_HERE`
build flag referencing xkcd author Randall Munroe.
README.md Outdated
[^peg-parser]: See [this answer](https://stackoverflow.com/a/65487013/14362510)
[^breakfast-of-champions]: [Frozen modules](https://github.com/python/cpython/blob/main/Python/frozen.c) used for testing and is a reference to Monty Python's [SPAM sketch](https://cs.stanford.edu/people/eroberts/cs181/projects/spam/sketch.HTML)
[^unreachable-state]: `Py_UNREACHABLE()` is a macro in CPython's [Include/pymacro.h](https://github.com/python/cpython/blob/main/Include/pymacro.h#L243-L270) used to mark code paths that should never execute. The `RANDALL_WAS_HERE` build flag refers to Randall Munroe, the xkcd webcomic author. The error messages that should never be printed are a reference to this [xkcd comic](https://xkcd.com/2200).
[^𝜋thon]: `𝜋` is a Unicode mathematical character (U+1D70B), valid as a Python identifier. Typing [𝜋thon](https://github.com/python/cpython/pull/125035) inside a Python 3.14 virtual environment launches Python
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps python/cpython#119535 is a better page to be linked, because there were three pull requests relevant here (add pythonπ, change it to πthon, remove it in 3.15).

Besides, it might be worth noting that only the original CPython has this easter egg.
Specifically, Python 3.14 installed via uv python install 3.14 and venv created by uv venv do not support it. They don't use Lib/venv/__init__.py, where the easter egg is implemented.
astral-sh/uv#16240

Typing 𝜋thon (U+1D70B, a valid Unicode identifier) inside a
Python 3.14 virtual environment launches Python. Only works
with CPython's own venv e.g., venvs created by uv does not
support it.
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