massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2and3 / warnings.pyi
1 # Stubs for warnings\r
2 \r
3 from typing import Any, Dict, List, NamedTuple, Optional, TextIO, Tuple, Type, Union\r
4 from types import ModuleType, TracebackType\r
5 \r
6 def warn(message: Union[str, Warning], category: Optional[Type[Warning]] = ...,\r
7          stacklevel: int = ...) -> None: ...\r
8 def warn_explicit(message: Union[str, Warning], category: Type[Warning],\r
9                   filename: str, lineno: int, module: Optional[str] = ...,\r
10                   registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ...,\r
11                   module_globals: Optional[Dict[str, Any]] = ...) -> None: ...\r
12 def showwarning(message: str, category: Type[Warning], filename: str,\r
13                 lineno: int, file: Optional[TextIO] = ...,\r
14                 line: Optional[str] = ...) -> None: ...\r
15 def formatwarning(message: str, category: Type[Warning], filename: str,\r
16                   lineno: int, line: Optional[str] = ...) -> str: ...\r
17 def filterwarnings(action: str, message: str = ...,\r
18                    category: Type[Warning] = ..., module: str = ...,\r
19                    lineno: int = ..., append: bool = ...) -> None: ...\r
20 def simplefilter(action: str, category: Type[Warning] = ..., lineno: int = ...,\r
21                  append: bool = ...) -> None: ...\r
22 def resetwarnings() -> None: ...\r
23 \r
24 _Record = NamedTuple('_Record',\r
25     [('message', str),\r
26      ('category', Type[Warning]),\r
27      ('filename', str),\r
28      ('lineno', int),\r
29      ('file', Optional[TextIO]),\r
30      ('line', Optional[str])]\r
31 )\r
32 \r
33 class catch_warnings:\r
34     def __init__(self, *, record: bool = ...,\r
35                  module: Optional[ModuleType] = ...) -> None: ...\r
36     def __enter__(self) -> Optional[List[_Record]]: ...\r
37     def __exit__(self, exc_type: Optional[Type[BaseException]],\r
38                  exc_val: Optional[Exception],\r
39                  exc_tb: Optional[TracebackType]) -> bool: ...\r