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

False-positive in mypy: "has no attribute" with signals

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.3.2
    • PySide
    • None
    • Windows

      This code gives a mypy error:

      """Bug"""
      from PySide6.QtCore import QFileSystemWatcher
      
      w = QFileSystemWatcher()
      w.fileChanged.connect(None)
      print("Done.")
      

      bug.py:5: error: "QFileSystemWatcher" has no attribute "fileChanged"
      Found 1 error in 1 file (checked 1 source file)

      See also https://github.com/python/mypy/issues/13833

       
      I have found https://bugreports.qt.io/browse/PYSIDE-1318 and https://github.com/qtproject/pyside-pyside-setup/commit/f57efb8c0ff616e345807b2671705363dd0d6b39 but they seem unrelated to this issue - that bug reports missing properties for signals. In this issue, mypy reports missing signals.

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

            crmaurei Cristian Maureira-Fredes
            bers bers bers
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes