bool behavior in Python 3000?

Ed Leafe ed at leafe.com
Wed Jul 11 14:01:33 EDT 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
 >>> (True == False) == True
False

	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
-- http://leafe.com
-- http://dabodev.com





More information about the Python-list mailing list