Re: "0 in [True,False]" returns True
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: "0 in [True,False]" returns True

From: Antoon Pardon <apardon@forel.vub.ac.be>
Date: Wed Dec 14 2005 - 16:07:03 CET

Op 2005-12-14, Grant Edwards schreef <grante@visi.com>:
> On 2005-12-14, bonono@gmail.com <bonono@gmail.com> wrote:
>
>>> Well, as you might argue, I'm not tryng to effect a change in your
>>> behaviour, I'm simply trying to point out how it could be made more
>>> rational.
>>
>> What would be the difference in his usage and allowing Null in a RDBMS
>> column?
>
> Don't know -- homey don't play 'dat.
>
>> Or return NaN instead of raising exception for numeric
>> functions ?
>
> Because usually (in my applications anyway) NaN is a perfectly
> valid value and not an "exception" case that needs to be handled.

I don't see the difference. In my application False and True
(or Registered and UnRegistered if you prefer) are perfectly valid
values too. They are not "exception" cases that need to be
handled.

-- 
Antoon Pardon
Received on Fri Dec 23 19:20:17 2005