FW: [Numpy-discussion] typecodes in numarray

Todd Miller jmiller at stsci.edu
Mon Jan 27 12:54:05 CST 2003


Francesc Alted wrote:

>A Dilluns 27 Gener 2003 20:52, Todd Miller va escriure:
>  
>
>>>Oh!, I didn't know that. In such a case, I think it's worth to consider
>>>the possibility to define records as classes descendants from
>>>metaclasses. But, of course, you have the ultimate decision.
>>>      
>>>
>>I don't know what you mean here.   Please spell it out a little more.
>>    
>>
>
>I was trying to mean that using something like :
>
>class Small(IsRecord):
>    field1 = defineType(CharType, 2, default="", position=1)
>    field2 = defineType(Int32, 1, position=2)
>    field3 = Float64
>
>as as container for recarray metadata is definitely possible instead of the
>tuple (formats="2aid",names=("field1","field2", "field3")), if using
>Python2.2. IsRecord is a metaclass (introduced in Python 2.2) that allows
>you to effectively separate the declared attributes from the implicit ones
>in normal classes.
>
>Of course, you can taylor IsRecord so as to fulfill your needs.
>
>I hope that I have expressed myself more clearly now,
>
>  
>
I looked at your docs here: 
http://pytables.sourceforge.net/html-doc/usersguide-html4.html#section4.2
and what you said above clicked.  Thanks.

Todd






More information about the Numpy-discussion mailing list