Easter Eggs
Users of curly bracket programming languages, such as C or Java, sometimes expect or wish Python to follow a block-delimiter convention. Brace-delimited block syntax has been repeatedly requested, and consistently rejected by core developers. The Python interpreter contains an easter egg that summarizes its developers' feelings on this issue. The code from __future__ import braces
raises the exception SyntaxError: not a chance
. The __future__
module is normally used to provide features from future versions of Python.
Another hidden message, The Zen of Python (a summary of Python philosophy), is displayed when trying to import this
.
The message Hello world...
is printed when the import statement import __hello__
is used.
An antigravity
module was added to Python 2.7 and 3.0. Importing it opens a web browser to an xkcd comic that portrays a humorous fictional use for such a module, intended to demonstrate the ease with which Python modules enable additional functionality.
Read more about this topic: EAFP
Famous quotes containing the words easter and/or eggs:
“In your Easter bonnet, with all the frills upon it,
Youll be the grandest lady in the Easter parade.”
—Irving Berlin (18881989)
“Nothing is so beautiful as spring
When weeds, in wheels, shoot long and lovely and lush;
Thrushs eggs look little low heavens, and thrush
Through the echoing timber does so rinse and wring
The ear, it strikes like lightning to hear him sing.”
—Gerard Manley Hopkins (18441889)