Fun in the Python Interactive Shell

Python allows you to make a variable called True, which is also a boolean keyword as of recent. Hijinks follow.

>>> True
True
>>> True = False
>>> True
False
>>> while True:
	print 'foo'
	break

>>> True = 0 == 0
>>> True
True
>>> while True:
	print 'foo'
	break

foo
>>> 

Latest entries to this site

Info

This was written on Wednesday, January 28, 2004 by Lenny.

Comments

Read 0 and add your own.