Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use AC for type checking
  • Loading branch information
JelleZijlstra committed Aug 12, 2025
commit 06618d8804ecc123f8eb1da1fb6a6f131da93af0
22 changes: 21 additions & 1 deletion Python/clinic/sysmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2644,7 +2644,7 @@ sys__baserepl_impl(PyObject *module)
/*[clinic input]
sys._clear_type_descriptors

type: object
type: object(subclass_of='&PyType_Type')
/

Private function for clearing certain descriptors from a type's dictionary.
Expand All @@ -2653,14 +2653,10 @@ See gh-135228 for context.
[clinic start generated code]*/

static PyObject *
sys__clear_type_descriptors(PyObject *module, PyObject *type)
/*[clinic end generated code: output=7d5cefcf861909e0 input=5fdc23500d477de6]*/
sys__clear_type_descriptors_impl(PyObject *module, PyObject *type)
/*[clinic end generated code: output=5ad17851b762b6d9 input=dc536c97fde07251]*/
{
if (!PyType_Check(type)) {
PyErr_SetString(PyExc_TypeError, "argument must be a type");
return NULL;
}
PyTypeObject *typeobj = (PyTypeObject *)(type);
PyTypeObject *typeobj = (PyTypeObject *)type;
if (_PyType_HasFeature(typeobj, Py_TPFLAGS_IMMUTABLETYPE)) {
PyErr_SetString(PyExc_TypeError, "argument is immutable");
return NULL;
Expand Down
Loading