]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-117482: Simplify the Fix For Builtin Types Slot Wrappers (gh-122241)
authorEric Snow <ericsnowcurrently@gmail.com>
Wed, 24 Jul 2024 19:07:32 +0000 (13:07 -0600)
committerGitHub <noreply@github.com>
Wed, 24 Jul 2024 19:07:32 +0000 (19:07 +0000)
commitdd4c8aca61a90fe5d040f2a9b34b5a3f7f46ac64
treed672d15507114b5f03b00c77025720fca1a5655d
parent1a104e51129b6ec5a433241f3acf329cf692be94
[3.12] gh-117482: Simplify the Fix For Builtin Types Slot Wrappers (gh-122241)

In gh-121602, I applied a fix to a builtin types initialization bug.
That fix made sense in the context of some broader future changes,
but introduced a little bit of extra complexity.  For earlier versions
those future changes are not relevant; we can avoid the extra complexity.
Thus we can revert that earlier change and replace it with this one,
which is more focused and conceptually simpler.  This is essentially
the implementation of an idea that @markshannon pointed out to me.

Note that this change would be much smaller if we didn't have to deal
with repr compatibility for builtin types that explicitly inherit tp slots
(see expect_manually_inherited()).  The alternative is to stop
*explicitly* inheriting tp slots in static PyTypeObject values,
which is churn that we can do separately.

(cherry picked from commit 716c6771fcfd3be90bba9f888a579b36c02cdb13, AKA gh-121932)
Objects/typeobject.c
Tools/c-analyzer/cpython/globals-to-fix.tsv