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

isinstance(QPointer<T> instance, T) should return True from Python

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • None
    • PySide, Shiboken
    • None

    Description

      Let's consider the two following functions:

      QPointer<ABstractType> function_a();  // returns a QPointer<ConcreteType>
      ABstractType* function_b();                   // returns a ConcreteType*
      

      From Python, both will return something that behave the same except for isinstance(object, ConcreteType), with QPointer it will return False.

      Digging a bit shows that QPointer wrapped type mro is:

      ABstractTypePtr.mro() -> [module.ABstractTypePtr, Shiboken.Object, object]
      

      While the ConcreteType* has something like:

      ConcreteType.mro() -> [module.ConcreteType, module.ABstractType, Shiboken.Object, object]
      

      Shouldn't ABstractTypePtr behave exactly like without QPointer?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            ajeandet Alexis Jeandet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes