diff options
author | Christian Tismer <tismer@stackless.com> | 2018-07-19 21:00:30 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2018-07-23 16:32:01 +0000 |
commit | e24392c76e5cfdd2d6d51bd853b106db2bc4cb80 (patch) | |
tree | 985048135d3a6a81da2f5a72b667ff59ed4d0b44 /sources/pyside2/PySide2/QtQml | |
parent | 5d21980ba4bd605ccbf4278e75177ae2c144bdd8 (diff) |
Pep 384 Final Cut: Remove PepType
While trying to document the Limited API Project,
it suddenly struck me:
We can make the patch much much simpler and implement it
without the necessity to have an extra PepType!
Now I am happy to continue the documentation, because
it is now no more improvable.
This version will last as long as the layout of
PyTypeObject does not change substantially. When that
happens, then we need to rewrite stuff with the according
PyType_GetSlot() access functions.
These access functions will until then be complete enough
so that we can live without the tricks like inventing a reduced
PyTypeObject as was done in the current implementation.
Task-number: PYSIDE-560
Change-Id: I49849cc377baa6794a5b53292691e21d6e2853ab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/QtQml')
-rw-r--r-- | sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp index fa9eb6349..0b427c251 100644 --- a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp +++ b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp @@ -120,9 +120,9 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor, } PyTypeObject *pyObjType = reinterpret_cast<PyTypeObject *>(pyObj); - if (!PySequence_Contains(PepType(pyObjType)->tp_mro, reinterpret_cast<PyObject *>(qobjectType))) { + if (!PySequence_Contains(pyObjType->tp_mro, reinterpret_cast<PyObject *>(qobjectType))) { PyErr_Format(PyExc_TypeError, "A type inherited from %s expected, got %s.", - PepType(qobjectType)->tp_name, PepType(pyObjType)->tp_name); + qobjectType->tp_name, pyObjType->tp_name); return -1; } @@ -229,7 +229,7 @@ void propListTpFree(void* self) PySideProperty* pySelf = reinterpret_cast<PySideProperty*>(self); delete reinterpret_cast<QmlListProperty*>(PySide::Property::userData(pySelf)); // calls base type constructor - PepType(PepType(Py_TYPE(pySelf))->tp_base)->tp_free(self); + Py_TYPE(pySelf)->tp_base->tp_free(self); } static PyType_Slot PropertyListType_slots[] = { @@ -364,7 +364,7 @@ QtQml_VolatileBoolObject_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return Q_NULLPTR; QtQml_VolatileBoolObject *self - = reinterpret_cast<QtQml_VolatileBoolObject *>(PepType(type)->tp_alloc(type, 0)); + = reinterpret_cast<QtQml_VolatileBoolObject *>(type->tp_alloc(type, 0)); if (self != Q_NULLPTR) self->flag = ok; @@ -421,10 +421,10 @@ QtQml_VolatileBoolObject_repr(QtQml_VolatileBoolObject *self) if (self->flag) s = PyBytes_FromFormat("%s(True)", - PepType((Py_TYPE(self)))->tp_name); + Py_TYPE(self)->tp_name); else s = PyBytes_FromFormat("%s(False)", - PepType((Py_TYPE(self)))->tp_name); + Py_TYPE(self)->tp_name); Py_XINCREF(s); return s; } @@ -436,10 +436,10 @@ QtQml_VolatileBoolObject_str(QtQml_VolatileBoolObject *self) if (self->flag) s = PyBytes_FromFormat("%s(True) -> %p", - PepType((Py_TYPE(self)))->tp_name, &(self->flag)); + Py_TYPE(self)->tp_name, &(self->flag)); else s = PyBytes_FromFormat("%s(False) -> %p", - PepType((Py_TYPE(self)))->tp_name, &(self->flag)); + Py_TYPE(self)->tp_name, &(self->flag)); Py_XINCREF(s); return s; } |