A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-September/048903.html below:

[Python-Dev] Re: ANN: PEP 335: Overloadable Boolean Operators

[Python-Dev] Re: ANN: PEP 335: Overloadable Boolean Operators [Python-Dev] Re: ANN: PEP 335: Overloadable Boolean OperatorsTim Hochberg tim.hochberg at ieee.org
Tue Sep 14 21:50:00 CEST 2004
Phillip J. Eby wrote:

[CHOP]
>
> As for the numeric use cases, I'm not at all clear why &, |, and ~ (or 
> special methods/functions) aren't suitable.

They often are, but sometimes you want a logical and/or/not and &/|/~ 
are mapped to bitwise and/or/not, which isn't always what you want. 
Presumably, if Gregs proposal were adopted, and/or/not would get mapped 
to numarray.logical_and/or/not.

What I find more interesting about this proposal is that one could 
probably finagle it so that (A < B < C) worked correctly for arrays. It 
can't work now since it is equivalent to ((A < B) and (B < C)) and 'and' 
  doesn't do anything sensible for arrays at present. This is one I 
always expect to work even though I know that and/or/not don't work for 
arrays.

-tim

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4