A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-October/029665.html below:

creating struct-seq types from Python

[Python-Dev] Re: creating struct-seq types from Python [Python-Dev] Re: creating struct-seq types from PythonMartin v. Loewis martin@v.loewis.de
17 Oct 2002 20:28:54 +0200
"Fred L. Drake, Jr." <fdrake@acm.org> writes:

> 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




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4