>> Out of curiosity, how difficult would it be to implement a new >> container type that emulates python's list but only holds one time and >> would work with both PyObject* and c types? Say vector[type] to >> distinguish it from list. Here would be my wishlist, given my current >> use cases, in order of desirability. > > I don't think such a type should be built into Cython itself, but should > be written as just another class in pyx and pxd files (which can be > shipped with Cython perhaps).
Yes, I agree, that makes sense. Being able to do these operations for general stuff, beyond just something like vector[int], would be well worth implementing, at least in my book. I would use them frequently. > However, it seems to require templates/generics in Cython. So that would > be the place to start working. Unfortunately that would probably be some > work (on the order of a GSoC I think?), but I think that would be a much > better approach than hard-coding in a brand new vector type in Cython. Yes, I see; well I would love to help, but grad school has a way of sucking up one's free time, and there are probably better ways for me to learn the cython code base. > (This is when I usually state that I think it is better if we can properly > wrap STL though, which will hopefully be done something about in summer, > since the list of data structures which it would be nice to have doesn't > at all stop with vectors.) I totally agree; STL-type maps of int to double, etc. would be awesome and used often. --Hoyt ++++++++++++++++++++++++++++++++++++++++++++++++ + Hoyt Koepke + University of Washington Department of Statistics + http://www.stat.washington.edu/~hoytak/ + [email protected] ++++++++++++++++++++++++++++++++++++++++++ _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
