[issue15870] PyType_FromSpec should take metaclass as an argument

Josh Haberman report at bugs.python.org
Thu Sep 23 17:26:50 EDT 2021


Josh Haberman <haberman at google.com> added the comment:

> It's better to pass the metaclass as a function argument, as with bases. I'd prefer adding a new function that using a slot.

Bases are available both as a slot (Py_tp_bases) and as an argument (PyType_FromSpecWithBases).  I don't see why this has to be an either/or proposition.  Both can be useful.

Either would satisfy my use case.  I'm constructing N such classes, so the spec won't be statically initialized anyway and the initialization issues on Windows don't apply.

----------

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


More information about the Python-bugs-list mailing list