user-defined type example

Matt Knox mattknox_ca at
Sat Oct 7 15:11:56 CDT 2006

Could someone please point me to/provide me with a basic example of creating a user defined type?
Here is my completely naive attempt which obviously doesn't work...import numpy
class myType(numpy.void):    def __init__(self,val):        self.val = val
testType = numpy.dtype(myType)
val1 = myType(5)val2 = myType(6)
foo = numpy.array([val1,val2],testType)
Any help would be greatly appreciated. Thanks,
- Matt Knox
Be one of the first to try Windows Live Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
-------------- next part --------------
Numpy-discussion mailing list
Numpy-discussion at

More information about the Numpy-discussion mailing list