[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: Isn't bool __invert__ behaviour "strange"?
From:       "Saizan" <sanzhiyan () gmail ! com>
Date:       2006-09-22 15:25:55
Message-ID: 1158938755.403604.91180 () d34g2000cwd ! googlegroups ! com
[Download RAW message or body]


Bjoern Schliessmann wrote:
> Saizan wrote:
>
> > Why subclassing bool from int either __invert__ or __neg__ haven't
> > been overrided to produce a boolean negation?
>
> I wonder what -True or -False should evaluate to.
>
> Regards,
>
>
> Björn
>
> --
> BOFH excuse #297:
>
> Too many interrupts
Well in boolean notation -True == False and  -False == True, actually
you may prefer ¬ or a line over the term, but since there's no such
operator in python I think we should use "-" which is also the operator
used by Bool himself in his formulation for negation which was 1-x.
Now that I think of it 1-x should work as a negation in Python, too,
since True == 1 and False == 0, but it would be a little annoying to
write expressions in this way.

-- 
http://mail.python.org/mailman/listinfo/python-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic