Message390484
Currently, PyType_Ready() is called late on many static types, which can lead to bugs. For example, PyObject_SetAttr() can fail if the type of the object is not ready yet. PyType_Read() is responsible to initialize tp_getattro and tp_setattro members of the PyTypeObject structure.
We must explicitly initialize all static types before using them.
Moreover, many static types initialize explicitly :
tp_getattro = PyObject_GenericGetAttr
and:
tp_setattro = PyObject_GenericSetAttr
whereas it's the default implementation. They can be omitted.
I created this issue as a placeholder for multiple changes to modify how types implemented in C are initialized. |
|
Date |
User |
Action |
Args |
2021-04-07 21:48:22 | vstinner | set | recipients:
+ vstinner |
2021-04-07 21:48:22 | vstinner | set | messageid: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> |
2021-04-07 21:48:22 | vstinner | link | issue43770 messages |
2021-04-07 21:48:22 | vstinner | create | |
|