bool behavior in Python 3000?

Ed Leafe ed at
Wed Jul 11 20:01:33 CEST 2007

On Jul 11, 2007, at 2:04 AM, Stargaming wrote:

> No, I think Bjoern just wanted to point out that all those binary
> boolean operators already work *perfectly*. You just have to emphasize
> that you're doing boolean algebra there, using `bool()`.
> "Explicit is better than implicit."

	I think that the assignability to the names 'True' and 'False' is  
incorrect, or at the very least subject to all sorts of odd results.  
Look at this:

 >>> True, False
(True, False)
 >>> True = False
 >>> True, False
(False, False)
 >>> True == False
 >>> (True == False) == True

	Yeah, I know: "Doctor, it hurts when I do this". Doc: "So don't do  
that!". I haven't kept up with all the Python 3000 docs, so does  
anyone know if True and False will become true keywords, and whether  
oddball stuff like the above will no longer be possible?

-- Ed Leafe

More information about the Python-list mailing list