see discussion in #148124 (comment)
abc.register will change the tp_flags but don't update the type version, so JIT won't invalid the old trace:
cpython/Modules/_abc.c
Lines 601 to 603 in 03d2f03
CPython main branch
No response
To be clear: this affects the specializing interpreter as well. So it should be backported to 3.13 at the very least.
gh-148450: `abc.register` needs to update `type_version` when `tp_fla…
[3.15] gh-148450: `abc.register` needs to update `type_version` when …
[3.13] gh-148450: abc.register needs to update type_version when tp_f…
[3.14] gh-148450: abc.register needs to update type_version when tp_f…
Activity
Fidget-Spinner commented on Apr 12, 2026
To be clear: this affects the specializing interpreter as well. So it should be backported to 3.13 at the very least.
gh-148450: `abc.register` needs to update `type_version` when `tp_fla…
[3.15] gh-148450: `abc.register` needs to update `type_version` when …
[3.13] gh-148450: abc.register needs to update type_version when tp_f…
[3.14] gh-148450: abc.register needs to update type_version when tp_f…