[Numpy-discussion] Numeric3 PEP
Colin J. Williams
cjw at sympatico.ca
Sat Feb 19 07:15:23 EST 2005
The PEP has:
In Python there will be a hierchial set of classes defined:
GenericArray (type classes)
BooleanArray (Bool)
NumericArray (XX is the bit-width of the type)
SignedArray
UnsignedArray
IntegerArray
SignedIntegerArray (IntXX)
UnsignedIntegerArray (UIntXX)
FloatArray (FloatXX)
ComplexArray (FloatXX)
FlexibleArray
CharacterArray
StringArray (String)
UnicodeArray (Unicode)
VoidArray (Void)
ObjectArray
It seems that the record type is to be handled under the VoidArray. I
hope that it will permit the setting and reading of fields.
For example, if recs is an instance of an Array of records, then it
should be possible to write:
>>> recs[22, 5].sex= 'F'
>>> recs[22, 5].sex
F
It is not clear, from the current draft, what is intended for
ObjectArray. Can these be any Python objects tuple, list etc. or
instances of any user defined class?
There is also a tofile method ( I would prefer toFile), does this mean
that pickling would be used for the object instances?
The term WRITABLE is used, is this different from "mutable", the term
used by Python?
"Methods such as x.r(), x.i(), and x.flatten() are proposed.". Why not
use properties, x.r, x.i and x.flatten. The parentheses appear redundant.
Colin W.
More information about the NumPy-Discussion
mailing list