From: Serhiy Storchaka Date: Mon, 23 Jan 2017 12:02:35 +0000 (+0200) Subject: Issue #29338: Don't output an empty signature for class constructor. X-Git-Tag: v3.7.0a1~1479 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=213f229fbd00587112a8ca865f0e5ebebf3c8eba;p=python Issue #29338: Don't output an empty signature for class constructor. --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index f0c7cfce2e..49555405c5 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -917,7 +917,7 @@ class HTMLDoc(Doc): signature = None if signature: argspec = str(signature) - if argspec: + if argspec and argspec != '()': decl = name + self.escape(argspec) + '\n\n' doc = getdoc(object) @@ -1236,7 +1236,7 @@ location listed above. signature = None if signature: argspec = str(signature) - if argspec: + if argspec and argspec != '()': push(name + argspec + '\n') doc = getdoc(object)