diff options
author | Christian Tismer <tismer@stackless.com> | 2022-11-11 10:11:03 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2022-12-22 17:43:32 +0100 |
commit | b71aa9a77a09f60d1a64a0544bdfc9323debe0e9 (patch) | |
tree | 5cb30c50e455c07846e5e6e475ce70a34fe64aff /sources/shiboken6/libshiboken/basewrapper.cpp | |
parent | d0eb2ab803834defd23d97f7ee9bef1f09307e8b (diff) |
signature: Evict the __signature__ attribute, long live signature!
The __signature__ attribute was used since 2017 with success.
With Python 3.10, there was an incompatibility introduced by
the rlcompleter module. This was detected quite late, because
there is no exception thrown in normal line completion.
Using the rlcompleter module directly, the error can be seen.
The problem is not the attribute itself, but PySide's need to
support *multi-signature*. The signature objects are either
regular compatible Signature objects, or in the multi-case,
*lists* thereof.
Since PyPy was implemented, the internal use of the __signature__
attribute was replaced by a get_signature() call. The attribute
was never documented in the public until recently in the
developer docs. We therefor can assume that removal of the
attribute will cause no problems.
[ChangeLog][PySide6] The non-standard __signature__ attribute of
functions and classes was removed in favor of get_signature().
No Pick-to because this is meant for 6.5
Change-Id: Iaa8bb08a33db66868d949593e527b753bf989681
Fixes: PYSIDE-2101
Task-number: PYSIDE-510
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken6/libshiboken/basewrapper.cpp')
-rw-r--r-- | sources/shiboken6/libshiboken/basewrapper.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sources/shiboken6/libshiboken/basewrapper.cpp b/sources/shiboken6/libshiboken/basewrapper.cpp index 24980239d..d81160eea 100644 --- a/sources/shiboken6/libshiboken/basewrapper.cpp +++ b/sources/shiboken6/libshiboken/basewrapper.cpp @@ -113,11 +113,8 @@ type_set_doc(PyTypeObject *type, PyObject *value, void * /* context */) } // PYSIDE-908: The function PyType_Modified does not work in PySide, so we need to -// explicitly pass __doc__. For __signature__ it _did_ actually work, because -// it was not existing before. We add them both for clarity. +// explicitly pass __doc__. static PyGetSetDef SbkObjectType_tp_getset[] = { - {const_cast<char *>("__signature__"), reinterpret_cast<getter>(Sbk_TypeGet___signature__), - nullptr, nullptr, nullptr}, {const_cast<char *>("__doc__"), reinterpret_cast<getter>(Sbk_TypeGet___doc__), reinterpret_cast<setter>(type_set_doc), nullptr, nullptr}, {const_cast<char *>("__dict__"), reinterpret_cast<getter>(Sbk_TypeGet___dict__), |