diff options
author | Victor Stinner <vstinner@python.org> | 2022-01-22 17:56:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-22 17:56:11 (GMT) |
commit | 3a4c15bb9815b6f4652621fe6043ae18e0d202b3 (patch) | |
tree | 4658c000ebbc51976c0e759859280bdb68d0eca4 /Python/formatter_unicode.c | |
parent | 500c146387b01ea797b52e6a54caf228384e184c (diff) | |
download | cpython-3a4c15bb9815b6f4652621fe6043ae18e0d202b3.zip cpython-3a4c15bb9815b6f4652621fe6043ae18e0d202b3.tar.gz cpython-3a4c15bb9815b6f4652621fe6043ae18e0d202b3.tar.bz2 |
bpo-46417: Cleanup typeobject.c code (GH-30795)
* Add comment to recurse_down_subclasses() explaining why it's safe
to use a borrowed reference to tp_subclasses.
* remove_all_subclasses() no longer accept NULL cases
* type_set_bases() now relies on the fact that new_bases is not NULL.
* type_dealloc_common() avoids PyErr_Fetch/PyErr_Restore if tp_bases
is NULL.
* remove_all_subclasses() makes sure that no exception is raised.
* Don't test at runtime if tp_mro only contains types: rely on
_PyType_CAST() assertion for that.
* _PyStaticType_Dealloc() no longer clears tp_subclasses which is
already NULL.
* mro_hierarchy() avoids calling _PyType_GetSubclasses() if
tp_subclasses is NULL.
Coding style:
* Use Py_NewRef().
* Add braces and move variable declarations to the first variable
assignement.
* Rename a few variables and parameters to use better names.
Diffstat (limited to 'Python/formatter_unicode.c')
0 files changed, 0 insertions, 0 deletions