Author vstinner
Recipients vstinner
Date 2021-04-07.21:48:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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


  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:22vstinnersetrecipients: + vstinner
2021-04-07 21:48:22vstinnersetmessageid: <>
2021-04-07 21:48:22vstinnerlinkissue43770 messages
2021-04-07 21:48:22vstinnercreate