diff options
| author | Christian Tismer <tismer@stackless.com> | 2023-10-26 23:32:10 +0200 |
|---|---|---|
| committer | Christian Tismer <tismer@stackless.com> | 2023-12-07 08:02:41 +0000 |
| commit | fa45234cc20ad514e89e7124e2aee9a6347ea474 (patch) | |
| tree | ab7af5fe13ef19d44f507b2f169abc7ee065bd91 /sources/pyside6/libpyside/pyside.cpp | |
| parent | 2e06e148ff33b66ca64d4cc3acb2aa4f79f89d94 (diff) | |
PEP 697: Use the new type extension provision
By Python 3.12, there is now an official way to extend
heap types by custom extra data.
When we supported PyPy, the old type extension of PySide
did no longer work, and we introduced shadow dicts.
With the interface found in Python 3.12, we can use direct
extended data, again.
The supporting structures are not Limited API compatible.
We implemented a patch that enables this anyway, but it
is valid for this version only without a new review.
NOTE: The documentation lists `PyObject_GetTypeData` as
Limited API since Version 3.12, but in fact we had to
write a cheating patch.
[ChangeLog][PySide6] Hidden Type Extensions according to
PEP 697 are now used instead of shadow dictionaries.
Change-Id: I4b724ba7bcc72470b13f55ea5ebf94666061420d
Task-number: PYSIDE-2230
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/pyside.cpp')
| -rw-r--r-- | sources/pyside6/libpyside/pyside.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp index 891279473..074c289b8 100644 --- a/sources/pyside6/libpyside/pyside.cpp +++ b/sources/pyside6/libpyside/pyside.cpp @@ -446,6 +446,8 @@ void initDynamicMetaObject(PyTypeObject *type, const QMetaObject *base, std::siz TypeUserData *retrieveTypeUserData(PyTypeObject *pyTypeObj) { + if (!SbkObjectType_Check(pyTypeObj)) + return nullptr; return reinterpret_cast<TypeUserData *>(Shiboken::ObjectType::getTypeUserData(pyTypeObj)); } |
