XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • all
    • Type hints
    • None
    • All

    Description

      pyside has so many typing issues i.e Property 

      from PySide6.QtCore import QObject, Property
      
      class B(QObject):
          ...
      
      class A(QObject):
      
          @Property(QObject, constant=True)
          def foo(self) -> B:        ...
      
      reveal_type(A().foo) 

       

      mypypoc.py:9: error: "Property" not callable  [operator]
      mypypoc.py:10: error: Missing return statement  [empty-body]
      mypypoc.py:14: note: Revealed type is "Any" 

      also `Slot` should just return the function decorated

      from PySide6.QtCore import QObject, Slot
      class B(QObject):    ...
      class A(QObject):
      
          @Slot(int)    def foo(self) -> int:        ...
      
      reveal_type(A().foo) 
      mypypoc.py:10: error: Missing return statement  [empty-body]
      mypypoc.py:14: note: Revealed type is "Any" 

       

       

      Attachments

        Issue Links

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

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              nir nir benlulu
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes