-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Describe the bug
This code now hits an assertion in dev-builds of the CPython main branch:
cython/Cython/Utility/ExtensionTypes.c
Lines 694 to 699 in 7e8a172
#if CYTHON_COMPILING_IN_LIMITED_API | |
// Using PyObject_GenericSetAttr to bypass types immutability protection feels | |
// a little hacky, but it does work in the limited API . | |
// (It doesn't work on PyPy but that probably isn't a bug.) | |
result = PyObject_GenericSetAttr((PyObject*)tp, k, v); | |
#else |
assert(!PyType_IsSubtype(tp, &PyType_Type));
This is used in the auto-reduce setup code to fix up the reduce methods after creating the type. The assertion was added in
python/cpython#118454
Not sure if there's a way to work around this – or whether we should. It seems to be a hack on our side to update the type dict like this (even after adding the type to the module dict).
Code to reproduce the behaviour:
No response
Expected behaviour
No response
OS
No response
Python version
3.14
Cython version
master
Additional context
No response