[Numpy-discussion] Toward release 1.0 of NumPy

Sasha ndarray at mac.com
Thu Apr 13 11:53:00 EDT 2006


On 4/12/06, Travis Oliphant <oliphant at ee.byu.edu> wrote:
> ...        This also dove-tails nicely
> with the Python 2.5 release schedule so that NumPy 1.0 should work with
> Python 2.5 and be fully 64-bit capable for handling very-large arrays.
>

I would like to mention one feature that is going to appear in Python
2.5 that is covering some of the functionality of NumPy.  I am talking
about the ctypes module
<http://starship.python.net/crew/theller/ctypes/tutorial.html>.  Like
NumPy, ctypes provides a set of python classes that represent basic C
types:

        c_byte
        c_char
        c_char_p
        c_double
        c_float
        c_int
        c_long
        c_short
        c_ubyte
         ...

and the ability to describe composite structures.  The later
functionality is very close to what dtype class provides in numpy.

There are some features in ctype that I like better than similar
features in numpy.  For example, in ctypes a fixed width array is
described by multiplying basic type by an integer:

>>> c_char * 10
<class '__main__.c_char_Array_10'>

I find this approach more elegant than numpy's dtype('S10').

It looks like there is some synergy to be exploited here, particularly
in the area of record arrays.




More information about the NumPy-Discussion mailing list