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

(Regression) QColorConstants.Svg type hints are invalid

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.8.1, 6.8.0.2
    • 6.8.0, 6.8.0.1
    • Type hints
    • None
    • d99a314f7 (dev), a529e7327 (6.8), 6bc526d4f (6.8.0), b030c8500 (tqtc/6.8.0)

    Description

      PYSIDE-2742 seems to have been reintroduced with 6.8.0. Trying to assign one of the QColorConstants to a variable hinted as a QColor results in the mypy error:

      error: Incompatible types in assignment (expression has type "EllipsisType", variable has type "QColor") [assignment]

      MRE:

      from PySide6 import QtGui
      
      var: QtGui.QColor
      var = QtGui.QColorConstants.Red
      

      This did not happen in the previous version (6.7.3). It was not fixed in 6.8.0.1.

      Recreating the issue as I don't have the permissions required to reopen the old one.

      I'm running mypy-1.12.1 on Python 3.12.3.

      Attachments

        Issue Links

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

          Activity

            People

              ctismer Christian Tismer
              andreimiculita andreimiculita
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes