Sebastian Kirsch: Blog

Monday, 16 April 2007

How to mess with Python’s mind

Filed under: — Sebastian Kirsch @ 15:53
>>> x = True
>>> True = False
>>> False = x
>>> True
False
>>> False
True

This is legal code in Python 2.4.

Apparently, assignment to None was explicitly disallowed some versions back. Not so for True and False.


Copyright © 1999--2004 Sebastian Marius Kirsch webmaster@sebastian-kirsch.org , all rights reserved.