while 1 vs while True

Steven Bethard steven.bethard at gmail.com
Tue Dec 14 18:10:01 CET 2004


Steve Holden wrote:
> Interestingly the same error occurs even when attempting sideways access:
> 
> Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on 
> win32
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import __builtin__
>  >>> __builtin__.None = "Rhubarb"
> SyntaxError: assignment to None

And in assignment to something that just looks like it could be None:

 >>> class C(object):
...     def __init__(self):
...         self.None = None
Traceback (  File "<interactive input>", line 3
SyntaxError: assignment to None (<interactive input>, line 3)

Another Steve



More information about the Python-list mailing list