Re: [Python-Dev] C API for appending to arrays

2009-02-04 Thread Hrvoje Niksic
Mike Klaas wrote: Do you need to append, or are you just looking to create/manipulate an array with a bunch of c-float values? Mostly real-life examples I've seen of this were creating an array from C values obtained from an external source, such as an on-disk file, or another process. The

Re: [Python-Dev] C API for appending to arrays

2009-02-03 Thread Mike Klaas
On 2-Feb-09, at 9:21 AM, Hrvoje Niksic wrote: It turns out that an even faster method of creating an array is by using the fromstring() method. fromstring() requires an actual string, not a buffer, so in C++ I created an std::vector with a contiguous array of doubles, passed that array t

Re: [Python-Dev] C API for appending to arrays

2009-02-03 Thread Hrvoje Niksic
Raymond Hettinger wrote: [Hrvoje Niksic] The one thing missing from the array module is the ability to directly access array values from C. Please put a feature request on the bug tracker. Done, http://bugs.python.org/issue5141 ___ Python-Dev mail

Re: [Python-Dev] C API for appending to arrays

2009-02-02 Thread Raymond Hettinger
[Hrvoje Niksic] The one thing missing from the array module is the ability to directly access array values from C. Please put a feature request on the bug tracker. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/

[Python-Dev] C API for appending to arrays

2009-02-02 Thread Hrvoje Niksic
The array.array type is an excellent type for storing a large amount of "native" elements, such as integers, chars, doubles, etc., without involving the heavy machinery of numpy. It's both blazingly fast and reasonably efficient with memory. The one thing missing from the array module is the