Re: [Numpy-discussion] What's the most numpythonic way to support multiple types in a C extension?

2012-06-27 Thread Nathaniel Smith
On Tue, Jun 26, 2012 at 10:53 PM, John Salvatier jsalv...@u.washington.edu wrote: I want to support multiple types in the index_increment function that I've written here: https://github.com/jsalvatier/numpy/blob/master/numpy/core/src/multiarray/mapping.c I need to check that the first

Re: [Numpy-discussion] What's the most numpythonic way to support multiple types in a C extension?

2012-06-27 Thread John Salvatier
Thanks nathaniel, that does tricky... On Wed, Jun 27, 2012 at 9:25 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 26, 2012 at 10:53 PM, John Salvatier jsalv...@u.washington.edu wrote: I want to support multiple types in the index_increment function that I've written here:

[Numpy-discussion] What's the most numpythonic way to support multiple types in a C extension?

2012-06-26 Thread John Salvatier
I want to support multiple types in the index_increment function that I've written here: https://github.com/jsalvatier/numpy/blob/master/numpy/core/src/multiarray/mapping.c I need to check that the first argument's type can support addition, cast the dataptr to the appropriate type and do the