Python 2.3 True = False

Martin v. Löwis martin.vonloewis at hpi.uni-potsdam.de
Mon Mar 24 04:35:22 EST 2003


> Assignment to None, by special dispensation, gives you a SyntaxWarning.
> All of these things are ProgrammerDoingSomethingHeShouldntWarnings.
> Python doesn't have true constants (in the sense that what the point to
> is no longer mutable or that the name is no longer rebindable, whichever
> you might mean); it just has things which are officially special names
> that a well-behaved program shouldn't fiddle with.

At one point, there was a patch to restrict assignments to True and False
for 2.3. This patch wasn't implemented as too much code actually did
assign to True and False. It is likely that most of such code is modified
to rely on the builtins True and False constants, at which time assignment
will be gradually phased out (future deprecation, deprecation, error).

Regards,
Martin






More information about the Python-list mailing list