Text of bugs.python.org › issue42423 as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

Issue 42423: Support passing single class to PyType_FromSpecWithBases and PyType_FromModuleAndSpec - Python tracker

Python Home About News Documentation Downloads Community Foundation Developer's Guide Issue Tracker Issues Search Random Issue Summaries Issues with patch Easy issues Stats User Administration User List Committer List Help Tracker Documentation Tracker Development Report Tracker Problem Issue42423 ➜ 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.

Created on 2020-11-21 10:19 by serhiy.storchaka , last changed 2022-04-11 14:59 by admin . This issue is now closed . Pull Requests URL Status Linked Edit PR 23441 merged serhiy.storchaka , 2020-11-21 10:34 Messages (3) msg381542 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * Date: 2020-11-21 10:19 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(). msg381549 - (view) Author: Christian Heimes (christian.heimes) * Date: 2020-11-21 11:30 Excellent idea msg381610 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * Date: 2020-11-22 11:25 New changeset 686c203cd4355be5b7809a9d24b4aa3566d9371f by Serhiy Storchaka in branch 'master': bpo-42423 : Accept single base class in PyType_FromModuleAndSpec() ( GH-23441 ) https://github.com/python/cpython/commit/686c203cd4355be5b7809a9d24b4aa3566d9371f History Date User Action Args 2022-04-11 14:59:38 admin set github: 86589 2020-11-22 11:53:56 serhiy.storchaka set status: open -> closed resolution: fixed stage: patch review -> resolved 2020-11-22 11:25:10 serhiy.storchaka set messages: + msg381610 2020-11-21 11:30:13 christian.heimes set messages: + msg381549 2020-11-21 10:34:04 serhiy.storchaka set keywords: + patch stage: patch review pull_requests: + pull_request22333 2020-11-21 10:24:04 serhiy.storchaka set nosy: + petr.viktorin 2020-11-21 10:19:14 serhiy.storchaka create Supported by The Python Software Foundation , Powered by Roundup Copyright © 1990-2022, Python Software Foundation Legal Statements