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

Docstrings not preserved in subclasses of QObject

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.2.0, 6.3.0, 6.4.0
    • PySide
    • None

    Description

      (Apologies if there's another open issue on this, if so I wasn't able to find it)

      It appears that, in all versions of PySide6 (but not in PySide2) user docstrings are not preserved in subclasses of QObject.

      In [1]: from PySide6.QtCore import QObject
         ...:
         ...: class A:
         ...:     """I'm a docstring"""
         ...:
         ...: class B(QObject):
         ...:     """I'm another docstring"""
         ...:
      
      In [2]: A.__doc__
      Out[2]: "I'm a docstring"
      
      In [3]: B.__doc__  # empty
      

      This is problematic, both for interactive help, as well as autogenerated documentation pages.

      Thanks!

      Python 3.10
      Qt 6.4.2 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 11.3.0)
      A.__doc__= I'm a docstring
      B.__doc__= None
      
      Python 3.10
      Qt 5.15.11 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 11.2.0)
      A.__doc__= I'm a docstring
      B.__doc__= I'm another docstring
      

      Attachments

        1. pyside2131.py
          0.5 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes