Charles R Harris wrote: > > I think Python lists are basically just expanding arrays and pointers > are cheap. Where you might lose is in creating python objects to put > in the list and not having ufuncs and the rest of the numpy machinery. > If you don't need the machinery, lists are probably not a bad way to go.
I am not familiar enough with the kdtree code: if you need to manipulate core datatypes (float, etc...), I think python lists are a significant cost, because of pointer chasing in particular. It may or may not apply, but Stefan used some tricks to avoid using python list and use basic C structures in some custom code (written in cython), maybe he has something to say. I would love having a core C library of containers - there are a few candidates we could take code from: - http://github.com/stevedekorte/basekit: used in IO programming language. Quite a few goodies, from list to trees to sets to portable code to load dynamically loaded libraries. BSD - The Apple Core Foundation (I have to check the Apple license is ok). It is more complex, but is designed with objective-C in mind, meaning integration with the C python API may be easier (both Obj-C and Python C API being based on ref counting). - Another one mentioned by Robert Kern, I forgot the reference. I hope to make it my main focus for the 1.5 release, cheers, David _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion