Need more comments from scientific community on python-dev

Sasha ndarray at mac.com
Sat Nov 4 12:03:24 CST 2006


On 11/3/06, Torgil Svensson <torgil.svensson at gmail.com> wrote:
> class struct_type(Structure):
>     _fields_ = [....]
>
> ...
> ... which is somewhat static in nature. How do you create "structures"
> dynamically?
>

You can put the above in a function that takes fields as an argument, or

    type('struct_type', (Structure,), {'_fields_':[('a', c_int), ('b',
c_long)]})

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Numpy-discussion mailing list