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

Type hint: Subclassing QTranslator::translate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4: Low P4: Low
    • None
    • 6.9.2
    • Type hints
    • None
    • All

      When subclassing QTranslate in pyside6 and reimplementing the translate method it seems to be possible to return None which pyside6 casts to a null QString.

      This behaviour is missing from the type hints.

      Current (incorrect) type hint

      def translate(self, context: str, sourceText: str, /, disambiguation: str | None = ..., n: int = ...) -> str: ... 

      Correct type hint

      def translate(self, context: str, sourceText: str, /, disambiguation: str | None = ..., n: int = ...) -> str | None: ... 

      This is a companion issue to PYSIDE-3192

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

            cinucen Ece Cinucen
            gentlegiantjgc J C
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes