The hidden poem embedded inside Python's source code
In 1999, software engineer Tim Peters penned nineteen design aphorisms for the Python community, including "Readability counts" and "Simple is better than complex." Known as the Zen of Python, the text was secretly embedded into the language interpreter itself. Any programmer typing `import this` triggers an Easter egg that decodes and prints the poem. Peters left a theoretical twentieth rule unwritten, leaving it for language creator Guido van Rossum to fill in.
The Easter Egg in the Standard Library
In almost every interactive Python session, typing a simple two-word command reveals an unexpected piece of literature. When a programmer enters `import this` into the interpreter, the software does not load an ordinary utility module or perform a data processing task. Instead, it immediately prints nineteen lines of philosophical aphorisms known collectively as the Zen of Python.
The module responsible for this output, `this.py`, is permanently included in Python's standard library. Rather than storing the text as plain, readable strings, the underlying source code stores the poem as an obfuscated block of text encoded with ROT13, a simple substitution cipher that rotates each letter by thirteen positions in the alphabet. When imported, the script decodes the scrambled payload on the fly and outputs the text directly to the console.
Origins on the Python Mailing List
The text was composed in June 1999 by Tim Peters, a long-time core contributor to Python and an influential software engineer. During a discussion on the `comp.lang.python` mailing list regarding the evolving direction and design philosophy of the language, Peters attempted to formalize the unwritten principles that Python's creator, Guido van Rossum, and the broader community had been practicing for years.
Peters framed these observations as guiding maxims for software architecture and community decision-making. Later, the text was officially cataloged in the Python Enhancement Proposal archive as PEP 20. Although PEPs typically serve as formal technical specifications for new syntax, APIs, or architectural changes, PEP 20 stands out as an informational document intended to articulate the cultural and philosophical consensus of the development team.