[False,True] and [True,True] --> [True, True]?????

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Wed Apr 22 22:26:35 EDT 2009


On Thu, 23 Apr 2009 13:40:47 +1200, Lawrence D'Oliveiro wrote:

> In message <25f4735b-52a2-4d53-9097-
> e623655cadd1 at k19g2000prh.googlegroups.com>, bdb112 wrote:
> 
>> Is there any obvious reason why
>> [False,True] and [True,True]
>> gives [True, True]
> 
> This kind of confusion is why conditional constructs should not accept
> any values other than True and False

You've already said this, more than a week ago, in the thread titled "Why 
does Python show the whole array?". It wasn't correct then, and it isn't 
correct now. Any programming feature is subject to errors from people who 
try to guess what it does instead of reading the Fine Manual, and Python 
has no obligation to make every language feature match the random 
preconceptions of every user. Or even some subset of users.

If people guess wrongly what an operator does, then let them learn what 
it actually *does* do instead of crippling the operator's functionality.



-- 
Steven



More information about the Python-list mailing list