Skip to content

Commit eb70a87

Browse files
Issue #29338: Don't output an empty signature for class constructor.
1 parent 82fddbb commit eb70a87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/pydoc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ def spilldata(msg, attrs, predicate):
917917
signature = None
918918
if signature:
919919
argspec = str(signature)
920-
if argspec:
920+
if argspec and argspec != '()':
921921
decl = name + self.escape(argspec) + '\n\n'
922922

923923
doc = getdoc(object)
@@ -1236,7 +1236,7 @@ def makename(c, m=object.__module__):
12361236
signature = None
12371237
if signature:
12381238
argspec = str(signature)
1239-
if argspec:
1239+
if argspec and argspec != '()':
12401240
push(name + argspec + '\n')
12411241

12421242
doc = getdoc(object)

0 commit comments

Comments
 (0)