"0 in [True,False]" returns True

Grant Edwards grante at visi.com
Wed Dec 14 10:37:30 EST 2005


On 2005-12-14, Antoon Pardon <apardon at forel.vub.ac.be> 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.
[...]
>>> 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.

Well, in my case, a given name (or return value) is always
bound to a floating point object. I don't test the type of the
object and treat it in two different ways depending on what
type it is.  It's just a float.

-- 
Grant Edwards                   grante             Yow!  .. Do you like
                                  at               "TENDER VITTLES?"?
                               visi.com            



More information about the Python-list mailing list