[Numpy-discussion] suggestion for generalizing numpy functions

Darren Dale dsdale24@gmail....
Tue Jul 21 06:44:33 CDT 2009

2009/7/20 Stéfan van der Walt <stefan@sun.ac.za>:
> Hi Chuck
> 2009/7/17 Charles R Harris <charlesr.harris@gmail.com>:
>> PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos)
>> Return value: Borrowed reference.
>> Return the object at position pos in the tuple pointed to by p. If pos is
>> out of bounds, return NULL and sets an IndexError exception. It's a borrowed
>> reference so you need to call Py_INCREF on it. I find this Python C-API
>> documentation useful.
> Have you had a look over the rest of the code?  I think this would
> make a good addition.  Travis mentioned Contexts for doing something
> similar, but I don't know enough about that concept to compare the
> two.

I think contexts would be very different from what is already in
place. For now, it would be nice to make this one small improvement to
the existing ufunc infrastructure, and maybe consider contexts (which
I still don't understand) at a later time. I have improved the code
slightly and added a few tests, and will post a new patch later this
morning. I just need to add some documentation.


More information about the NumPy-Discussion mailing list