Format: application/octet-stream
⬇ Download File (2.5 KB)
   1  import sys
   2  from _typeshed import AnyPath
   3  from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator, Optional, Union
   4  
   5  if sys.version_info >= (3, 8):
   6      def input(
   7          files: Union[AnyPath, Iterable[AnyPath], None] = ...,
   8          inplace: bool = ...,
   9          backup: str = ...,
  10          *,
  11          mode: str = ...,
  12          openhook: Callable[[AnyPath, str], IO[AnyStr]] = ...,
  13      ) -> FileInput[AnyStr]: ...
  14  
  15  else:
  16      def input(
  17          files: Union[AnyPath, Iterable[AnyPath], None] = ...,
  18          inplace: bool = ...,
  19          backup: str = ...,
  20          bufsize: int = ...,
  21          mode: str = ...,
  22          openhook: Callable[[AnyPath, str], IO[AnyStr]] = ...,
  23      ) -> FileInput[AnyStr]: ...
  24  
  25  def close() -> None: ...
  26  def nextfile() -> None: ...
  27  def filename() -> str: ...
  28  def lineno() -> int: ...
  29  def filelineno() -> int: ...
  30  def fileno() -> int: ...
  31  def isfirstline() -> bool: ...
  32  def isstdin() -> bool: ...
  33  
  34  class FileInput(Iterable[AnyStr], Generic[AnyStr]):
  35      if sys.version_info >= (3, 8):
  36          def __init__(
  37              self,
  38              files: Union[None, AnyPath, Iterable[AnyPath]] = ...,
  39              inplace: bool = ...,
  40              backup: str = ...,
  41              *,
  42              mode: str = ...,
  43              openhook: Callable[[AnyPath, str], IO[AnyStr]] = ...,
  44          ) -> None: ...
  45      else:
  46          def __init__(
  47              self,
  48              files: Union[None, AnyPath, Iterable[AnyPath]] = ...,
  49              inplace: bool = ...,
  50              backup: str = ...,
  51              bufsize: int = ...,
  52              mode: str = ...,
  53              openhook: Callable[[AnyPath, str], IO[AnyStr]] = ...,
  54          ) -> None: ...
  55      def __del__(self) -> None: ...
  56      def close(self) -> None: ...
  57      if sys.version_info >= (3, 2):
  58          def __enter__(self) -> FileInput[AnyStr]: ...
  59          def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...
  60      def __iter__(self) -> Iterator[AnyStr]: ...
  61      def __next__(self) -> AnyStr: ...
  62      def __getitem__(self, i: int) -> AnyStr: ...
  63      def nextfile(self) -> None: ...
  64      def readline(self) -> AnyStr: ...
  65      def filename(self) -> str: ...
  66      def lineno(self) -> int: ...
  67      def filelineno(self) -> int: ...
  68      def fileno(self) -> int: ...
  69      def isfirstline(self) -> bool: ...
  70      def isstdin(self) -> bool: ...
  71  
  72  def hook_compressed(filename: AnyPath, mode: str) -> IO[Any]: ...
  73  
  74  if sys.version_info >= (3, 6):
  75      def hook_encoded(encoding: str, errors: Optional[str] = ...) -> Callable[[AnyPath, str], IO[Any]]: ...
  76  
  77  else:
  78      def hook_encoded(encoding: str) -> Callable[[AnyPath, str], IO[Any]]: ...
  79