Le ven. 10 avr. 2020 à 22:00, Antoine Pitrou <solipsis@pitrou.net> a écrit :
How do you keep fast type checking such as PyTuple_Check() if extension code doesn't have access e.g. to tp_flags?
I notice you did: """ Add fast inlined version _PyType_HasFeature() and _PyType_IS_GC() for object.c and typeobject.c. """
So you understand there is a need.
By the way, CPython currently uses statically allocated types for builtin types like str or list. This may have to change to run efficiently multiple subinterepters in parallel: each subinterpeter should have its own heap-allocated type with its own reference counter. Using heap allocated types means that PyUnicode_Check() implementation has to change. It's just another good reason to better hide PyUnicode_Check() implementation right now ;-) Victor