Changing truth

Michael Hudson mwh at python.net
Thu Jan 16 13:12:37 EST 2003


Christian Tismer <tismer at tismer.com> writes:

> Martin v. Löwis wrote:
> > Christian Tismer <tismer at tismer.com> writes:
> [Assigning to True, False, None]
> 
> > Assignment to None will be disallowed in a future release. True and
> > False would have been banned in the same way as well, if testing
> > hadn't found that quite a lot of code has constants named True and
> > False already. As this code gets modified to use the builtin
> > constants, SyntaxWarnings, then Errors, can be added for these as
> > well.
> 
> Maybe a compromize would be to capture
> assignments to True and False in a way
> that they issue a warning if the assigned
> value is not coercable to 1 resp. 0?

That occurred to me as well, but it's kinda tricky to do at compile
time...

I've seen this before now:

True, False = (1==1), (1!=1)

and in light of 2.3, that's even sensible.

Cheers,
M.

-- 
  Of course, it obviously is beta hardware so such things are to be
  expected, but that doesn't mean that you can't point your fingers
  and generate a nelson style HAHA at a multi billion dollar
  corporation's expense.                   -- CmdrTaco on slashdot.org




More information about the Python-list mailing list