classification
Title: duplicated signature of dataclass in help()
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: sir-sigurd
Priority: normal Keywords: patch

Created on 2020-07-28 04:39 by sir-sigurd, last changed 2020-07-28 04:41 by sir-sigurd.

Pull Requests
URL Status Linked Edit
PR 21652 open sir-sigurd, 2020-07-28 04:41
Messages (1)
msg374461 - (view) Author: Sergey Fedoseev (sir-sigurd) * Date: 2020-07-28 04:39
In [191]: import dataclasses, pydoc

In [192]: @dataclass
     ...: class C:
     ...:     pass
     ...:

In [193]: print(pydoc.render_doc(C))
Python Library Documentation: class C in module __main__

class C(builtins.object)
 |  C() -> None
 |
 |  C()
 |
 |  Methods defined here:
 |
 ....


It's duplicated because dataclass __doc__ defaults to signature:
 
In [195]: C.__doc__                                  
Out[195]: 'C()'
History
Date User Action Args
2020-07-28 04:41:25sir-sigurdsetkeywords: + patch
stage: patch review
pull_requests: + pull_request20793
2020-07-28 04:39:59sir-sigurdcreate