[Numpy-discussion] RE: [Numpy-user] possible error with isarrtype
Travis Oliphant
oliphant.travis at ieee.org
Tue Jan 31 20:05:18 CST 2006
Colin J. Williams wrote:
> One of the deprecated names is ArrayType. This seems to be closer to
> the Python style than ndarray.
Not really.
Rather than test:
type(var) == types.IntType
you should be testing
isinstance(var, int)
just like rather than testing
type(somearray) == ArrayType
you should be testing
isinstance(somearray, ndarray)
Python style has changed a bit since 2.2 allowed sub-typing builtings
-Travis
More information about the Numpy-discussion
mailing list