Skip to content

Commit f3a0be3

Browse files
authored
Add is_cli param to pydoc.pyi (#10331)
1 parent 6652add commit f3a0be3

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

stdlib/pydoc.pyi

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,24 @@ def resolve(thing: str | object, forceload: bool = ...) -> tuple[object, str] |
195195
def render_doc(
196196
thing: str | object, title: str = "Python Library Documentation: %s", forceload: bool = ..., renderer: Doc | None = None
197197
) -> str: ...
198-
def doc(
199-
thing: str | object,
200-
title: str = "Python Library Documentation: %s",
201-
forceload: bool = ...,
202-
output: SupportsWrite[str] | None = None,
203-
) -> None: ...
198+
199+
if sys.version_info >= (3, 12):
200+
def doc(
201+
thing: str | object,
202+
title: str = "Python Library Documentation: %s",
203+
forceload: bool = ...,
204+
output: SupportsWrite[str] | None = None,
205+
is_cli: bool = False,
206+
) -> None: ...
207+
208+
else:
209+
def doc(
210+
thing: str | object,
211+
title: str = "Python Library Documentation: %s",
212+
forceload: bool = ...,
213+
output: SupportsWrite[str] | None = None,
214+
) -> None: ...
215+
204216
def writedoc(thing: str | object, forceload: bool = ...) -> None: ...
205217
def writedocs(dir: str, pkgpath: str = "", done: Any | None = None) -> None: ...
206218

@@ -216,7 +228,11 @@ class Helper:
216228
def __call__(self, request: str | Helper | object = ...) -> None: ...
217229
def interact(self) -> None: ...
218230
def getline(self, prompt: str) -> str: ...
219-
def help(self, request: Any) -> None: ...
231+
if sys.version_info >= (3, 12):
232+
def help(self, request: Any, is_cli: bool = False) -> None: ...
233+
else:
234+
def help(self, request: Any) -> None: ...
235+
220236
def intro(self) -> None: ...
221237
def list(self, items: _list[str], columns: int = 4, width: int = 80) -> None: ...
222238
def listkeywords(self) -> None: ...

0 commit comments

Comments
 (0)