Interesting Language Facet #2: Easter Eggs

This post includes details about some of Python's cool "hidden" features.

The Zen of Python

Tim Peters, a major contributor to the Python community, wrote this poem named The Zen of Python to highlight the philosophies of Python. If you type in “import this” in your Python IDLE, it will output the poem.

This is love

A cute addition to the Zen of Python poem.

No Braces

Python is designed to be elegant; mandatory indentation is an essential part of this. The library braces was supposed to change this, allowing to use C-Style braces instead of indentation. This is, of course, a joke, since attempting to import it produces a rather passive-aggressive "not a chance".

Antigravity

If you type in "import antigravity", it opens up a webpage with a comic about the antigravity module.
Here's what it looks like:

Monty Python references

The name Python has nothing to do with reptiles. Rather the opposite, it comes from the BBC show “Monty Python’s Flying Circus”. As the official Python guide suggests: Making references to Monty Python skits in documentation is not only allowed, it is encouraged! This has led developers to include several hidden references not only in the official documentation, but also in their code. For instance in Python, metasyntactic variables take the names of spam and egg, rather than the more traditionally used foo and bar. This is a clear reference to the Monty Python sketch Spam.

Barry As FLUFL

As I wrote in my first post, the creator of Python, Guido van Rossum, was given the title BDFL or Benevolent Dictator For Life. Barry Warsaw, a well-known Python developer, was deemed FLUFL (Friendly Language Uncle For Life) after Guido's retirement. Recognizing that the != inequality operator in Python 3.0 was, in some programmers' opinions, a horrible, finger pain-inducing mistake, importing the FLUFL (Barry) reinstates the <> diamond operator as the sole spelling and outputs an error message when you try to use != again.

Comments

  1. This was a very interesting find! It is awesome to see little "Easter Eggs" in stuff like this that allow to have some casual fun with a language and learn more about it.

    ReplyDelete

Post a Comment

Popular Posts