[ python-Bugs-624827 ] Creation of struct_seq types

SourceForge.net noreply at sourceforge.net
Thu Apr 27 02:08:09 CEST 2006


Bugs item #624827, was opened at 2002-10-17 14:51
Message generated for change (Comment added) made by fdrake
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=624827&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
Group: Feature Request
Status: Open
Resolution: None
Priority: 5
Submitted By: Fred L. Drake, Jr. (fdrake)
>Assigned to: Nobody/Anonymous (nobody)
Summary: Creation of struct_seq types

Initial Comment:
It would be really nice to be able to create structure
sequence types from within Python.  MvL suggested:
-------------------
... 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.
-------------------
Assigned to me since I actually wanted to create these
things.

----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2006-04-26 20:08

Message:
Logged In: YES 
user_id=3066

I'm not going to have any time to look at this; hopefully
somebody else can, since it's a pretty reasonable idea I
think.  It may not be as valuable as it once was, however
(subclassing tuple and using properties has become more
attractive using an @property decoration).

----------------------------------------------------------------------

Comment By: Eric Huss (ehuss)
Date: 2004-06-25 21:13

Message:
Logged In: YES 
user_id=393416

Uploaded patch 980098 which implements this functionality as 
a separate module.


----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-10-22 16:26

Message:
Logged In: YES 
user_id=3066

As part of this, struct_seq types should be made subclassable.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=624827&group_id=5470


More information about the Python-bugs-list mailing list