On Mon, Oct 4, 2021 at 9:33 PM Robert Kern <[email protected]> wrote: > > On Mon, Oct 4, 2021 at 5:17 AM Hongyi Zhao <[email protected]> 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 -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: [email protected]
