numarray: PyArrayObject supports number protocols?

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"?

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"?
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 answer. Perry

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. Regards, Todd
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 answer.
Perry
participants (3)
-
Edward C. Jones
-
Perry Greenfield
-
Todd Miller