[New-bugs-announce] [issue41171] Create companion methods of "PyType_FromSpec*" to allow setting metaclass.

William Pickard report at bugs.python.org
Tue Jun 30 11:34:35 EDT 2020


New submission from William Pickard <lollol222gg at gmail.com>:

The current goal from what I can tell for Python is to have all C based modules move away from static types and instead use "PyType_FromSpec" and the variant that specifies base classes.

The only problem is, PyType_FromSpec and it's variant makes the assumption the caller wants "PyType_Type" as the type's metaclass.

Why not add companion methods to them prefixed with "PyMetaType" and have the "PyType" ones internally invoke these new methods with "PyType_Type" as the metaclass (to keep existing behavior and backwards compatibility)

----------
components: C API
messages: 372696
nosy: WildCard65
priority: normal
severity: normal
status: open
title: Create companion methods of "PyType_FromSpec*" to allow setting metaclass.
type: enhancement
versions: Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41171>
_______________________________________


More information about the New-bugs-announce mailing list