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

This is legal code in Python 2.4.

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


No comments yet.

RSS feed for comments on this post.

Leave a comment

Sorry, the comment form is closed at this time.

Copyright © 1999--2004 Sebastian Marius Kirsch , all rights reserved.