None, False, True

John J. Lee jjl at pobox.com
Tue Sep 16 21:02:58 CEST 2003


"M-a-S" <NO-MAIL at hotmail.com> writes:

> Can anybody explain this:
> 
> Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information
> >>> None = 3
> <stdin>:1: SyntaxWarning: assignment to None
> >>> False = 4
> >>> True = 5
> >>>
> >>> None, False, True
> (3, 4, 5)

I believe there have been discussions about preventing the clobbering
of builtins recently, so it may happen in the future (2.4?).

Dunno why None and not True / False causes a warning, but you can turn
warnings into errors using the warnings framework, I think.


John




More information about the Python-list mailing list