py3.10-prep: reset the type cache after feature switching
authorChristian Tismer <tismer@stackless.com>
Sat, 8 May 2021 14:06:23 +0000 (16:06 +0200)
committerDmitry Shachnev <mitya57@debian.org>
Tue, 16 Nov 2021 09:16:14 +0000 (09:16 +0000)
commit87284f28e3f3531ce5466b75869a8218d88a383c
treecd2e58f734d91df31ecfbe3efacf1b6c5c6aaa81
parent60a6ad9eeffe4e833992f688655ec305e9e84138
py3.10-prep: reset the type cache after feature switching

When using feature switching in Python 3.10, there were
funny effects where switched and un-switched versions appeared
to co-exist.

It turned out that we were hit by function caching that
is now implemented for the LOAD_ATTR opcode.

It was not known that caching would happen at all for
PySide classes because we don't use Py_TPFLAGS_VALID_VERSION_TAG.
But actually, this flag is used internally by Python to do some
optimizations, and we just have to notify the interpreter of
type changes by PyType_Modified().

(cherry picked from commit 3a2b7c6f88bba04d8b7ddb571163d23c15c36a4f)

Gbp-Pq: Name py3.10-prep-reset-the-type-cache-after-feature-switching.patch
sources/pyside2/libpyside/feature_select.cpp