17 Oct
2002
17 Oct
'02
6:28 p.m.
"Fred L. Drake, Jr."
Have you looked at what it would take to create new "structure sequence" types from Python code?
Not really, but I think all you need to do is to expose PyStructSequence_InitType. I would recommend an interface like struct_seq(name, doc, n_in_sequence, (fields)) where fields is a list of (name,doc) tuples. You will need to temporarily allocate a PyStructSequence_Field array of len(fields)+1 elements, and put the PyStructSequence_Desc on the stack. You will also need to dynamically allocate a PyTypeObject which you return. I would put this into the new module. Regards, Martin