Add IO protocols to _typeshed (#4230)

This commit is contained in:
Sebastian Rittau
2020-06-14 20:44:48 +02:00
committed by GitHub
parent ef74bee249
commit 51cf2f51b8
21 changed files with 80 additions and 131 deletions

View File

@@ -1,4 +1,5 @@
from typing import Any, IO, Sequence, Tuple, Union, List, Dict, Protocol, Optional
from typing import Any, IO, Sequence, Tuple, Union, List, Dict, Optional
from _typeshed import SupportsReadline
DEFAULTSECT: str
MAX_INTERPOLATION_DEPTH: int
@@ -50,9 +51,6 @@ class MissingSectionHeaderError(ParsingError):
line: Any
def __init__(self, filename: str, lineno: Any, line: Any) -> None: ...
class _Readable(Protocol):
def readline(self) -> str: ...
class RawConfigParser:
_dict: Any
_sections: Dict[Any, Any]
@@ -68,7 +66,7 @@ class RawConfigParser:
def has_section(self, section: str) -> bool: ...
def options(self, section: str) -> List[str]: ...
def read(self, filenames: Union[str, Sequence[str]]) -> List[str]: ...
def readfp(self, fp: _Readable, filename: str = ...) -> None: ...
def readfp(self, fp: SupportsReadline[str], filename: str = ...) -> None: ...
def get(self, section: str, option: str) -> str: ...
def items(self, section: str) -> List[Tuple[Any, Any]]: ...
def _get(self, section: str, conv: type, option: str) -> Any: ...