[issue28709] PyStructSequence_NewType is broken; makes GC type without setting Py_TPFLAGS_HEAPTYPE

Josh Rosenberg report at bugs.python.org
Tue Nov 15 21:07:58 EST 2016


Josh Rosenberg added the comment:

On further checking, looks like there is a lot of work that should be done to initialize heap types (see PyType_FromSpecWithBases) that PyStructSequeuence_Init2 doesn't do (because it thinks it's working on a static type). I think the solution here is decouple PyStructSequeuence_NewType from PyStructSequeuence_Init2 (or to minimize code duplication, make both of them call a third internal function that accepts additional flags, e.g. to make the type a HEAPTYPE, BASETYPE, or both, and performs the additional work required for those flags if given); Init2 clearly expects a static type, and definitionally, NewType is producing a heap/dynamic type.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28709>
_______________________________________


More information about the Python-bugs-list mailing list