Author vstinner
Recipients vstinner
Date 2021-04-07.21:48:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-04-07 21:48:22vstinnersetrecipients: + vstinner
2021-04-07 21:48:22vstinnersetmessageid: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org>
2021-04-07 21:48:22vstinnerlinkissue43770 messages
2021-04-07 21:48:22vstinnercreate