True/False

Erik Max Francis max at alcyone.com
Tue Apr 22 23:20:51 CEST 2003


Ian Bicking wrote:

> >>> None = 10
> <stdin>:1: SyntaxWarning: assignment to None
> 
> Will this happen to True/False?  Probably not, because that would
> *really* mess up backwards compatibility (since try:except: wouldn't
> even work).

There was some talk of it in the past, I don't know whether it's
definitely planned and/or when that would happen, but it seems part of a
general trend of protecting "constants."  Perhaps an exception would be
made for True/False, but given the changes that are occurring here and
there, I'd program defensively around it.  Best way for that is the
version test (ugly) or the physical test for the existence of the name
(elegant but swallows an exception).

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ There are defeats more triumphant than victories.
\__/ Montaigne
    Discord / http://www.alcyone.com/pyos/discord/
 Convert dates from Gregorian to Discordian.




More information about the Python-list mailing list