bpo-45383: Inherit MetaClass from bases in FromSpec API by seberg · Pull Request #28748 · python/cpython · GitHub

github.com

Tin mới

seberg:fromspec-metatype-inheritance

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

BUG: Inherit MetaClass from bases in FromSpec API

📜🤖 Added by blurb_it.

View reviewed changes

Learn more about hiding disruptive comments

The reason will be displayed to describe this comment to others. Learn more.

MAINT: Address review comments

gh-60074: add new stable API function PyType_FromMetaclass #93012

Merge in the main branch

Disallow non-type metaclasses

Use custom metaclasses for the tests, rather than stuff from ctypes

Make PyType_FromMetaclass refcounting easier to follow

Adjust documentation

View reviewed changes

Objects/typeobject.c

Consider adding PyType_FromMetaclass python/pythoncapi-compat#41

Remove unused includes from _testcapimodule.c

Use an explicit role in the News entry

Test that __subclasses__ is updated properly

Document caveats, suggest that PyType_From* is not for user-provided …

Remove unused variable

Move bases calculation before the allocation

PyType_FromSpec API fails to use metaclass of bases #89546

Fix compiler warning for Py_NewRef result

View reviewed changes

Use PyErr_Occurred rather than a variable

Replace duplicate Py_TPFLAGS_BASETYPE check with an assert

https://github.com/python/cpython/blob/main/Lib/test/test_capi.py#L910

Hm, I was under the impression that most of these tests were split like that. If a test fail, is it easier to see where and why it failed if the assert is on the Py side?

gh-89546: Clean up PyType_FromMetaclass #93686

: Clean up PyType_FromMetaclass (

Revert 30935 defer bpo45162 to 312 (

emscripten-core/emscripten#17269