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

PySide6.QtCore.QTranslator.translate Type Hint

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 6.5.6, 6.7.2, 6.8.0
    • 6.7.0
    • Type hints
    • None
    • Windows
    • 217696754 (dev), 6d4f624e0 (6.7), e3a36b8ee (tqtc/lts-6.5)

    Description

      PySide6.QtCore.QTranslator.translate type hint is incorrect.

      I believe this method only accepts strings but it is typed as Union[bytes, bytearray, memoryview]

      Current signature

      PySide6.QtCore.QTranslator.translate(Union[bytes, bytearray, memoryview], Union[bytes, bytearray, memoryview], Union[bytes, bytearray, memoryview, NoneType] = None, int = -1) 

      What I believe is the correct signature

      PySide6.QtCore.QTranslator.translate(str, str, Optional[str] = None, int = -1) 

      Either that or this function should not error when given bytes, bytearray or memoryview.

       

       

      Attachments

        For Gerrit Dashboard: PYSIDE-2748
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            gentlegiantjgc J C
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes