"0 in [True,False]" returns True

Antoon Pardon apardon at forel.vub.ac.be
Wed Dec 14 03:56:56 EST 2005


Op 2005-12-14, Steve Holden schreef <steve at holdenweb.com>:
> Antoon Pardon wrote:

>>>It would be somewhat more self-documenting, but why not just use one 
>>>name to indicate the state and another, only meaningful in certain 
>>>states, to indicate the callback?
>> 
>> 
>> Why should I do that? Checking the type of a variable is conceptually
>> no different form testing set membership. So what I did, was just
>> bringing two disjoint sets togther and working with a variable from
>> that union. This is all in all a rather simple mathematical idea.
>> And I don't see why I should put certain information into a seperate
>> variable. It makes as much sense as working with numbers and using
>> a seperate variable to store whether a particular number is postive,
>> even or has some other characteristic. You don't seperate information
>> you can easily acquire from the variable itself. So why should I
>> seperate this information that is aquired just as easily?
>> 
>
> 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.

I guess we will just have to agree to disagree on what is more rational
in this case. Maybe it is just a case of what idiom one is used to.

-- 
Antoon Pardon



More information about the Python-list mailing list