[New-bugs-announce] [issue42423] Support passing single class to PyType_FromSpecWithBases and PyType_FromModuleAndSpec
Serhiy Storchaka
report at bugs.python.org
Sat Nov 21 05:19:14 EST 2020
New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:
It is common that class have a single base class. PyType_FromModuleAndSpec() is only called with NULL as bases (that means inheriting object) in the stdlib, and PyType_FromSpecWithBases() is called with a 1-tuple as bases all three times (not counting tests).
Since it is a common case, PyErr_NewException() accept both a tuple and a single class as the base argument. I propose to accept a single class also in PyType_FromSpecWithBases() and PyType_FromModuleAndSpec().
----------
components: C API
messages: 381542
nosy: christian.heimes, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Support passing single class to PyType_FromSpecWithBases and PyType_FromModuleAndSpec
type: enhancement
versions: Python 3.10
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42423>
_______________________________________
More information about the New-bugs-announce
mailing list