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

Type hints: Slot() annotations fails in different cases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.8.1
    • Type hints
    • None

      The following code does not type-check:

      from PySide6.QtCore import QObject, Slot
      
      class MyClass(QObject):
          @Slot(int)
          def print_number(self, number: int) -> None: ...
      

      Another example:

      from PySide6.QtCore import QObject, Slot
      
      class MyClass(QObject):
          @staticmethod
          @Slot()
          def print_number() -> None: ...
      

      sources/pyside6/libpyside/pysideslot.cpp:170, solution proposal at duplicate PYSIDE-2977 .

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

            cinucen Ece Cinucen
            bers bers bers
            Votes:
            6 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes