[Numpy-discussion] NumPy re-factoring project

Sturla Molden sturla@molden...
Sat Jun 12 23:54:29 CDT 2010

Den 13.06.2010 05:47, skrev David Cournapeau:
> This only works in simple cases. What do you do when you don't know
> the output size ?

First: If you don't know, you don't know. Then you're screwed and C is 
not going to help.

Second: If we cannot figure out how much to allocate before starting to 
use C (very unlikely), we can always use a callback to Python. Or we can 
have two C functions, the first determining the amount of allocation, 
the second doing the computation.

>   How do you deal with reallocation ?

That is platform dependent. A buffer object could e.g. have a realloc 

> How do you deal
> with ufunc and broadcasting buffering without allocating in the
> library ?

We allocate whatever we need on the Python side, possibly with a 
callback to Python if that's what we need.


More information about the NumPy-Discussion mailing list