This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Robin.Schreiber
Recipients Robin.Schreiber, loewis
Date 2012-08-19.20:15:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1345407378.13.0.964225258094.issue15729@psf.upfronthosting.co.za>
In-reply-to
Content
To create a HeapType from Structseq description, there is the helpful, yet undocumented PyStructSequence_NewType Method, which can do just that.
Until now, this method solely allocates some generic TypeObject on which it then performs PyStructSequence_InitType().

I have found that this is far from enough, as for one the flags of the type are not set appropriately and neither ht_name nor ht_qualname are set (which is as far as I know required of a proper Heaptype).
I have now added this missing initialization of the fields to PyStructSequence_NewType(). 

I have also changed the previous definition of PyStructSequence_InitType, by extracting a new Method _PyStructSequence_InitTypeWithFlags. This initializes the given type with the flags variable passed to the function.
This method extraction is needed, as we can not alter the semantics of InitType itself, yet need some way to initialize a SequenceType with Heaptype-flags, without having too much duplicate code.
History
Date User Action Args
2012-08-19 20:16:18Robin.Schreibersetrecipients: + Robin.Schreiber, loewis
2012-08-19 20:16:18Robin.Schreibersetmessageid: <1345407378.13.0.964225258094.issue15729@psf.upfronthosting.co.za>
2012-08-19 20:15:56Robin.Schreiberlinkissue15729 messages
2012-08-19 20:15:56Robin.Schreibercreate