extending python with array functions
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Tue Feb 5 12:06:59 EST 2008
En Tue, 05 Feb 2008 05:28:33 -0200, Marc 'BlackJack' Rintsch
<bj_666 at gmx.net> escribi�:
> On Mon, 04 Feb 2008 20:56:02 -0200, Gabriel Genellina wrote:
>
>> - the array module http://docs.python.org/lib/module-array.html provides
>> homogeneuos arrays that may be more efficient for your application.
>> arrays
>> don't have a special API, you have to import the module and use its
>> functions the same as one would do in pure Python.
>
> There's one special thing about it: the `buffer_info()` method returns a
> tuple with the memory address and length (in items) of the current
> underlying buffer. Pretty useless information in Python but handy in
> extensions that can directly access the "raw" memory.
Good to know! I didn't notice it the (only) time I had to use arrays from
C code.
--
Gabriel Genellina
More information about the Python-list
mailing list