Re: [Numpy-discussion] : Boolean binary '-' operator

2017-06-27 Thread Alan Isaac
On 6/27/2017 5:35 PM, Nathaniel Smith wrote: I remember... The major issue here is that some people want dot(a, b) on Boolean matrices to use these semantics, right? Yes; this has worked in the past, and loss of this functionality is unexpected. That said, I haven't used this outside of a tea

Re: [Numpy-discussion] Boolean binary '-' operator

2017-06-27 Thread Eric Wieser
It seems to me that after a healthy post-deprecation cycle, and if we choose to keep the Z/2 meaning of __sub__, it might be worth reintroducing __neg__ as a no-op? AFAICT, this is consistent with the Z/2 interpretation? Eric On Wed, 28 Jun 2017 at 00:08 Nathaniel Smith wrote: > On Tue, Jun 27,

Re: [Numpy-discussion] Boolean binary '-' operator

2017-06-27 Thread Nathaniel Smith
On Tue, Jun 27, 2017 at 3:09 PM, Robert Kern wrote: > On Tue, Jun 27, 2017 at 3:01 PM, Benjamin Root wrote: >> >> Forgive my ignorance, but what is "Z/2"? > > https://groupprops.subwiki.org/wiki/Cyclic_group:Z2 > https://en.wikipedia.org/wiki/Cyclic_group This might be a slightly better link? ht

Re: [Numpy-discussion] Boolean binary '-' operator

2017-06-27 Thread Robert Kern
On Tue, Jun 27, 2017 at 3:01 PM, Benjamin Root wrote: > > Forgive my ignorance, but what is "Z/2"? https://groupprops.subwiki.org/wiki/Cyclic_group:Z2 https://en.wikipedia.org/wiki/Cyclic_group -- Robert Kern ___ NumPy-Discussion mailing list NumPy-Dis

Re: [Numpy-discussion] Boolean binary '-' operator

2017-06-27 Thread Benjamin Root
Forgive my ignorance, but what is "Z/2"? On Tue, Jun 27, 2017 at 5:35 PM, Nathaniel Smith wrote: > On Jun 26, 2017 6:56 PM, "Charles R Harris" > wrote: > > >> On 27 Jun 2017, 9:25 AM +1000, Nathaniel Smith , wrote: >> > I guess my preference would be: >> 1) deprecate + >> 2) move binary - back

Re: [Numpy-discussion] Boolean binary '-' operator

2017-06-27 Thread Nathaniel Smith
On Jun 26, 2017 6:56 PM, "Charles R Harris" wrote: > On 27 Jun 2017, 9:25 AM +1000, Nathaniel Smith , wrote: > I guess my preference would be: > 1) deprecate + > 2) move binary - back to deprecated-but-not-an-error > 3) fix np.diff to use logical_xor when the inputs are boolean, since > that see

Re: [Numpy-discussion] why a[0][0].__mul__(a[0][0]) where a is np.array, gives 'missing 1 required positional argument'?

2017-06-27 Thread Sebastian Berg
On Tue, 2017-06-27 at 04:54 -0500, Larry Evans wrote: > The following code: > > --{--cut here-- > #Purpose: > #  Demonstrate class with __add__ and __mult__ methods > #  to demonstrate shortestPath calculations. > #OriginalSource: > #  ./shortestPath.py > #References: > #  [1]  > http://www.marina

Re: [Numpy-discussion] why a[0][0].__mul__(a[0][0]) where a is np.array, gives 'missing 1 required positional argument'?

2017-06-27 Thread Robert Kern
On Tue, Jun 27, 2017 at 2:54 AM, Larry Evans wrote: > a= > [[ 12.0] > [12.0 <0>]] > a[0]= > [ 12.0] > a[0][0]= > > Traceback (most recent call last): > File "shortestPathABC.py", line 123, in > a00mul=a[0][0].__mul__(a[0][0]) > TypeError: __mul__() missing 1 required positional argument:

[Numpy-discussion] why a[0][0].__mul__(a[0][0]) where a is np.array, gives 'missing 1 required positional argument'?

2017-06-27 Thread Larry Evans
The following code: --{--cut here-- #Purpose: # Demonstrate class with __add__ and __mult__ methods # to demonstrate shortestPath calculations. #OriginalSource: # ./shortestPath.py #References: # [1] http://www.marinamele.com/2014/04/modifying-add-method-of-python-class.html # [2] https://