massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2and3 / fileinput.pyi
1 from typing import Iterable, Callable, IO, AnyStr, Generic, Any, Text, Union, Iterator, Optional\r
2 \r
3 import os\r
4 import sys\r
5 \r
6 if sys.version_info >= (3, 6):\r
7     _Path = Union[Text, bytes, os.PathLike[Any]]\r
8 else:\r
9     _Path = Union[Text, bytes]\r
10 \r
11 \r
12 def input(\r
13     files: Union[_Path, Iterable[_Path], None] = ...,\r
14     inplace: bool = ...,\r
15     backup: str = ...,\r
16     bufsize: int = ...,\r
17     mode: str = ...,\r
18     openhook: Callable[[_Path, str], IO[AnyStr]] = ...) -> FileInput[AnyStr]: ...\r
19 \r
20 \r
21 def close() -> None: ...\r
22 def nextfile() -> None: ...\r
23 def filename() -> str: ...\r
24 def lineno() -> int: ...\r
25 def filelineno() -> int: ...\r
26 def fileno() -> int: ...\r
27 def isfirstline() -> bool: ...\r
28 def isstdin() -> bool: ...\r
29 \r
30 class FileInput(Iterable[AnyStr], Generic[AnyStr]):\r
31     def __init__(\r
32         self,\r
33         files: Union[None, _Path, Iterable[_Path]] = ...,\r
34         inplace: bool = ...,\r
35         backup: str = ...,\r
36         bufsize: int = ...,\r
37         mode: str = ...,\r
38         openhook: Callable[[_Path, str], IO[AnyStr]] = ...\r
39     ) -> None: ...\r
40 \r
41     def __del__(self) -> None: ...\r
42     def close(self) -> None: ...\r
43     if sys.version_info >= (3, 2):\r
44         def __enter__(self) -> FileInput[AnyStr]: ...\r
45         def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...\r
46     def __iter__(self) -> Iterator[AnyStr]: ...\r
47     def __next__(self) -> AnyStr: ...\r
48     def __getitem__(self, i: int) -> AnyStr: ...\r
49     def nextfile(self) -> None: ...\r
50     def readline(self) -> AnyStr: ...\r
51     def filename(self) -> str: ...\r
52     def lineno(self) -> int: ...\r
53     def filelineno(self) -> int: ...\r
54     def fileno(self) -> int: ...\r
55     def isfirstline(self) -> bool: ...\r
56     def isstdin(self) -> bool: ...\r
57 \r
58 def hook_compressed(filename: _Path, mode: str) -> IO[Any]: ...\r
59 if sys.version_info >= (3, 6):\r
60     def hook_encoded(encoding: str, errors: Optional[str] = ...) -> Callable[[_Path, str], IO[Any]]: ...\r
61 else:\r
62     def hook_encoded(encoding: str) -> Callable[[_Path, str], IO[Any]]: ...\r