bool behavior in Python 3000?

Stargaming stargaming at gmail.com
Wed Jul 11 04:06:30 EDT 2007


Alan Isaac schrieb:
> Stargaming wrote:
> 
>> I think Bjoern just wanted to point out that all those binary boolean 
>> operators already work *perfectly*. 
> 
> 
> 
>>>> bool(False-True)
> 
> True
> 
> But reread Steven.
> 
> Cheers,
> Alan Isaac

What would you expect this operation to return then?
The * and + operations described in the previously mentioned document 
(http://en.wikipedia.org/wiki/Two-element_Boolean_algebra) work as you'd 
expect them to do, if you explicitly state "hey, this should be a 
boolean algebra operation". And that's okay in my opinion. If you could 
describe what's wrong about that result, we could probably help better.

Steven just suggests another (IMO totally unrelated) implementation of 
bool types. A point that Bjoern does not even touch here. Besides, his 
implementations fails at the * operation.

Bjoern does not (sorry, if I say anything wrong, Bjoern) say the current 
behaviour is right or wrong. He just says that you can make Python aware 
of boolean algrebra utilizing `bool()` easily.

bool-ly,
Stargaming



More information about the Python-list mailing list