Skip to content

Commit ea6e06a

Browse files
authored
Use bound methods in pydoc (#7426)
1 parent 9796b9e commit ea6e06a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

stdlib/pydoc.pyi

+5-3
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ class HTMLRepr(Repr):
7575
def repr_unicode(self, x: AnyStr, level: complex) -> str: ...
7676

7777
class HTMLDoc(Doc):
78-
repr: Callable[[object], str]
79-
escape: Callable[[str], str]
78+
_repr_instance: HTMLRepr = ...
79+
repr = _repr_instance.repr
80+
escape = _repr_instance.escape
8081
def page(self, title: str, contents: str) -> str: ...
8182
def heading(self, title: str, fgcol: str, bgcol: str, extras: str = ...) -> str: ...
8283
def section(
@@ -149,7 +150,8 @@ class TextRepr(Repr):
149150
def repr_instance(self, x: object, level: complex) -> str: ...
150151

151152
class TextDoc(Doc):
152-
repr: Callable[[object], str]
153+
_repr_instance: TextRepr = ...
154+
repr = _repr_instance.repr
153155
def bold(self, text: str) -> str: ...
154156
def indent(self, text: str, prefix: str = ...) -> str: ...
155157
def section(self, title: str, contents: str) -> str: ...

0 commit comments

Comments
 (0)