mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
committed by
Jelle Zijlstra
parent
6afa610191
commit
44bdf6c6c7
@@ -1,4 +1,4 @@
|
||||
from typing import Any, IO, Sequence, Tuple, Union, List, Dict
|
||||
from typing import Any, IO, Sequence, Tuple, Union, List, Dict, Protocol
|
||||
|
||||
DEFAULTSECT = ... # type: str
|
||||
MAX_INTERPOLATION_DEPTH = ... # type: int
|
||||
@@ -50,6 +50,8 @@ class MissingSectionHeaderError(ParsingError):
|
||||
line = ... # type: Any
|
||||
def __init__(self, filename: str, lineno: Any, line: Any) -> None: ...
|
||||
|
||||
class _Readable(Protocol):
|
||||
def readline(self) -> str: ...
|
||||
|
||||
class RawConfigParser:
|
||||
_dict = ... # type: Any
|
||||
@@ -66,7 +68,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: IO[str], filename: str = ...) -> None: ...
|
||||
def readfp(self, fp: _Readable, 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: ...
|
||||
|
||||
@@ -92,15 +92,11 @@ class RawConfigParser(_parser):
|
||||
|
||||
def read(self, filenames: Union[_Path, Iterable[_Path]],
|
||||
encoding: Optional[str] = ...) -> List[str]: ...
|
||||
|
||||
def readfp(self, fp: IO[str], filename: Optional[str] = ...) -> None: ...
|
||||
|
||||
def read_file(self, f: Iterable[str], source: Optional[str] = ...) -> None: ...
|
||||
|
||||
def read_string(self, string: str, source: str = ...) -> None: ...
|
||||
|
||||
def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]],
|
||||
source: str = ...) -> None: ...
|
||||
def readfp(self, fp: Iterable[str], filename: Optional[str] = ...) -> None: ...
|
||||
|
||||
# These get* methods are partially applied (with the same names) in
|
||||
# SectionProxy; the stubs should be kept updated together
|
||||
|
||||
Reference in New Issue
Block a user