mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-07 10:20:58 +08:00
stdlib: add argument default values (#9501)
This commit is contained in:
105
stdlib/pydoc.pyi
105
stdlib/pydoc.pyi
@@ -26,7 +26,7 @@ def replace(text: AnyStr, *pairs: AnyStr) -> AnyStr: ...
|
||||
def cram(text: str, maxlen: int) -> str: ...
|
||||
def stripid(text: str) -> str: ...
|
||||
def allmethods(cl: type) -> MutableMapping[str, MethodType]: ...
|
||||
def visiblename(name: str, all: Container[str] | None = ..., obj: object = ...) -> bool: ...
|
||||
def visiblename(name: str, all: Container[str] | None = None, obj: object = None) -> bool: ...
|
||||
def classify_class_attrs(object: object) -> list[tuple[str, str, type, str]]: ...
|
||||
def ispackage(path: str) -> bool: ...
|
||||
def source_synopsis(file: IO[AnyStr]) -> AnyStr | None: ...
|
||||
@@ -44,21 +44,21 @@ def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, Modu
|
||||
|
||||
class Doc:
|
||||
PYTHONDOCS: str
|
||||
def document(self, object: object, name: str | None = ..., *args: Any) -> str: ...
|
||||
def fail(self, object: object, name: str | None = ..., *args: Any) -> NoReturn: ...
|
||||
def document(self, object: object, name: str | None = None, *args: Any) -> str: ...
|
||||
def fail(self, object: object, name: str | None = None, *args: Any) -> NoReturn: ...
|
||||
@abstractmethod
|
||||
def docmodule(self, object: object, name: str | None = ..., *args: Any) -> str: ...
|
||||
def docmodule(self, object: object, name: str | None = None, *args: Any) -> str: ...
|
||||
@abstractmethod
|
||||
def docclass(self, object: object, name: str | None = ..., *args: Any) -> str: ...
|
||||
def docclass(self, object: object, name: str | None = None, *args: Any) -> str: ...
|
||||
@abstractmethod
|
||||
def docroutine(self, object: object, name: str | None = ..., *args: Any) -> str: ...
|
||||
def docroutine(self, object: object, name: str | None = None, *args: Any) -> str: ...
|
||||
@abstractmethod
|
||||
def docother(self, object: object, name: str | None = ..., *args: Any) -> str: ...
|
||||
def docother(self, object: object, name: str | None = None, *args: Any) -> str: ...
|
||||
@abstractmethod
|
||||
def docproperty(self, object: object, name: str | None = ..., *args: Any) -> str: ...
|
||||
def docproperty(self, object: object, name: str | None = None, *args: Any) -> str: ...
|
||||
@abstractmethod
|
||||
def docdata(self, object: object, name: str | None = ..., *args: Any) -> str: ...
|
||||
def getdocloc(self, object: object, basedir: str = ...) -> str | None: ...
|
||||
def docdata(self, object: object, name: str | None = None, *args: Any) -> str: ...
|
||||
def getdocloc(self, object: object, basedir: str = "/Users/jelle/.pyenv/versions/3.11.1/lib/python3.11") -> str | None: ...
|
||||
|
||||
class HTMLRepr(Repr):
|
||||
def escape(self, text: str) -> str: ...
|
||||
@@ -75,16 +75,16 @@ class HTMLDoc(Doc):
|
||||
escape = _repr_instance.escape
|
||||
def page(self, title: str, contents: str) -> str: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def heading(self, title: str, extras: str = ...) -> str: ...
|
||||
def heading(self, title: str, extras: str = "") -> str: ...
|
||||
def section(
|
||||
self,
|
||||
title: str,
|
||||
cls: str,
|
||||
contents: str,
|
||||
width: int = ...,
|
||||
prelude: str = ...,
|
||||
marginalia: str | None = ...,
|
||||
gap: str = ...,
|
||||
width: int = 6,
|
||||
prelude: str = "",
|
||||
marginalia: str | None = None,
|
||||
gap: str = " ",
|
||||
) -> str: ...
|
||||
def multicolumn(self, list: list[_T], format: Callable[[_T], str]) -> str: ...
|
||||
else:
|
||||
@@ -112,20 +112,20 @@ class HTMLDoc(Doc):
|
||||
def markup(
|
||||
self,
|
||||
text: str,
|
||||
escape: Callable[[str], str] | None = ...,
|
||||
escape: Callable[[str], str] | None = None,
|
||||
funcs: Mapping[str, str] = ...,
|
||||
classes: Mapping[str, str] = ...,
|
||||
methods: Mapping[str, str] = ...,
|
||||
) -> str: ...
|
||||
def formattree(
|
||||
self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ...
|
||||
self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = None
|
||||
) -> str: ...
|
||||
def docmodule(self, object: object, name: str | None = ..., mod: str | None = ..., *ignored: Any) -> str: ...
|
||||
def docmodule(self, object: object, name: str | None = None, mod: str | None = None, *ignored: Any) -> str: ...
|
||||
def docclass(
|
||||
self,
|
||||
object: object,
|
||||
name: str | None = ...,
|
||||
mod: str | None = ...,
|
||||
name: str | None = None,
|
||||
mod: str | None = None,
|
||||
funcs: Mapping[str, str] = ...,
|
||||
classes: Mapping[str, str] = ...,
|
||||
*ignored: Any,
|
||||
@@ -134,17 +134,17 @@ class HTMLDoc(Doc):
|
||||
def docroutine( # type: ignore[override]
|
||||
self,
|
||||
object: object,
|
||||
name: str | None = ...,
|
||||
mod: str | None = ...,
|
||||
name: str | None = None,
|
||||
mod: str | None = None,
|
||||
funcs: Mapping[str, str] = ...,
|
||||
classes: Mapping[str, str] = ...,
|
||||
methods: Mapping[str, str] = ...,
|
||||
cl: type | None = ...,
|
||||
cl: type | None = None,
|
||||
) -> str: ...
|
||||
def docproperty(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override]
|
||||
def docother(self, object: object, name: str | None = ..., mod: Any | None = ..., *ignored: Any) -> str: ...
|
||||
def docdata(self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override]
|
||||
def index(self, dir: str, shadowed: MutableMapping[str, bool] | None = ...) -> str: ...
|
||||
def docproperty(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
|
||||
def docother(self, object: object, name: str | None = None, mod: Any | None = None, *ignored: Any) -> str: ...
|
||||
def docdata(self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
|
||||
def index(self, dir: str, shadowed: MutableMapping[str, bool] | None = None) -> str: ...
|
||||
def filelink(self, url: str, path: str) -> str: ...
|
||||
|
||||
class TextRepr(Repr):
|
||||
@@ -157,25 +157,25 @@ class TextDoc(Doc):
|
||||
_repr_instance: TextRepr = ...
|
||||
repr = _repr_instance.repr
|
||||
def bold(self, text: str) -> str: ...
|
||||
def indent(self, text: str, prefix: str = ...) -> str: ...
|
||||
def indent(self, text: str, prefix: str = " ") -> str: ...
|
||||
def section(self, title: str, contents: str) -> str: ...
|
||||
def formattree(
|
||||
self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ..., prefix: str = ...
|
||||
self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = None, prefix: str = ""
|
||||
) -> str: ...
|
||||
def docmodule(self, object: object, name: str | None = ..., mod: Any | None = ...) -> str: ... # type: ignore[override]
|
||||
def docclass(self, object: object, name: str | None = ..., mod: str | None = ..., *ignored: Any) -> str: ...
|
||||
def docmodule(self, object: object, name: str | None = None, mod: Any | None = None) -> str: ... # type: ignore[override]
|
||||
def docclass(self, object: object, name: str | None = None, mod: str | None = None, *ignored: Any) -> str: ...
|
||||
def formatvalue(self, object: object) -> str: ...
|
||||
def docroutine(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override]
|
||||
def docproperty(self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override]
|
||||
def docdata(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override]
|
||||
def docroutine(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
|
||||
def docproperty(self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
|
||||
def docdata(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override]
|
||||
def docother( # type: ignore[override]
|
||||
self,
|
||||
object: object,
|
||||
name: str | None = ...,
|
||||
mod: str | None = ...,
|
||||
parent: str | None = ...,
|
||||
maxlen: int | None = ...,
|
||||
doc: Any | None = ...,
|
||||
name: str | None = None,
|
||||
mod: str | None = None,
|
||||
parent: str | None = None,
|
||||
maxlen: int | None = None,
|
||||
doc: Any | None = None,
|
||||
) -> str: ...
|
||||
|
||||
def pager(text: str) -> None: ...
|
||||
@@ -192,16 +192,23 @@ text: TextDoc
|
||||
html: HTMLDoc
|
||||
|
||||
def resolve(thing: str | object, forceload: bool = ...) -> tuple[object, str] | None: ...
|
||||
def render_doc(thing: str | object, title: str = ..., forceload: bool = ..., renderer: Doc | None = ...) -> str: ...
|
||||
def doc(thing: str | object, title: str = ..., forceload: bool = ..., output: SupportsWrite[str] | None = ...) -> None: ...
|
||||
def render_doc(
|
||||
thing: str | object, title: str = "Python Library Documentation: %s", forceload: bool = ..., renderer: Doc | None = None
|
||||
) -> str: ...
|
||||
def doc(
|
||||
thing: str | object,
|
||||
title: str = "Python Library Documentation: %s",
|
||||
forceload: bool = ...,
|
||||
output: SupportsWrite[str] | None = None,
|
||||
) -> None: ...
|
||||
def writedoc(thing: str | object, forceload: bool = ...) -> None: ...
|
||||
def writedocs(dir: str, pkgpath: str = ..., done: Any | None = ...) -> None: ...
|
||||
def writedocs(dir: str, pkgpath: str = "", done: Any | None = None) -> None: ...
|
||||
|
||||
class Helper:
|
||||
keywords: dict[str, str | tuple[str, str]]
|
||||
symbols: dict[str, str]
|
||||
topics: dict[str, str | tuple[str, ...]]
|
||||
def __init__(self, input: IO[str] | None = ..., output: IO[str] | None = ...) -> None: ...
|
||||
def __init__(self, input: IO[str] | None = None, output: IO[str] | None = None) -> None: ...
|
||||
@property
|
||||
def input(self) -> IO[str]: ...
|
||||
@property
|
||||
@@ -211,13 +218,13 @@ class Helper:
|
||||
def getline(self, prompt: str) -> str: ...
|
||||
def help(self, request: Any) -> None: ...
|
||||
def intro(self) -> None: ...
|
||||
def list(self, items: _list[str], columns: int = ..., width: int = ...) -> None: ...
|
||||
def list(self, items: _list[str], columns: int = 4, width: int = 80) -> None: ...
|
||||
def listkeywords(self) -> None: ...
|
||||
def listsymbols(self) -> None: ...
|
||||
def listtopics(self) -> None: ...
|
||||
def showtopic(self, topic: str, more_xrefs: str = ...) -> None: ...
|
||||
def showtopic(self, topic: str, more_xrefs: str = "") -> None: ...
|
||||
def showsymbol(self, symbol: str) -> None: ...
|
||||
def listmodules(self, key: str = ...) -> None: ...
|
||||
def listmodules(self, key: str = "") -> None: ...
|
||||
|
||||
help: Helper
|
||||
|
||||
@@ -226,9 +233,9 @@ class ModuleScanner:
|
||||
def run(
|
||||
self,
|
||||
callback: Callable[[str | None, str, str], object],
|
||||
key: str | None = ...,
|
||||
completer: Callable[[], object] | None = ...,
|
||||
onerror: Callable[[str], object] | None = ...,
|
||||
key: str | None = None,
|
||||
completer: Callable[[], object] | None = None,
|
||||
onerror: Callable[[str], object] | None = None,
|
||||
) -> None: ...
|
||||
|
||||
def apropos(key: str) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user