massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2 / pydoc.pyi
1 from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, NoReturn, Optional, Tuple, Type, Union\r
2 from repr import Repr\r
3 \r
4 from types import FunctionType, MethodType, ModuleType, TracebackType\r
5 # the return type of sys.exc_info(), used by ErrorDuringImport.__init__\r
6 _Exc_Info = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]\r
7 \r
8 __author__ = ...  # type: str\r
9 __date__ = ...  # type: str\r
10 __version__ = ...  # type: str\r
11 __credits__ = ...  # type: str\r
12 \r
13 def pathdirs() -> List[str]: ...\r
14 def getdoc(object: object) -> Union[str, unicode]: ...\r
15 def splitdoc(doc: AnyStr) -> Tuple[AnyStr, AnyStr]: ...\r
16 def classname(object: object, modname: str) -> str: ...\r
17 def isdata(object: object) -> bool: ...\r
18 def replace(text: AnyStr, *pairs: AnyStr) -> AnyStr: ...\r
19 def cram(text: str, maxlen: int) -> str: ...\r
20 def stripid(text: str) -> str: ...\r
21 def allmethods(cl: type) -> MutableMapping[str, MethodType]: ...\r
22 def visiblename(name: str, all: Optional[Container[str]] = ..., obj: Optional[object] = ...) -> bool: ...\r
23 def classify_class_attrs(object: object) -> List[Tuple[str, str, type, str]]: ...\r
24 \r
25 def ispackage(path: str) -> bool: ...\r
26 def source_synopsis(file: IO[AnyStr]) -> Optional[AnyStr]: ...\r
27 def synopsis(filename: str, cache: MutableMapping[str, Tuple[int, str]] = ...) -> Optional[str]: ...\r
28 \r
29 class ErrorDuringImport(Exception):\r
30     filename = ...  # type: str\r
31     exc = ...  # type: Optional[Type[BaseException]]\r
32     value = ...  # type: Optional[BaseException]\r
33     tb = ...  # type: Optional[TracebackType]\r
34     def __init__(self, filename: str, exc_info: _Exc_Info) -> None: ...\r
35 \r
36 def importfile(path: str) -> ModuleType: ...\r
37 def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, ModuleType] = ...) -> ModuleType: ...\r
38 \r
39 class Doc:\r
40     def document(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ...\r
41     def fail(self, object: object, name: Optional[str] = ..., *args: Any) -> NoReturn: ...\r
42     def docmodule(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ...\r
43     def docclass(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ...\r
44     def docroutine(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ...\r
45     def docother(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ...\r
46     def docproperty(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ...\r
47     def docdata(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ...\r
48     def getdocloc(self, object: object) -> Optional[str]: ...\r
49 \r
50 class HTMLRepr(Repr):\r
51     maxlist = ...  # type: int\r
52     maxtuple = ...  # type: int\r
53     maxdict = ...  # type: int\r
54     maxstring = ...  # type: int\r
55     maxother = ...  # type: int\r
56     def __init__(self) -> None: ...\r
57     def escape(self, text: str) -> str: ...\r
58     def repr(self, object: object) -> str: ...\r
59     def repr1(self, x: object, level: complex) -> str: ...\r
60     def repr_string(self, x: Union[str, unicode], level: complex) -> str: ...\r
61     def repr_str(self, x: Union[str, unicode], level: complex) -> str: ...\r
62     def repr_instance(self, x: object, level: complex) -> str: ...\r
63     def repr_unicode(self, x: AnyStr, level: complex) -> str: ...\r
64 \r
65 class HTMLDoc(Doc):\r
66     def repr(self, object: object) -> str: ...\r
67     def escape(self, test: str) -> str: ...\r
68     def page(self, title: str, contents: str) -> str: ...\r
69     def heading(self, title: str, fgcol: str, bgcol: str, extras: str = ...) -> str: ...\r
70     def section(self, title: str, fgcol: str, bgcol: str, contents: str, width: int = ..., prelude: str = ..., marginalia: Optional[str] = ..., gap: str = ...) -> str: ...\r
71     def bigsection(self, title: str, *args) -> str: ...\r
72     def preformat(self, text: str) -> str: ...\r
73     def multicolumn(self, list: List[Any], format: Callable[[Any], str], cols: int = ...) -> str: ...\r
74     def grey(self, text: str) -> str: ...\r
75     def namelink(self, name: str, *dicts: MutableMapping[str, str]) -> str: ...\r
76     def classlink(self, object: object, modname: str) -> str: ...\r
77     def modulelink(self, object: object) -> str: ...\r
78     def modpkglink(self, data: Tuple[str, str, bool, bool]) -> str: ...\r
79     def markup(self, text: str, escape: Optional[Callable[[str], str]] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ...) -> str: ...\r
80     def formattree(self, tree: List[Union[Tuple[type, Tuple[type, ...]], list]], modname: str, parent: Optional[type] = ...) -> str: ...\r
81     def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored) -> str: ...\r
82     def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., *ignored) -> str: ...\r
83     def formatvalue(self, object: object) -> str: ...\r
84     def docroutine(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., cl: Optional[type] = ..., *ignored) -> str: ...\r
85     def docproperty(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ...\r
86     def docother(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored) -> str: ...\r
87     def docdata(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored) -> str: ...\r
88     def index(self, dir: str, shadowed: Optional[MutableMapping[str, bool]] = ...) -> str: ...\r
89 \r
90 class TextRepr(Repr):\r
91     maxlist = ...  # type: int\r
92     maxtuple = ...  # type: int\r
93     maxdict = ...  # type: int\r
94     maxstring = ...  # type: int\r
95     maxother = ...  # type: int\r
96     def __init__(self) -> None: ...\r
97     def repr1(self, x: object, level: complex) -> str: ...\r
98     def repr_string(self, x: str, level: complex) -> str: ...\r
99     def repr_str(self, x: str, level: complex) -> str: ...\r
100     def repr_instance(self, x: object, level: complex) -> str: ...\r
101 \r
102 class TextDoc(Doc):\r
103     def repr(self, object: object) -> str: ...\r
104     def bold(self, text: str) -> str: ...\r
105     def indent(self, text: str, prefix: str = ...) -> str: ...\r
106     def section(self, title: str, contents: str) -> str: ...\r
107     def formattree(self, tree: List[Union[Tuple[type, Tuple[type, ...]], list]], modname: str, parent: Optional[type] = ..., prefix: str = ...) -> str: ...\r
108     def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored) -> str: ...\r
109     def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored) -> str: ...\r
110     def formatvalue(self, object: object) -> str: ...\r
111     def docroutine(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ...\r
112     def docproperty(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored) -> str: ...\r
113     def docdata(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ...\r
114     def docother(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., parent: Optional[str] = ..., maxlen: Optional[int] = ..., doc: Optional[Any] = ..., *ignored) -> str: ...\r
115 \r
116 def pager(text: str) -> None: ...\r
117 def getpager() -> Callable[[str], None]: ...\r
118 def plain(text: str) -> str: ...\r
119 def pipepager(text: str, cmd: str) -> None: ...\r
120 def tempfilepager(text: str, cmd: str) -> None: ...\r
121 def ttypager(text: str) -> None: ...\r
122 def plainpager(text: str) -> None: ...\r
123 def describe(thing: Any) -> str: ...\r
124 def locate(path: str, forceload: bool = ...) -> object: ...\r
125 \r
126 text = ...  # type: TextDoc\r
127 html = ...  # type: HTMLDoc\r
128 \r
129 class _OldStyleClass: ...\r
130 \r
131 def resolve(thing: Union[str, object], forceload: bool = ...) -> Optional[Tuple[object, str]]: ...\r
132 def render_doc(thing: Union[str, object], title: str = ..., forceload: bool = ...) -> str: ...\r
133 def doc(thing: Union[str, object], title: str = ..., forceload: bool = ...) -> None: ...\r
134 def writedoc(thing: Union[str, object], forceload: bool = ...) -> None: ...\r
135 def writedocs(dir: str, pkgpath: str = ..., done: Optional[Any] = ...) -> None: ...\r
136 \r
137 class Helper:\r
138     keywords = ...  # type: Dict[str, Union[str, Tuple[str, str]]]\r
139     symbols = ...  # type: Dict[str, str]\r
140     topics = ...  # type: Dict[str, Union[str, Tuple[str, ...]]]\r
141     def __init__(self, input: Optional[IO[str]] = ..., output: Optional[IO[str]] = ...) -> None: ...\r
142     input = ...  # type: IO[str]\r
143     output = ...  # type: IO[str]\r
144     def __call__(self, request: Union[str, Helper, object] = ...) -> None: ...\r
145     def interact(self) -> None: ...\r
146     def getline(self, prompt: str) -> str: ...\r
147     def help(self, request: Any) -> None: ...\r
148     def intro(self) -> None: ...\r
149     def list(self, items: List[str], columns: int = ..., width: int = ...) -> None: ...\r
150     def listkeywords(self) -> None: ...\r
151     def listsymbols(self) -> None: ...\r
152     def listtopics(self) -> None: ...\r
153     def showtopic(self, topic: str, more_xrefs: str = ...) -> None: ...\r
154     def showsymbol(self, symbol: str) -> None: ...\r
155     def listmodules(self, key: str = ...) -> None: ...\r
156 \r
157 help = ...  # type: Helper\r
158 \r
159 # See Python issue #11182: "remove the unused and undocumented pydoc.Scanner class"\r
160 # class Scanner:\r
161 #     roots = ...  # type: Any\r
162 #     state = ...  # type: Any\r
163 #     children = ...  # type: Any\r
164 #     descendp = ...  # type: Any\r
165 #     def __init__(self, roots, children, descendp) -> None: ...\r
166 #     def next(self): ...\r
167 \r
168 class ModuleScanner:\r
169     quit = ...  # type: bool\r
170     def run(self, callback: Callable[[Optional[str], str, str], None], key: Optional[Any] = ..., completer: Optional[Callable[[], None]] = ..., onerror: Optional[Callable] = ...) -> None: ...\r
171 \r
172 def apropos(key: str) -> None: ...\r
173 def serve(port: int, callback: Optional[Callable[[Any], None]] = ..., completer: Optional[Callable[[], None]] = ...) -> None: ...\r
174 def gui() -> None: ...\r
175 def ispath(x: Any) -> bool: ...\r
176 def cli() -> None: ...\r