[New-bugs-announce] [issue41415] duplicated signature of dataclass in help()

Sergey Fedoseev report at bugs.python.org
Tue Jul 28 00:39:59 EDT 2020


New submission from Sergey Fedoseev <fedoseev.sergey at gmail.com>:

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()'

----------
components: Library (Lib)
messages: 374461
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: duplicated signature of dataclass in help()
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41415>
_______________________________________


More information about the New-bugs-announce mailing list