Fun with None

Alexandre Fayolle alf at pisces.logilab.fr
Wed Aug 8 08:02:22 EDT 2001


Hi,

This may be old news, but I just accidentally discovered it was possible
to assign a value to None.

>>> None = 3
>>> None
3

Now, this is not too bad, because the _real_ None object is not modified (even 
using 'global None' will not work, but I would have thought None was a reserved
keyword or something, and that the above assignment would have raised a 
SyntaxError.


Alexandre Fayolle
-- 
LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org
Narval, the first software agent available as free software (GPL).



More information about the Python-list mailing list