Details
Description
QtCore.Property was developed around 2012 and never really updated.
Python's property implementation changed 2013 like this:
class TestClass: def __init__(self): self._data = None @property def thing(self): return self._data @thing.setter def thing(self, value): # Would not work with another name self._data = value
The property implementation was changed so that every changing action on a property
now creates a full copy of the property object. This has the side effect that properties with
different setter names no longer work, because the property object would be missed.
PyQt5 already has an almost correct implementation of QtCore.pyqtProperty, just __doc__ is not writable.
With the supplied patch, PySide2's property implementation is completely correct, but has one inherent problem left:
QtCore.Property does work with QObject derived classes, only, while PyQt5
does not need that. This is a curiosity of our property implementation which does not use the usual tp_descr_get/tp_descr_set slots and therefore needs further investigation.
Attachments
Issue Links
- relates to
-
PYSIDE-2453 garbage collection fails when using QtCore.Property
- Reported