[Numpy-discussion] Re: The source code corresponding to numpy.invert.

2021-10-04 Thread Robert Kern
On Mon, Oct 4, 2021 at 1:09 AM  wrote:

> Thank you for pointing this out. This is the code block which includes the
> first appearance of the keyword `logical_not`.
>
> BTW, why can't the ~ operator be tested equal to 'np.invert', as shown
> below:
>
> ```
> In [1]: import numpy as np
> In [3]: np.invert is np.bitwise_not
> Out[3]: True
>
> In [4]: np.invert is ~
>   File "", line 1
> np.invert is ~
>   ^
> SyntaxError: invalid syntax
> ```
>

That’s just the way Python’s syntax works. Operators are not names that can
be resolved to objects that can be compared with the `is` operator.
Instead, when that operator is evaluated in an expression, the Python
interpreter will look up a specially-named method on the operand object (in
this case `__invert__`). Numpy array objects implement this method using
`np.invert`.
-- 
Robert Kern
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: The source code corresponding to numpy.invert.

2021-10-04 Thread Hongyi Zhao
On Mon, Oct 4, 2021 at 4:41 PM Robert Kern  wrote:
>
> On Mon, Oct 4, 2021 at 1:09 AM  wrote:
>>
>> Thank you for pointing this out. This is the code block which includes the 
>> first appearance of the keyword `logical_not`.
>>
>> BTW, why can't the ~ operator be tested equal to 'np.invert', as shown below:
>>
>> ```
>> In [1]: import numpy as np
>> In [3]: np.invert is np.bitwise_not
>> Out[3]: True
>>
>> In [4]: np.invert is ~
>>   File "", line 1
>> np.invert is ~
>>   ^
>> SyntaxError: invalid syntax
>> ```
>
>
> That’s just the way Python’s syntax works. Operators are not names that can 
> be resolved to objects that can be compared with the `is` operator. Instead, 
> when that operator is evaluated in an expression, the Python interpreter will 
> look up a specially-named method on the operand object (in this case 
> `__invert__`). Numpy array objects implement this method using `np.invert`.

If so, which is symlink to which, I mean, which is the original name,
and which is an alias?

HZ
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: Drop 32 bit manylinux wheels

2021-10-04 Thread Matthew Brett
Hi,

Dropping 32-bit wheels seems very reasonable at this stage, as long as
we keep testing on 32-bit, for the Raspberry Pi folks,

Cheers,

Matthew

On Sun, Oct 3, 2021 at 6:27 PM Charles R Harris
 wrote:
>
> Hi All,
>
> Dropping 32 manylinux wheels was discussed in a triage meeting some time ago 
> and the general consensus was to do so. However, it has never been run past 
> the larger community on the discussion list, so this is that. Note that we 
> have already dropped 32 bit manylinux wheels for the upcoming Python 3.10 as 
> that Python version is only available on Ubuntu focal (20.04) and Ubuntu 
> dropped 32 bit support in 19.10 while Fedora dropped it in 31. Rasbian is 
> still largely 32 bit, but they have their own ppa source.  We will continue 
> to offer 32 wheels on Windows as it remains popular there.
>
> Thoughts?
>
> Chuck
> ___
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: matthew.br...@gmail.com
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: The source code corresponding to numpy.invert.

2021-10-04 Thread Robert Kern
On Mon, Oct 4, 2021 at 5:17 AM Hongyi Zhao  wrote:

>
> > That’s just the way Python’s syntax works. Operators are not names that
> can be resolved to objects that can be compared with the `is` operator.
> Instead, when that operator is evaluated in an expression, the Python
> interpreter will look up a specially-named method on the operand object (in
> this case `__invert__`). Numpy array objects implement this method using
> `np.invert`.
>
> If so, which is symlink to which, I mean, which is the original name,
> and which is an alias?
>

"symlink" and "alias" are probably not the best analogies. The
implementation of `np.ndarry.__invert__` simply calls `np.invert` to do the
actual computation.

-- 
Robert Kern
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: The source code corresponding to numpy.invert.

2021-10-04 Thread Hongyi Zhao
On Mon, Oct 4, 2021 at 9:33 PM Robert Kern  wrote:
>
> On Mon, Oct 4, 2021 at 5:17 AM Hongyi Zhao  wrote:
>>
>>
>> > That’s just the way Python’s syntax works. Operators are not names that 
>> > can be resolved to objects that can be compared with the `is` operator. 
>> > Instead, when that operator is evaluated in an expression, the Python 
>> > interpreter will look up a specially-named method on the operand object 
>> > (in this case `__invert__`). Numpy array objects implement this method 
>> > using `np.invert`.
>>
>> If so, which is symlink to which, I mean, which is the original name,
>> and which is an alias?
>
>
> "symlink" and "alias" are probably not the best analogies. The implementation 
> of `np.ndarry.__invert__` simply calls `np.invert` to do the actual 
> computation.

It seems that the above calling/invoking logic/mechanism is not so
clear or easy to understand/figure out only by reading the document,
say, by the following commands in IPython:

import numpy as np
help(np.invert)
np.invert?
np.info(np.invert)

Regards,
HY
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: The source code corresponding to numpy.invert.

2021-10-04 Thread Stephen Waterbury

On 10/4/21 10:07 AM, Hongyi Zhao wrote:


On Mon, Oct 4, 2021 at 9:33 PM Robert Kern  wrote:

On Mon, Oct 4, 2021 at 5:17 AM Hongyi Zhao  wrote:



That’s just the way Python’s syntax works. Operators are not names that can be 
resolved to objects that can be compared with the `is` operator. Instead, when 
that operator is evaluated in an expression, the Python interpreter will look 
up a specially-named method on the operand object (in this case `__invert__`). 
Numpy array objects implement this method using `np.invert`.

If so, which is symlink to which, I mean, which is the original name,
and which is an alias?


"symlink" and "alias" are probably not the best analogies. The implementation 
of `np.ndarry.__invert__` simply calls `np.invert` to do the actual computation.

It seems that the above calling/invoking logic/mechanism is not so
clear or easy to understand/figure out only by reading the document,
say, by the following commands in IPython:

import numpy as np
help(np.invert)
np.invert?
np.info(np.invert)


You probably want to read the Python Language Reference regarding 
"Special Methods":


https://docs.python.org/3.9/reference/datamodel.html#special-method-names 



HTH,
Steve


___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: The source code corresponding to numpy.invert.

2021-10-04 Thread Hongyi Zhao
On Mon, Oct 4, 2021 at 11:54 PM Stephen Waterbury
 wrote:
>
> On 10/4/21 10:07 AM, Hongyi Zhao wrote:
>
> On Mon, Oct 4, 2021 at 9:33 PM Robert Kern  wrote:
>
> On Mon, Oct 4, 2021 at 5:17 AM Hongyi Zhao  wrote:
>
> That’s just the way Python’s syntax works. Operators are not names that can 
> be resolved to objects that can be compared with the `is` operator. Instead, 
> when that operator is evaluated in an expression, the Python interpreter will 
> look up a specially-named method on the operand object (in this case 
> `__invert__`). Numpy array objects implement this method using `np.invert`.
>
> If so, which is symlink to which, I mean, which is the original name,
> and which is an alias?
>
> "symlink" and "alias" are probably not the best analogies. The implementation 
> of `np.ndarry.__invert__` simply calls `np.invert` to do the actual 
> computation.
>
> It seems that the above calling/invoking logic/mechanism is not so
> clear or easy to understand/figure out only by reading the document,
> say, by the following commands in IPython:
>
> import numpy as np
> help(np.invert)
> np.invert?
> np.info(np.invert)
>
> You probably want to read the Python Language Reference regarding "Special 
> Methods":
>
> https://docs.python.org/3.9/reference/datamodel.html#special-method-names

Thank you for directing me to this helpful documentation.

HZ
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com