[Numpy-discussion] numarray: PyArrayObject supports number protocols?
jmiller at stsci.edu
Thu Aug 4 07:43:28 EDT 2005
On Tue, 2005-08-02 at 15:53, Perry Greenfield wrote:
> On Jul 31, 2005, at 11:56 PM, Edward C. Jones wrote:
> > I just saw in the docs, Section 14.2.4:
> > It should be noted that unlike earlier versions of numarray, the
> > present PyArrayObject structure is a first class python object, with
> > full support for the number protocols in C.
> > Does this mean that I can add two numarrays in C using "PyNumber_Add"?
Yes. It should be noted that the numarray implementation of the number
protocol is (still) in Python so there are issues with "atomicity" and
the global interpreter lock just as there are with other Python
callbacks from C.
The documentation is referring to early versions of numarray where the
C-API's C-representation of an array was not a Python object at all.
> Todd is away for a few days, and I haven't found the actual support for
> this in the code, so I'm going to wait until he's back for a definitive
More information about the NumPy-Discussion