Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1402

QtCore.Property is out of date

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Won't Do
    • Affects Version/s: 5.15
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None

      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

        For Gerrit Dashboard: PYSIDE-1402
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            ctismer Christian Tismer
            Reporter:
            ctismer Christian Tismer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes