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

Type hints: Slot() annotations fails in different cases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.8.1
    • Type hints
    • None

    Description

      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 .

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes