[SciPy-dev] array logical ops error?

Robert Cimrman cimrman3 at ntc.zcu.cz
Tue Nov 1 03:09:23 EST 2005


David M. Cooke wrote:
> On Oct 31, 2005, at 07:37, Alan G Isaac wrote:
> 
> 
>>On Mon, 31 Oct 2005, Robert Cimrman apparently wrote:
>>
>>
>>>is this the expected behaviour?
>>>IMHO (b * c) == (b and c), (b + c) == (b or c) should hold...
>>>
>>
>>I expected the Boolean operations to yield
>>element-by-element comparisons.  What are they??  In
>>contrast, the + and * operators give the expected results.
> 
> 
> Use & and | instead of 'and' and 'or'.

Thanks, this works as expected. Is there a place where such things are 
documented? I suspect many people would expect 'and' and '&' to have the 
same behaviour. Of course, looking at the numeric operations special 
methods should reveal the problem, but who would do it ;)

r.




More information about the SciPy-Dev mailing list