CPython defines 375 attributes with PyMemberDef and PyGetSetDef (excluding the _test* modules), but the test suite never assigns to 187 of them and never deletes 332 of them.
Deletion in particular is almost untested, although it is a separate code path: the setter is called with NULL, and an implementation which does not expect this crashes or leaves the object in a broken state.
Three bugs found this way are gh-156099, gh-156100 and gh-156101; gh-152817 is another one.
The following PR adds writing and deleting tests for each writable attribute.
Linked PRs
CPython defines 375 attributes with
PyMemberDefandPyGetSetDef(excluding the_test*modules), but the test suite never assigns to 187 of them and never deletes 332 of them.Deletion in particular is almost untested, although it is a separate code path: the setter is called with
NULL, and an implementation which does not expect this crashes or leaves the object in a broken state.Three bugs found this way are gh-156099, gh-156100 and gh-156101; gh-152817 is another one.
The following PR adds writing and deleting tests for each writable attribute.
Linked PRs