[Numpy-discussion] Code generator bug and fix?

Travis E. Oliphant oliphant@enthought....
Tue Apr 22 09:15:02 CDT 2008

Charles R Harris wrote:
> I note that other logical operators, <, ==, do in fact return booleans 
> when operating on objects. So another fix is to write special case 
> loops for logical_{not, or, and, xor} that do the same. Perhaps a 
> ticket for an enhancement should be opened.
There should already be special-case loops for those cases, right?    
Only the general purpose loops O_O and OO_O which were being used for 
the "method-call" on object arrays.  

Are you saying that we should actually return "boolean" arrays instead 
of object arrays for the logical operations on Object arrays?    That is 
a relevant suggestion but is a change in code.   I'm inclined not to do 
it,  because it limits the ways that logical_and can be used.  Perhaps a 
single boolean is not what is desired on output, but a whole "object" of 


More information about the Numpy-discussion mailing list