Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation of struct_seq types #37335

Closed
freddrake opened this issue Oct 17, 2002 · 5 comments
Closed

Creation of struct_seq types #37335

freddrake opened this issue Oct 17, 2002 · 5 comments
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@freddrake
Copy link
Member

BPO 624827
Nosy @freddrake, @devdanzin

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2009-02-09.22:17:58.896>
created_at = <Date 2002-10-17.18:51:59.000>
labels = ['extension-modules', 'type-feature']
title = 'Creation of struct_seq types'
updated_at = <Date 2009-02-09.22:17:58.895>
user = 'https://github.com/freddrake'

bugs.python.org fields:

activity = <Date 2009-02-09.22:17:58.895>
actor = 'rhettinger'
assignee = 'none'
closed = True
closed_date = <Date 2009-02-09.22:17:58.896>
closer = 'rhettinger'
components = ['Extension Modules']
creation = <Date 2002-10-17.18:51:59.000>
creator = 'fdrake'
dependencies = []
files = []
hgrepos = []
issue_num = 624827
keywords = []
message_count = 5.0
messages = ['12819', '12820', '12821', '12822', '81500']
nosy_count = 3.0
nosy_names = ['fdrake', 'ehuss', 'ajaksu2']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue624827'
versions = []

@freddrake
Copy link
Member Author

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.

@freddrake freddrake added extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels Oct 17, 2002
@freddrake
Copy link
Member Author

Logged In: YES
user_id=3066

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

@ehuss
Copy link
Mannequin

ehuss mannequin commented Jun 26, 2004

Logged In: YES
user_id=393416

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

@freddrake
Copy link
Member Author

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).

@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Feb 9, 2009

bpo-980098 was considered obsolete now there is namedtuple, so this
one should be closed too.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants