mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Avoid using string literals in type annotations (#2294)
This commit is contained in:
committed by
Jelle Zijlstra
parent
25ad95de4f
commit
6192cce9d9
@@ -35,7 +35,7 @@ class BaseServer:
|
||||
def verify_request(self, request: bytes,
|
||||
client_address: Tuple[str, int]) -> bool: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
def __enter__(self) -> 'BaseServer': ...
|
||||
def __enter__(self) -> BaseServer: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[types.TracebackType]) -> bool: ...
|
||||
|
||||
@@ -7,8 +7,8 @@ class defaultdict(dict):
|
||||
def __init__(self, default: Any = ..., init: Any = ...) -> None: ...
|
||||
def __missing__(self, key) -> Any:
|
||||
raise KeyError()
|
||||
def __copy__(self) -> "defaultdict": ...
|
||||
def copy(self) -> "defaultdict": ...
|
||||
def __copy__(self) -> defaultdict: ...
|
||||
def copy(self) -> defaultdict: ...
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_T2 = TypeVar('_T2')
|
||||
@@ -31,10 +31,10 @@ class deque(Generic[_T]):
|
||||
def reverse(self) -> None: ...
|
||||
def rotate(self, n: int = ...) -> None: ...
|
||||
def __contains__(self, o: Any) -> bool: ...
|
||||
def __copy__(self) -> "deque[_T]": ...
|
||||
def __copy__(self) -> deque[_T]: ...
|
||||
def __getitem__(self, i: int) -> _T:
|
||||
raise IndexError()
|
||||
def __iadd__(self, other: "deque[_T2]") -> "deque[Union[_T, _T2]]": ...
|
||||
def __iadd__(self, other: deque[_T2]) -> deque[Union[_T, _T2]]: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __reversed__(self) -> Iterator[_T]: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ class MD5Type(object):
|
||||
name = ... # type: str
|
||||
block_size = ... # type: int
|
||||
digest_size = ... # type: int
|
||||
def copy(self) -> "MD5Type": ...
|
||||
def copy(self) -> MD5Type: ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
|
||||
@@ -7,7 +7,7 @@ class sha(object): # not actually exposed
|
||||
block_size = ... # type: int
|
||||
digest_size = ... # type: int
|
||||
digestsize = ... # type: int
|
||||
def copy(self) -> "sha": ...
|
||||
def copy(self) -> sha: ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
|
||||
@@ -6,7 +6,7 @@ class sha224(object):
|
||||
digest_size = ... # type: int
|
||||
digestsize = ... # type: int
|
||||
def __init__(self, init: Optional[str]) -> None: ...
|
||||
def copy(self) -> "sha224": ...
|
||||
def copy(self) -> sha224: ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
@@ -17,7 +17,7 @@ class sha256(object):
|
||||
digest_size = ... # type: int
|
||||
digestsize = ... # type: int
|
||||
def __init__(self, init: Optional[str]) -> None: ...
|
||||
def copy(self) -> "sha256": ...
|
||||
def copy(self) -> sha256: ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
|
||||
@@ -6,7 +6,7 @@ class sha384(object):
|
||||
digest_size = ... # type: int
|
||||
digestsize = ... # type: int
|
||||
def __init__(self, init: Optional[str]) -> None: ...
|
||||
def copy(self) -> "sha384": ...
|
||||
def copy(self) -> sha384: ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
@@ -17,7 +17,7 @@ class sha512(object):
|
||||
digest_size = ... # type: int
|
||||
digestsize = ... # type: int
|
||||
def __init__(self, init: Optional[str]) -> None: ...
|
||||
def copy(self) -> "sha512": ...
|
||||
def copy(self) -> sha512: ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
|
||||
@@ -253,14 +253,14 @@ class SocketType(object):
|
||||
timeout = ... # type: float
|
||||
|
||||
def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ...
|
||||
def accept(self) -> Tuple['SocketType', tuple]: ...
|
||||
def accept(self) -> Tuple[SocketType, tuple]: ...
|
||||
def bind(self, address: tuple) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def connect(self, address: tuple) -> None:
|
||||
raise gaierror
|
||||
raise timeout
|
||||
def connect_ex(self, address: tuple) -> int: ...
|
||||
def dup(self) -> "SocketType": ...
|
||||
def dup(self) -> SocketType: ...
|
||||
def fileno(self) -> int: ...
|
||||
def getpeername(self) -> tuple: ...
|
||||
def getsockname(self) -> tuple: ...
|
||||
|
||||
@@ -14,10 +14,10 @@ class ABCMeta(type):
|
||||
_abc_negative_cache_version = ... # type: int
|
||||
_abc_registry = ... # type: _weakrefset.WeakSet
|
||||
def __init__(self, name: str, bases: Tuple[type, ...], namespace: Dict[Any, Any]) -> None: ...
|
||||
def __instancecheck__(cls: "ABCMeta", instance: Any) -> Any: ...
|
||||
def __subclasscheck__(cls: "ABCMeta", subclass: Any) -> Any: ...
|
||||
def _dump_registry(cls: "ABCMeta", *args: Any, **kwargs: Any) -> None: ...
|
||||
def register(cls: "ABCMeta", subclass: Type[Any]) -> None: ...
|
||||
def __instancecheck__(cls: ABCMeta, instance: Any) -> Any: ...
|
||||
def __subclasscheck__(cls: ABCMeta, subclass: Any) -> Any: ...
|
||||
def _dump_registry(cls: ABCMeta, *args: Any, **kwargs: Any) -> None: ...
|
||||
def register(cls: ABCMeta, subclass: Type[Any]) -> None: ...
|
||||
|
||||
# TODO: The real abc.abstractproperty inherits from "property".
|
||||
class abstractproperty(object):
|
||||
|
||||
@@ -22,7 +22,7 @@ class InputType(IO[str], Iterator[str], metaclass=ABCMeta):
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: Optional[int] = ...) -> int: ...
|
||||
def __iter__(self) -> 'InputType': ...
|
||||
def __iter__(self) -> InputType: ...
|
||||
def next(self) -> str: ...
|
||||
def reset(self) -> None: ...
|
||||
|
||||
@@ -42,7 +42,7 @@ class OutputType(IO[str], Iterator[str], metaclass=ABCMeta):
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: Optional[int] = ...) -> int: ...
|
||||
def __iter__(self) -> 'OutputType': ...
|
||||
def __iter__(self) -> OutputType: ...
|
||||
def next(self) -> str: ...
|
||||
def reset(self) -> None: ...
|
||||
def write(self, b: Union[str, unicode]) -> int: ...
|
||||
|
||||
@@ -100,7 +100,7 @@ class Popen:
|
||||
def send_signal(self, signal: int) -> None: ...
|
||||
def terminate(self) -> None: ...
|
||||
def kill(self) -> None: ...
|
||||
def __enter__(self) -> 'Popen': ...
|
||||
def __enter__(self) -> Popen: ...
|
||||
def __exit__(self, type, value, traceback) -> bool: ...
|
||||
|
||||
# Windows-only: STARTUPINFO etc.
|
||||
|
||||
@@ -44,7 +44,7 @@ class FunctionType:
|
||||
__globals__ = func_globals
|
||||
__name__ = func_name
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __get__(self, obj: Optional[object], type: Optional[type]) -> 'UnboundMethodType': ...
|
||||
def __get__(self, obj: Optional[object], type: Optional[type]) -> UnboundMethodType: ...
|
||||
|
||||
LambdaType = FunctionType
|
||||
|
||||
@@ -68,14 +68,14 @@ class GeneratorType:
|
||||
gi_code = ... # type: CodeType
|
||||
gi_frame = ... # type: FrameType
|
||||
gi_running = ... # type: int
|
||||
def __iter__(self) -> 'GeneratorType': ...
|
||||
def __iter__(self) -> GeneratorType: ...
|
||||
def close(self) -> None: ...
|
||||
def next(self) -> Any: ...
|
||||
def send(self, arg: Any) -> Any: ...
|
||||
@overload
|
||||
def throw(self, val: BaseException) -> Any: ...
|
||||
@overload
|
||||
def throw(self, typ: type, val: BaseException = ..., tb: 'TracebackType' = ...) -> Any: ...
|
||||
def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ...
|
||||
|
||||
class ClassType: ...
|
||||
class UnboundMethodType:
|
||||
|
||||
@@ -360,7 +360,7 @@ class Match(Generic[AnyStr]):
|
||||
|
||||
# The regular expression object whose match() or search() method produced
|
||||
# this match instance.
|
||||
re = ... # type: 'Pattern[AnyStr]'
|
||||
re = ... # type: Pattern[AnyStr]
|
||||
|
||||
def expand(self, template: AnyStr) -> AnyStr: ...
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ _Regexp = Union[Text, Pattern[Text]]
|
||||
|
||||
class Testable(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def run(self, result: 'TestResult') -> None: ...
|
||||
def run(self, result: TestResult) -> None: ...
|
||||
@abstractmethod
|
||||
def debug(self) -> None: ...
|
||||
@abstractmethod
|
||||
|
||||
@@ -67,7 +67,7 @@ class DictReader(Iterator[_DRMapping]):
|
||||
def __init__(self, f: Iterable[str], fieldnames: Sequence[str] = ...,
|
||||
restkey: Optional[str] = ..., restval: Optional[str] = ..., dialect: _Dialect = ...,
|
||||
*args: Any, **kwds: Any) -> None: ...
|
||||
def __iter__(self) -> 'DictReader': ...
|
||||
def __iter__(self) -> DictReader: ...
|
||||
if sys.version_info >= (3,):
|
||||
def __next__(self) -> _DRMapping: ...
|
||||
else:
|
||||
|
||||
@@ -37,10 +37,10 @@ class Fraction(Rational):
|
||||
def __init__(self, value: str, *, _normalize: bool = ...) -> None: ...
|
||||
|
||||
@classmethod
|
||||
def from_float(cls, f: float) -> 'Fraction': ...
|
||||
def from_float(cls, f: float) -> Fraction: ...
|
||||
@classmethod
|
||||
def from_decimal(cls, dec: Decimal) -> 'Fraction': ...
|
||||
def limit_denominator(self, max_denominator: int = ...) -> 'Fraction': ...
|
||||
def from_decimal(cls, dec: Decimal) -> Fraction: ...
|
||||
def limit_denominator(self, max_denominator: int = ...) -> Fraction: ...
|
||||
|
||||
@property
|
||||
def numerator(self) -> int: ...
|
||||
@@ -67,9 +67,9 @@ class Fraction(Rational):
|
||||
def __pow__(self, other): ...
|
||||
def __rpow__(self, other): ...
|
||||
|
||||
def __pos__(self) -> 'Fraction': ...
|
||||
def __neg__(self) -> 'Fraction': ...
|
||||
def __abs__(self) -> 'Fraction': ...
|
||||
def __pos__(self) -> Fraction: ...
|
||||
def __neg__(self) -> Fraction: ...
|
||||
def __abs__(self) -> Fraction: ...
|
||||
def __trunc__(self) -> int: ...
|
||||
if sys.version_info >= (3, 0):
|
||||
def __floor__(self) -> int: ...
|
||||
@@ -90,7 +90,7 @@ class Fraction(Rational):
|
||||
# Not actually defined within fractions.py, but provides more useful
|
||||
# overrides
|
||||
@property
|
||||
def real(self) -> 'Fraction': ...
|
||||
def real(self) -> Fraction: ...
|
||||
@property
|
||||
def imag(self) -> 'Fraction': ...
|
||||
def conjugate(self) -> 'Fraction': ...
|
||||
def imag(self) -> Fraction: ...
|
||||
def conjugate(self) -> Fraction: ...
|
||||
|
||||
@@ -17,7 +17,7 @@ if sys.version_info >= (3, 5):
|
||||
else:
|
||||
_ExcInfoType = Union[None, bool, _SysExcInfoType]
|
||||
_ArgsType = Union[Tuple[Any, ...], Dict[str, Any]]
|
||||
_FilterType = Union['Filter', Callable[['LogRecord'], int]]
|
||||
_FilterType = Union[Filter, Callable[[LogRecord], int]]
|
||||
_Level = Union[int, Text]
|
||||
|
||||
raiseExceptions: bool
|
||||
@@ -33,7 +33,7 @@ class Filterer(object):
|
||||
def __init__(self) -> None: ...
|
||||
def addFilter(self, filter: Filter) -> None: ...
|
||||
def removeFilter(self, filter: Filter) -> None: ...
|
||||
def filter(self, record: 'LogRecord') -> bool: ...
|
||||
def filter(self, record: LogRecord) -> bool: ...
|
||||
|
||||
class Logger(Filterer):
|
||||
name = ... # type: str
|
||||
@@ -46,7 +46,7 @@ class Logger(Filterer):
|
||||
def setLevel(self, lvl: Union[int, str]) -> None: ...
|
||||
def isEnabledFor(self, lvl: int) -> bool: ...
|
||||
def getEffectiveLevel(self) -> int: ...
|
||||
def getChild(self, suffix: str) -> 'Logger': ...
|
||||
def getChild(self, suffix: str) -> Logger: ...
|
||||
if sys.version_info >= (3,):
|
||||
def debug(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ...,
|
||||
stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ...,
|
||||
@@ -99,14 +99,14 @@ class Logger(Filterer):
|
||||
extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ...
|
||||
def addFilter(self, filt: _FilterType) -> None: ...
|
||||
def removeFilter(self, filt: _FilterType) -> None: ...
|
||||
def filter(self, record: 'LogRecord') -> bool: ...
|
||||
def addHandler(self, hdlr: 'Handler') -> None: ...
|
||||
def removeHandler(self, hdlr: 'Handler') -> None: ...
|
||||
def filter(self, record: LogRecord) -> bool: ...
|
||||
def addHandler(self, hdlr: Handler) -> None: ...
|
||||
def removeHandler(self, hdlr: Handler) -> None: ...
|
||||
if sys.version_info >= (3,):
|
||||
def findCaller(self, stack_info: bool = ...) -> Tuple[str, int, str, Optional[str]]: ...
|
||||
else:
|
||||
def findCaller(self) -> Tuple[str, int, str]: ...
|
||||
def handle(self, record: 'LogRecord') -> None: ...
|
||||
def handle(self, record: LogRecord) -> None: ...
|
||||
if sys.version_info >= (3,):
|
||||
def makeRecord(self, name: str, lvl: int, fn: str, lno: int, msg: Any,
|
||||
args: Mapping[str, Any],
|
||||
@@ -144,16 +144,16 @@ class Handler(Filterer):
|
||||
def acquire(self) -> None: ...
|
||||
def release(self) -> None: ...
|
||||
def setLevel(self, lvl: Union[int, str]) -> None: ...
|
||||
def setFormatter(self, form: 'Formatter') -> None: ...
|
||||
def setFormatter(self, form: Formatter) -> None: ...
|
||||
def addFilter(self, filt: _FilterType) -> None: ...
|
||||
def removeFilter(self, filt: _FilterType) -> None: ...
|
||||
def filter(self, record: 'LogRecord') -> bool: ...
|
||||
def filter(self, record: LogRecord) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def handle(self, record: 'LogRecord') -> None: ...
|
||||
def handleError(self, record: 'LogRecord') -> None: ...
|
||||
def format(self, record: 'LogRecord') -> str: ...
|
||||
def emit(self, record: 'LogRecord') -> None: ...
|
||||
def handle(self, record: LogRecord) -> None: ...
|
||||
def handleError(self, record: LogRecord) -> None: ...
|
||||
def format(self, record: LogRecord) -> str: ...
|
||||
def emit(self, record: LogRecord) -> None: ...
|
||||
|
||||
|
||||
class Formatter:
|
||||
@@ -174,8 +174,8 @@ class Formatter:
|
||||
fmt: Optional[str] = ...,
|
||||
datefmt: Optional[str] =...) -> None: ...
|
||||
|
||||
def format(self, record: 'LogRecord') -> str: ...
|
||||
def formatTime(self, record: 'LogRecord', datefmt: str = ...) -> str: ...
|
||||
def format(self, record: LogRecord) -> str: ...
|
||||
def formatTime(self, record: LogRecord, datefmt: str = ...) -> str: ...
|
||||
def formatException(self, exc_info: _SysExcInfoType) -> str: ...
|
||||
if sys.version_info >= (3,):
|
||||
def formatStack(self, stack_info: str) -> str: ...
|
||||
@@ -183,7 +183,7 @@ class Formatter:
|
||||
|
||||
class Filter:
|
||||
def __init__(self, name: str = ...) -> None: ...
|
||||
def filter(self, record: 'LogRecord') -> int: ...
|
||||
def filter(self, record: LogRecord) -> int: ...
|
||||
|
||||
|
||||
class LogRecord:
|
||||
@@ -362,7 +362,7 @@ if sys.version_info >= (3,):
|
||||
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
lastResort = ... # type: Optional['StreamHandler']
|
||||
lastResort = ... # type: Optional[StreamHandler]
|
||||
|
||||
|
||||
class StreamHandler(Handler):
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import List, Union, Sequence, Optional, Dict
|
||||
class Class:
|
||||
module = ... # type: str
|
||||
name = ... # type: str
|
||||
super = ... # type: Optional[List[Union["Class", str]]]
|
||||
super = ... # type: Optional[List[Union[Class, str]]]
|
||||
methods = ... # type: Dict[str, int]
|
||||
file = ... # type: int
|
||||
lineno = ... # type: int
|
||||
@@ -12,7 +12,7 @@ class Class:
|
||||
def __init__(self,
|
||||
module: str,
|
||||
name: str,
|
||||
super: Optional[List[Union["Class", str]]],
|
||||
super: Optional[List[Union[Class, str]]],
|
||||
file: str,
|
||||
lineno: int) -> None: ...
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@ class socket:
|
||||
|
||||
# --- methods ---
|
||||
# second tuple item is an address
|
||||
def accept(self) -> Tuple['socket', Any]: ...
|
||||
def accept(self) -> Tuple[socket, Any]: ...
|
||||
def bind(self, address: Union[tuple, str, bytes]) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def connect(self, address: Union[tuple, str, bytes]) -> None: ...
|
||||
|
||||
@@ -7,10 +7,10 @@ xpath_tokenizer_re = ... # type: Pattern
|
||||
|
||||
_token = Tuple[str, str]
|
||||
_next = Callable[[], _token]
|
||||
_callback = Callable[['_SelectorContext', List[Element]], Generator[Element, None, None]]
|
||||
_callback = Callable[[_SelectorContext, List[Element]], Generator[Element, None, None]]
|
||||
|
||||
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
|
||||
def get_parent_map(context: '_SelectorContext') -> Dict[Element, Element]: ...
|
||||
def get_parent_map(context: _SelectorContext) -> Dict[Element, Element]: ...
|
||||
def prepare_child(next: _next, token: _token) -> _callback: ...
|
||||
def prepare_star(next: _next, token: _token) -> _callback: ...
|
||||
def prepare_self(next: _next, token: _token) -> _callback: ...
|
||||
|
||||
@@ -8,7 +8,7 @@ VERSION = ... # type: str
|
||||
|
||||
class ParseError(SyntaxError): ...
|
||||
|
||||
def iselement(element: 'Element') -> bool: ...
|
||||
def iselement(element: Element) -> bool: ...
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
@@ -41,45 +41,45 @@ else:
|
||||
# On the bright side, tostring and tostringlist always return bytes:
|
||||
_tostring_result_type = bytes
|
||||
|
||||
class Element(MutableSequence['Element']):
|
||||
class Element(MutableSequence[Element]):
|
||||
tag = ... # type: _str_result_type
|
||||
attrib = ... # type: Dict[_str_result_type, _str_result_type]
|
||||
text = ... # type: Optional[_str_result_type]
|
||||
tail = ... # type: Optional[_str_result_type]
|
||||
def __init__(self, tag: Union[_str_argument_type, Callable[..., 'Element']], attrib: Dict[_str_argument_type, _str_argument_type]=..., **extra: _str_argument_type) -> None: ...
|
||||
def append(self, subelement: 'Element') -> None: ...
|
||||
def __init__(self, tag: Union[_str_argument_type, Callable[..., Element]], attrib: Dict[_str_argument_type, _str_argument_type]=..., **extra: _str_argument_type) -> None: ...
|
||||
def append(self, subelement: Element) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def copy(self) -> 'Element': ...
|
||||
def extend(self, elements: Iterable['Element']) -> None: ...
|
||||
def find(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> Optional['Element']: ...
|
||||
def findall(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> List['Element']: ...
|
||||
def copy(self) -> Element: ...
|
||||
def extend(self, elements: Iterable[Element]) -> None: ...
|
||||
def find(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> Optional[Element]: ...
|
||||
def findall(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> List[Element]: ...
|
||||
def findtext(self, path: _str_argument_type, default: _T=..., namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> Union[_T, _str_result_type]: ...
|
||||
def get(self, key: _str_argument_type, default: _T=...) -> Union[_str_result_type, _T]: ...
|
||||
def getchildren(self) -> List['Element']: ...
|
||||
def getiterator(self, tag: _str_argument_type=...) -> List['Element']: ...
|
||||
def getchildren(self) -> List[Element]: ...
|
||||
def getiterator(self, tag: _str_argument_type=...) -> List[Element]: ...
|
||||
if sys.version_info >= (3, 2):
|
||||
def insert(self, index: int, subelement: 'Element') -> None: ...
|
||||
def insert(self, index: int, subelement: Element) -> None: ...
|
||||
else:
|
||||
def insert(self, index: int, element: 'Element') -> None: ...
|
||||
def insert(self, index: int, element: Element) -> None: ...
|
||||
def items(self) -> ItemsView[_str_result_type, _str_result_type]: ...
|
||||
def iter(self, tag: _str_argument_type=...) -> Generator['Element', None, None]: ...
|
||||
def iterfind(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> List['Element']: ...
|
||||
def iter(self, tag: _str_argument_type=...) -> Generator[Element, None, None]: ...
|
||||
def iterfind(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> List[Element]: ...
|
||||
def itertext(self) -> Generator[_str_result_type, None, None]: ...
|
||||
def keys(self) -> KeysView[_str_result_type]: ...
|
||||
def makeelement(self, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]) -> 'Element': ...
|
||||
def remove(self, subelement: 'Element') -> None: ...
|
||||
def makeelement(self, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]) -> Element: ...
|
||||
def remove(self, subelement: Element) -> None: ...
|
||||
def set(self, key: _str_argument_type, value: _str_argument_type) -> None: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __delitem__(self, i: Union[int, slice]) -> None: ...
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> 'Element': ...
|
||||
def __getitem__(self, i: int) -> Element: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> Sequence['Element']: ...
|
||||
def __getitem__(self, s: slice) -> Sequence[Element]: ...
|
||||
def __len__(self) -> int: ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, o: 'Element') -> None: ...
|
||||
def __setitem__(self, i: int, o: Element) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, s: slice, o: Iterable['Element']) -> None: ...
|
||||
def __setitem__(self, s: slice, o: Iterable[Element]) -> None: ...
|
||||
|
||||
|
||||
def SubElement(parent: Element, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]=..., **extra: _str_argument_type) -> Element: ...
|
||||
@@ -98,7 +98,7 @@ _file_or_filename = Union[str, bytes, int, IO[Any]]
|
||||
class ElementTree:
|
||||
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
|
||||
def getroot(self) -> Element: ...
|
||||
def parse(self, source: _file_or_filename, parser: 'XMLParser'=...) -> Element: ...
|
||||
def parse(self, source: _file_or_filename, parser: XMLParser=...) -> Element: ...
|
||||
def iter(self, tag: _str_argument_type=...) -> Generator[Element, None, None]: ...
|
||||
def getiterator(self, tag: _str_argument_type=...) -> List[Element]: ...
|
||||
def find(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> Optional[Element]: ...
|
||||
@@ -119,23 +119,23 @@ else:
|
||||
def tostring(element: Element, encoding: str=..., method: str=...) -> _tostring_result_type: ...
|
||||
def tostringlist(element: Element, encoding: str=..., method: str=...) -> List[_tostring_result_type]: ...
|
||||
def dump(elem: Element) -> None: ...
|
||||
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
|
||||
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Any]]: ...
|
||||
def parse(source: _file_or_filename, parser: XMLParser=...) -> ElementTree: ...
|
||||
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: XMLParser=...) -> Iterator[Tuple[str, Any]]: ...
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
class XMLPullParser:
|
||||
def __init__(self, events: Sequence[str]=..., *, _parser: 'XMLParser'=...) -> None: ...
|
||||
def __init__(self, events: Sequence[str]=..., *, _parser: XMLParser=...) -> None: ...
|
||||
def feed(self, data: bytes) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def read_events(self) -> Iterator[Tuple[str, Element]]: ...
|
||||
|
||||
def XML(text: _parser_input_type, parser: 'XMLParser'=...) -> Element: ...
|
||||
def XMLID(text: _parser_input_type, parser: 'XMLParser'=...) -> Tuple[Element, Dict[_str_result_type, Element]]: ...
|
||||
def XML(text: _parser_input_type, parser: XMLParser=...) -> Element: ...
|
||||
def XMLID(text: _parser_input_type, parser: XMLParser=...) -> Tuple[Element, Dict[_str_result_type, Element]]: ...
|
||||
|
||||
# This is aliased to XML in the source.
|
||||
fromstring = XML
|
||||
|
||||
def fromstringlist(sequence: Sequence[_parser_input_type], parser: 'XMLParser'=...) -> Element: ...
|
||||
def fromstringlist(sequence: Sequence[_parser_input_type], parser: XMLParser=...) -> Element: ...
|
||||
|
||||
# This type is both not precise enough and too precise. The TreeBuilder
|
||||
# requires the elementfactory to accept tag and attrs in its args and produce
|
||||
|
||||
@@ -335,9 +335,9 @@ class _CursesWindow:
|
||||
def delch(self, y: int, x: int) -> None: ...
|
||||
def deleteln(self) -> None: ...
|
||||
@overload
|
||||
def derwin(self, begin_y: int, begin_x: int) -> '_CursesWindow': ...
|
||||
def derwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ...
|
||||
@overload
|
||||
def derwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> '_CursesWindow': ...
|
||||
def derwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ...
|
||||
def echochar(self, ch: _chtype, attr: int = ...) -> None: ...
|
||||
def enclose(self, y: int, x: int) -> bool: ...
|
||||
def erase(self) -> None: ...
|
||||
@@ -406,13 +406,13 @@ class _CursesWindow:
|
||||
def notimeout(self, yes: bool) -> None: ...
|
||||
def noutrefresh(self) -> None: ...
|
||||
@overload
|
||||
def overlay(self, destwin: '_CursesWindow') -> None: ...
|
||||
def overlay(self, destwin: _CursesWindow) -> None: ...
|
||||
@overload
|
||||
def overlay(self, destwin: '_CursesWindow', sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ...
|
||||
def overlay(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ...
|
||||
@overload
|
||||
def overwrite(self, destwin: '_CursesWindow') -> None: ...
|
||||
def overwrite(self, destwin: _CursesWindow) -> None: ...
|
||||
@overload
|
||||
def overwrite(self, destwin: '_CursesWindow', sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ...
|
||||
def overwrite(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ...
|
||||
def putwin(self, file: IO[Any]) -> None: ...
|
||||
def redrawln(self, beg: int, num: int) -> None: ...
|
||||
def redrawwin(self) -> None: ...
|
||||
@@ -427,13 +427,13 @@ class _CursesWindow:
|
||||
def standend(self) -> None: ...
|
||||
def standout(self) -> None: ...
|
||||
@overload
|
||||
def subpad(self, begin_y: int, begin_x: int) -> '_CursesWindow': ...
|
||||
def subpad(self, begin_y: int, begin_x: int) -> _CursesWindow: ...
|
||||
@overload
|
||||
def subpad(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> '_CursesWindow': ...
|
||||
def subpad(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ...
|
||||
@overload
|
||||
def subwin(self, begin_y: int, begin_x: int) -> '_CursesWindow': ...
|
||||
def subwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ...
|
||||
@overload
|
||||
def subwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> '_CursesWindow': ...
|
||||
def subwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ...
|
||||
def syncdown(self) -> None: ...
|
||||
def syncok(self, flag: bool) -> None: ...
|
||||
def syncup(self) -> None: ...
|
||||
|
||||
@@ -10,7 +10,7 @@ import sys
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
class ModuleSpec:
|
||||
def __init__(self, name: str, loader: Optional['Loader'], *,
|
||||
def __init__(self, name: str, loader: Optional[Loader], *,
|
||||
origin: Optional[str] = ..., loader_state: Any = ...,
|
||||
is_package: Optional[bool] = ...) -> None: ...
|
||||
name = ... # type: str
|
||||
|
||||
@@ -23,7 +23,7 @@ class make_scanner:
|
||||
parse_float = ... # type: Any
|
||||
strict = ... # type: bool
|
||||
# TODO: 'context' needs the attrs above (ducktype), but not __call__.
|
||||
def __init__(self, context: "make_scanner") -> None: ...
|
||||
def __init__(self, context: make_scanner) -> None: ...
|
||||
def __call__(self, string: str, index: int) -> Tuple[Any, int]: ...
|
||||
|
||||
def encode_basestring_ascii(s: str) -> str: ...
|
||||
|
||||
@@ -6,7 +6,7 @@ _FuncT = TypeVar('_FuncT', bound=Callable[..., Any])
|
||||
|
||||
# Thesee definitions have special processing in mypy
|
||||
class ABCMeta(type):
|
||||
def register(cls: "ABCMeta", subclass: Type[_T]) -> Type[_T]: ...
|
||||
def register(cls: ABCMeta, subclass: Type[_T]) -> Type[_T]: ...
|
||||
|
||||
def abstractmethod(callable: _FuncT) -> _FuncT: ...
|
||||
class abstractproperty(property): ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from _curses import _CursesWindow
|
||||
|
||||
class _Curses_Panel: # type is <class '_curses_panel.curses panel'> (note the space in the class name)
|
||||
def above(self) -> '_Curses_Panel': ...
|
||||
def below(self) -> '_Curses_Panel': ...
|
||||
def above(self) -> _Curses_Panel: ...
|
||||
def below(self) -> _Curses_Panel: ...
|
||||
def bottom(self) -> None: ...
|
||||
def hidden(self) -> bool: ...
|
||||
def hide(self) -> None: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ from email.message import Message
|
||||
from email.policy import Policy
|
||||
|
||||
class Generator:
|
||||
def clone(self, fp: TextIO) -> 'Generator': ...
|
||||
def clone(self, fp: TextIO) -> Generator: ...
|
||||
def write(self, s: str) -> None: ...
|
||||
def __init__(self, outfp: TextIO, mangle_from_: bool = ...,
|
||||
maxheaderlen: int = ..., *,
|
||||
@@ -14,7 +14,7 @@ class Generator:
|
||||
linesep: Optional[str] =...) -> None: ...
|
||||
|
||||
class BytesGenerator:
|
||||
def clone(self, fp: TextIO) -> 'Generator': ...
|
||||
def clone(self, fp: TextIO) -> Generator: ...
|
||||
def write(self, s: str) -> None: ...
|
||||
def __init__(self, outfp: TextIO, mangle_from_: bool = ...,
|
||||
maxheaderlen: int = ..., *,
|
||||
|
||||
@@ -12,7 +12,7 @@ class BaseHeader(str):
|
||||
def defects(self) -> Tuple[MessageDefect, ...]: ...
|
||||
@property
|
||||
def max_count(self) -> Optional[int]: ...
|
||||
def __new__(cls, name: str, value: Any) -> 'BaseHeader': ...
|
||||
def __new__(cls, name: str, value: Any) -> BaseHeader: ...
|
||||
def init(self, *args: Any, **kw: Any) -> None: ...
|
||||
def fold(self, *, policy: Policy) -> str: ...
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class Message:
|
||||
def is_multipart(self) -> bool: ...
|
||||
def set_unixfrom(self, unixfrom: str) -> None: ...
|
||||
def get_unixfrom(self) -> Optional[str]: ...
|
||||
def attach(self, payload: 'Message') -> None: ...
|
||||
def attach(self, payload: Message) -> None: ...
|
||||
def get_payload(self, i: int = ..., decode: bool = ...) -> Optional[_PayloadType]: ...
|
||||
def set_payload(self, payload: _PayloadType,
|
||||
charset: _CharsetType = ...) -> None: ...
|
||||
@@ -62,7 +62,7 @@ class Message:
|
||||
def set_boundary(self, boundary: str) -> None: ...
|
||||
def get_content_charset(self, failobj: _T = ...) -> Union[_T, str]: ...
|
||||
def get_charsets(self, failobj: _T = ...) -> Union[_T, List[str]]: ...
|
||||
def walk(self) -> Generator['Message', None, None]: ...
|
||||
def walk(self) -> Generator[Message, None, None]: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def get_content_disposition(self) -> Optional[str]: ...
|
||||
def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ...,
|
||||
|
||||
@@ -16,7 +16,7 @@ class Policy:
|
||||
if sys.version_info >= (3, 5):
|
||||
mange_from = ... # type: bool
|
||||
def __init__(self, **kw: Any) -> None: ...
|
||||
def clone(self, **kw: Any) -> 'Policy': ...
|
||||
def clone(self, **kw: Any) -> Policy: ...
|
||||
def handle_defect(self, obj: Message,
|
||||
defect: MessageDefect) -> None: ...
|
||||
def register_defect(self, obj: Message,
|
||||
|
||||
@@ -100,7 +100,7 @@ if sys.version_info >= (3, 5):
|
||||
def fileno(self) -> int: ...
|
||||
def isclosed(self) -> bool: ...
|
||||
def __iter__(self) -> Iterator[bytes]: ...
|
||||
def __enter__(self) -> 'HTTPResponse': ...
|
||||
def __enter__(self) -> HTTPResponse: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[types.TracebackType]) -> bool: ...
|
||||
@@ -122,7 +122,7 @@ else:
|
||||
def getheaders(self) -> List[Tuple[str, str]]: ...
|
||||
def fileno(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[bytes]: ...
|
||||
def __enter__(self) -> 'HTTPResponse': ...
|
||||
def __enter__(self) -> HTTPResponse: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[types.TracebackType]) -> bool: ...
|
||||
|
||||
@@ -7,28 +7,28 @@ _T = TypeVar('_T')
|
||||
class LoadError(OSError): ...
|
||||
|
||||
|
||||
class CookieJar(Iterable['Cookie']):
|
||||
def __init__(self, policy: Optional['CookiePolicy'] = ...) -> None: ...
|
||||
class CookieJar(Iterable[Cookie]):
|
||||
def __init__(self, policy: Optional[CookiePolicy] = ...) -> None: ...
|
||||
def add_cookie_header(self, request: Request) -> None: ...
|
||||
def extract_cookies(self, response: HTTPResponse,
|
||||
request: Request) -> None: ...
|
||||
def set_policy(self, policy: 'CookiePolicy') -> None: ...
|
||||
def set_policy(self, policy: CookiePolicy) -> None: ...
|
||||
def make_cookies(self, response: HTTPResponse,
|
||||
request: Request) -> Sequence['Cookie']: ...
|
||||
def set_cookie(self, cookie: 'Cookie') -> None: ...
|
||||
def set_cookie_if_ok(self, cookie: 'Cookie',
|
||||
request: Request) -> Sequence[Cookie]: ...
|
||||
def set_cookie(self, cookie: Cookie) -> None: ...
|
||||
def set_cookie_if_ok(self, cookie: Cookie,
|
||||
request: Request) -> None: ...
|
||||
def clear(self, domain: str = ..., path: str = ...,
|
||||
name: str = ...) -> None: ...
|
||||
def clear_session_cookies(self) -> None: ...
|
||||
def __iter__(self) -> Iterator['Cookie']: ...
|
||||
def __iter__(self) -> Iterator[Cookie]: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
class FileCookieJar(CookieJar):
|
||||
filename = ... # type: str
|
||||
delayload = ... # type: bool
|
||||
def __init__(self, filename: str = ..., delayload: bool = ...,
|
||||
policy: Optional['CookiePolicy'] = ...) -> None: ...
|
||||
policy: Optional[CookiePolicy] = ...) -> None: ...
|
||||
def save(self, filename: Optional[str] = ..., ignore_discard: bool = ...,
|
||||
ignore_expires: bool = ...) -> None: ...
|
||||
def load(self, filename: Optional[str] = ..., ignore_discard: bool = ...,
|
||||
@@ -44,8 +44,8 @@ class CookiePolicy:
|
||||
netscape = ... # type: bool
|
||||
rfc2965 = ... # type: bool
|
||||
hide_cookie2 = ... # type: bool
|
||||
def set_ok(self, cookie: 'Cookie', request: Request) -> bool: ...
|
||||
def return_ok(self, cookie: 'Cookie', request: Request) -> bool: ...
|
||||
def set_ok(self, cookie: Cookie, request: Request) -> bool: ...
|
||||
def return_ok(self, cookie: Cookie, request: Request) -> bool: ...
|
||||
def domain_return_ok(self, domain: str, request: Request) -> bool: ...
|
||||
def path_return_ok(self, path: str, request: Request) -> bool: ...
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
from typing import Generic, Dict, List, Mapping, MutableMapping, Optional, TypeVar, Union
|
||||
|
||||
_DataType = Union[str, Mapping[str, Union[str, 'Morsel']]]
|
||||
_DataType = Union[str, Mapping[str, Union[str, Morsel]]]
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class CookieError(Exception): ...
|
||||
|
||||
@@ -46,7 +46,7 @@ if sys.version_info >= (3, 5):
|
||||
@classmethod
|
||||
def factory(
|
||||
cls, loader: importlib.abc.Loader
|
||||
) -> Callable[..., 'LazyLoader']: ...
|
||||
) -> Callable[..., LazyLoader]: ...
|
||||
def create_module(
|
||||
self, spec: importlib.machinery.ModuleSpec
|
||||
) -> Optional[types.ModuleType]: ...
|
||||
|
||||
@@ -100,34 +100,34 @@ def indentsize(line: str) -> int: ...
|
||||
#
|
||||
def signature(callable: Callable[..., Any],
|
||||
*,
|
||||
follow_wrapped: bool = ...) -> 'Signature': ...
|
||||
follow_wrapped: bool = ...) -> Signature: ...
|
||||
|
||||
class Signature:
|
||||
def __init__(self,
|
||||
parameters: Optional[Sequence['Parameter']] = ...,
|
||||
parameters: Optional[Sequence[Parameter]] = ...,
|
||||
*,
|
||||
return_annotation: Any = ...) -> None: ...
|
||||
# TODO: can we be more specific here?
|
||||
empty: object = ...
|
||||
|
||||
parameters: Mapping[str, 'Parameter']
|
||||
parameters: Mapping[str, Parameter]
|
||||
|
||||
# TODO: can we be more specific here?
|
||||
return_annotation: Any
|
||||
|
||||
def bind(self, *args: Any, **kwargs: Any) -> 'BoundArguments': ...
|
||||
def bind_partial(self, *args: Any, **kwargs: Any) -> 'BoundArguments': ...
|
||||
def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ...
|
||||
def bind_partial(self, *args: Any, **kwargs: Any) -> BoundArguments: ...
|
||||
def replace(self,
|
||||
*,
|
||||
parameters: Optional[Sequence['Parameter']] = ...,
|
||||
return_annotation: Any = ...) -> 'Signature': ...
|
||||
parameters: Optional[Sequence[Parameter]] = ...,
|
||||
return_annotation: Any = ...) -> Signature: ...
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
@classmethod
|
||||
def from_callable(cls,
|
||||
obj: Callable[..., Any],
|
||||
*,
|
||||
follow_wrapped: bool = ...) -> 'Signature': ...
|
||||
follow_wrapped: bool = ...) -> Signature: ...
|
||||
|
||||
# The name is the same as the enum's name in CPython
|
||||
class _ParameterKind: ...
|
||||
@@ -156,7 +156,7 @@ class Parameter:
|
||||
name: Optional[str] = ...,
|
||||
kind: Optional[_ParameterKind] = ...,
|
||||
default: Any = ...,
|
||||
annotation: Any = ...) -> 'Parameter': ...
|
||||
annotation: Any = ...) -> Parameter: ...
|
||||
|
||||
class BoundArguments:
|
||||
arguments: MutableMapping[str, Any]
|
||||
@@ -174,7 +174,7 @@ class BoundArguments:
|
||||
|
||||
# TODO: The actual return type should be List[_ClassTreeItem] but mypy doesn't
|
||||
# seem to be supporting this at the moment:
|
||||
# _ClassTreeItem = Union[List['_ClassTreeItem'], Tuple[type, Tuple[type, ...]]]
|
||||
# _ClassTreeItem = Union[List[_ClassTreeItem], Tuple[type, Tuple[type, ...]]]
|
||||
def getclasstree(classes: List[type], unique: bool = ...) -> Any: ...
|
||||
|
||||
ArgSpec = NamedTuple('ArgSpec', [('args', List[str]),
|
||||
|
||||
@@ -85,7 +85,7 @@ class BytesIO(BinaryIO):
|
||||
# copied from IOBase
|
||||
def __iter__(self) -> Iterator[bytes]: ...
|
||||
def __next__(self) -> bytes: ...
|
||||
def __enter__(self) -> 'BytesIO': ...
|
||||
def __enter__(self) -> BytesIO: ...
|
||||
def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ...,
|
||||
traceback: Optional[TracebackType] = ...) -> bool: ...
|
||||
def close(self) -> None: ...
|
||||
@@ -186,7 +186,7 @@ class TextIOWrapper(TextIO):
|
||||
newlines = ... # type: Union[str, Tuple[str, ...], None]
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def __next__(self) -> str: ...
|
||||
def __enter__(self) -> 'TextIO': ...
|
||||
def __enter__(self) -> TextIO: ...
|
||||
def detach(self) -> IOBase: ...
|
||||
def write(self, s: str) -> int: ...
|
||||
def readline(self, size: int = ...) -> str: ...
|
||||
@@ -202,7 +202,7 @@ class StringIO(TextIOWrapper):
|
||||
# as a read-only property on IO[].
|
||||
name: Any
|
||||
def getvalue(self) -> str: ...
|
||||
def __enter__(self) -> 'StringIO': ...
|
||||
def __enter__(self) -> StringIO: ...
|
||||
|
||||
class IncrementalNewlineDecoder(codecs.IncrementalDecoder):
|
||||
def decode(self, input: bytes, final: bool = ...) -> str: ...
|
||||
|
||||
@@ -7,7 +7,7 @@ import os
|
||||
class Template:
|
||||
def __init__(self) -> None: ...
|
||||
def reset(self) -> None: ...
|
||||
def clone(self) -> 'Template': ...
|
||||
def clone(self) -> Template: ...
|
||||
def debug(self, flag: bool) -> None: ...
|
||||
def append(self, cmd: str, kind: str) -> None: ...
|
||||
def prepend(self, cmd: str, kind: str) -> None: ...
|
||||
|
||||
@@ -35,7 +35,7 @@ class BaseServer:
|
||||
def verify_request(self, request: bytes,
|
||||
client_address: Tuple[str, int]) -> bool: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
def __enter__(self) -> 'BaseServer': ...
|
||||
def __enter__(self) -> BaseServer: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[types.TracebackType]) -> bool: ...
|
||||
|
||||
@@ -270,7 +270,7 @@ class Popen:
|
||||
def send_signal(self, signal: int) -> None: ...
|
||||
def terminate(self) -> None: ...
|
||||
def kill(self) -> None: ...
|
||||
def __enter__(self) -> 'Popen': ...
|
||||
def __enter__(self) -> Popen: ...
|
||||
def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> bool: ...
|
||||
|
||||
# The result really is always a str.
|
||||
|
||||
@@ -33,7 +33,7 @@ class FunctionType:
|
||||
__annotations__ = ... # type: Dict[str, Any]
|
||||
__kwdefaults__ = ... # type: Dict[str, Any]
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __get__(self, obj: Optional[object], type: Optional[type]) -> 'MethodType': ...
|
||||
def __get__(self, obj: Optional[object], type: Optional[type]) -> MethodType: ...
|
||||
LambdaType = FunctionType
|
||||
|
||||
class CodeType:
|
||||
@@ -89,14 +89,14 @@ class GeneratorType:
|
||||
gi_frame = ... # type: FrameType
|
||||
gi_running = ... # type: bool
|
||||
gi_yieldfrom = ... # type: Optional[GeneratorType]
|
||||
def __iter__(self) -> 'GeneratorType': ...
|
||||
def __iter__(self) -> GeneratorType: ...
|
||||
def __next__(self) -> Any: ...
|
||||
def close(self) -> None: ...
|
||||
def send(self, arg: Any) -> Any: ...
|
||||
@overload
|
||||
def throw(self, val: BaseException) -> Any: ...
|
||||
@overload
|
||||
def throw(self, typ: type, val: BaseException = ..., tb: 'TracebackType' = ...) -> Any: ...
|
||||
def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
class AsyncGeneratorType(Generic[_T_co, _T_contra]):
|
||||
@@ -123,7 +123,7 @@ class CoroutineType:
|
||||
@overload
|
||||
def throw(self, val: BaseException) -> Any: ...
|
||||
@overload
|
||||
def throw(self, typ: type, val: BaseException = ..., tb: 'TracebackType' = ...) -> Any: ...
|
||||
def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ...
|
||||
|
||||
class _StaticFunctionType:
|
||||
"""Fictional type to correct the type of MethodType.__func__.
|
||||
@@ -138,7 +138,7 @@ class _StaticFunctionType:
|
||||
similar to wrapping a function in staticmethod() at runtime to prevent it
|
||||
being bound as a method.
|
||||
"""
|
||||
def __get__(self, obj: Optional[object], type: Optional[type]) -> 'FunctionType': ...
|
||||
def __get__(self, obj: Optional[object], type: Optional[type]) -> FunctionType: ...
|
||||
|
||||
class MethodType:
|
||||
__func__ = ... # type: _StaticFunctionType
|
||||
|
||||
@@ -474,7 +474,7 @@ class Match(Generic[AnyStr]):
|
||||
|
||||
# The regular expression object whose match() or search() method produced
|
||||
# this match instance.
|
||||
re = ... # type: 'Pattern[AnyStr]'
|
||||
re = ... # type: Pattern[AnyStr]
|
||||
|
||||
def expand(self, template: AnyStr) -> AnyStr: ...
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ class _ResultMixinBase(Generic[AnyStr]):
|
||||
def geturl(self) -> AnyStr: ...
|
||||
|
||||
class _ResultMixinStr(_ResultMixinBase[str]):
|
||||
def encode(self, encoding: str = ..., errors: str = ...) -> '_ResultMixinBytes': ...
|
||||
def encode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinBytes: ...
|
||||
|
||||
|
||||
class _ResultMixinBytes(_ResultMixinBase[str]):
|
||||
def decode(self, encoding: str = ..., errors: str = ...) -> '_ResultMixinStr': ...
|
||||
def decode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinStr: ...
|
||||
|
||||
|
||||
class _NetlocResultMixinBase(Generic[AnyStr]):
|
||||
|
||||
@@ -17,7 +17,7 @@ _UrlopenRet = Union[HTTPResponse, addinfourl]
|
||||
|
||||
|
||||
def urlopen(
|
||||
url: Union[str, 'Request'], data: Optional[bytes] = ...,
|
||||
url: Union[str, Request], data: Optional[bytes] = ...,
|
||||
timeout: float = ..., *, cafile: Optional[str] = ...,
|
||||
capath: Optional[str] = ..., cadefault: bool = ...,
|
||||
context: Optional[ssl.SSLContext] = ...
|
||||
|
||||
2
third_party/2/pymssql.pyi
vendored
2
third_party/2/pymssql.pyi
vendored
@@ -11,7 +11,7 @@ class Connection(object):
|
||||
def autocommit(self, status: bool) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def commit(self) -> None: ...
|
||||
def cursor(self) -> 'Cursor': ...
|
||||
def cursor(self) -> Cursor: ...
|
||||
def rollback(self) -> None: ...
|
||||
|
||||
class Cursor(object):
|
||||
|
||||
4
third_party/2and3/click/_termui_impl.pyi
vendored
4
third_party/2and3/click/_termui_impl.pyi
vendored
@@ -5,8 +5,8 @@ _T = TypeVar("_T")
|
||||
class ProgressBar(object, Generic[_T]):
|
||||
def update(self, n_steps: int) -> None: ...
|
||||
def finish(self) -> None: ...
|
||||
def __enter__(self) -> "ProgressBar[_T]": ...
|
||||
def __enter__(self) -> ProgressBar[_T]: ...
|
||||
def __exit__(self, exc_type, exc_value, tb) -> None: ...
|
||||
def __iter__(self) -> "ProgressBar[_T]": ...
|
||||
def __iter__(self) -> ProgressBar[_T]: ...
|
||||
def next(self) -> _T: ...
|
||||
def __next__(self) -> _T: ...
|
||||
|
||||
42
third_party/2and3/click/core.pyi
vendored
42
third_party/2and3/click/core.pyi
vendored
@@ -19,9 +19,9 @@ from click.formatting import HelpFormatter
|
||||
from click.parser import OptionParser
|
||||
|
||||
def invoke_param_callback(
|
||||
callback: Callable[['Context', 'Parameter', Optional[str]], Any],
|
||||
ctx: 'Context',
|
||||
param: 'Parameter',
|
||||
callback: Callable[[Context, Parameter, Optional[str]], Any],
|
||||
ctx: Context,
|
||||
param: Parameter,
|
||||
value: Optional[str]
|
||||
) -> Any:
|
||||
...
|
||||
@@ -29,21 +29,21 @@ def invoke_param_callback(
|
||||
|
||||
@contextmanager
|
||||
def augment_usage_errors(
|
||||
ctx: 'Context', param: Optional['Parameter'] = ...
|
||||
ctx: Context, param: Optional[Parameter] = ...
|
||||
) -> Generator[None, None, None]:
|
||||
...
|
||||
|
||||
|
||||
def iter_params_for_processing(
|
||||
invocation_order: Sequence['Parameter'],
|
||||
declaration_order: Iterable['Parameter'],
|
||||
) -> Iterable['Parameter']:
|
||||
invocation_order: Sequence[Parameter],
|
||||
declaration_order: Iterable[Parameter],
|
||||
) -> Iterable[Parameter]:
|
||||
...
|
||||
|
||||
|
||||
class Context:
|
||||
parent: Optional['Context']
|
||||
command: 'Command'
|
||||
parent: Optional[Context]
|
||||
command: Command
|
||||
info_name: Optional[str]
|
||||
params: Dict
|
||||
args: List[str]
|
||||
@@ -71,8 +71,8 @@ class Context:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
command: 'Command',
|
||||
parent: Optional['Context'] = ...,
|
||||
command: Command,
|
||||
parent: Optional[Context] = ...,
|
||||
info_name: Optional[str] = ...,
|
||||
obj: Optional[Any] = ...,
|
||||
auto_envvar_prefix: Optional[str] = ...,
|
||||
@@ -90,7 +90,7 @@ class Context:
|
||||
...
|
||||
|
||||
@contextmanager
|
||||
def scope(self, cleanup: bool = ...) -> Generator['Context', None, None]:
|
||||
def scope(self, cleanup: bool = ...) -> Generator[Context, None, None]:
|
||||
...
|
||||
|
||||
def make_formatter(self) -> HelpFormatter:
|
||||
@@ -102,7 +102,7 @@ class Context:
|
||||
def close(self) -> None:
|
||||
...
|
||||
|
||||
def find_root(self) -> 'Context':
|
||||
def find_root(self) -> Context:
|
||||
...
|
||||
|
||||
def find_object(self, object_type: type) -> Any:
|
||||
@@ -130,12 +130,12 @@ class Context:
|
||||
...
|
||||
|
||||
def invoke(
|
||||
self, callback: Union['Command', Callable], *args, **kwargs
|
||||
self, callback: Union[Command, Callable], *args, **kwargs
|
||||
) -> Any:
|
||||
...
|
||||
|
||||
def forward(
|
||||
self, callback: Union['Command', Callable], *args, **kwargs
|
||||
self, callback: Union[Command, Callable], *args, **kwargs
|
||||
) -> Any:
|
||||
...
|
||||
|
||||
@@ -182,7 +182,7 @@ class BaseCommand:
|
||||
|
||||
class Command(BaseCommand):
|
||||
callback: Optional[Callable]
|
||||
params: List['Parameter']
|
||||
params: List[Parameter]
|
||||
help: Optional[str]
|
||||
epilog: Optional[str]
|
||||
short_help: Optional[str]
|
||||
@@ -194,7 +194,7 @@ class Command(BaseCommand):
|
||||
name: str,
|
||||
context_settings: Optional[Dict] = ...,
|
||||
callback: Optional[Callable] = ...,
|
||||
params: Optional[List['Parameter']] = ...,
|
||||
params: Optional[List[Parameter]] = ...,
|
||||
help: Optional[str] = ...,
|
||||
epilog: Optional[str] = ...,
|
||||
short_help: Optional[str] = ...,
|
||||
@@ -203,7 +203,7 @@ class Command(BaseCommand):
|
||||
) -> None:
|
||||
...
|
||||
|
||||
def get_params(self, ctx: Context) -> List['Parameter']:
|
||||
def get_params(self, ctx: Context) -> List[Parameter]:
|
||||
...
|
||||
|
||||
def format_usage(
|
||||
@@ -219,7 +219,7 @@ class Command(BaseCommand):
|
||||
def get_help_option_names(self, ctx: Context) -> Set[str]:
|
||||
...
|
||||
|
||||
def get_help_option(self, ctx: Context) -> Optional['Option']:
|
||||
def get_help_option(self, ctx: Context) -> Optional[Option]:
|
||||
...
|
||||
|
||||
def make_parser(self, ctx: Context) -> OptionParser:
|
||||
@@ -356,7 +356,7 @@ class Parameter:
|
||||
secondary_opts: List[str]
|
||||
type: _ParamType
|
||||
required: bool
|
||||
callback: Optional[Callable[[Context, 'Parameter', str], Any]]
|
||||
callback: Optional[Callable[[Context, Parameter, str], Any]]
|
||||
nargs: int
|
||||
multiple: bool
|
||||
expose_value: bool
|
||||
@@ -373,7 +373,7 @@ class Parameter:
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
required: bool = ...,
|
||||
default: Optional[Any] = ...,
|
||||
callback: Optional[Callable[[Context, 'Parameter', str], Any]] = ...,
|
||||
callback: Optional[Callable[[Context, Parameter, str], Any]] = ...,
|
||||
nargs: Optional[int] = ...,
|
||||
metavar: Optional[str] = ...,
|
||||
expose_value: bool = ...,
|
||||
|
||||
4
third_party/2and3/click/parser.pyi
vendored
4
third_party/2and3/click/parser.pyi
vendored
@@ -44,7 +44,7 @@ class Option:
|
||||
) -> None:
|
||||
...
|
||||
|
||||
def process(self, value: Any, state: 'ParsingState') -> None:
|
||||
def process(self, value: Any, state: ParsingState) -> None:
|
||||
...
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class Argument:
|
||||
def __init__(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None:
|
||||
...
|
||||
|
||||
def process(self, value: Any, state: 'ParsingState') -> None:
|
||||
def process(self, value: Any, state: ParsingState) -> None:
|
||||
...
|
||||
|
||||
|
||||
|
||||
4
third_party/2and3/click/utils.pyi
vendored
4
third_party/2and3/click/utils.pyi
vendored
@@ -46,7 +46,7 @@ class LazyFile:
|
||||
def close_intelligently(self) -> None:
|
||||
...
|
||||
|
||||
def __enter__(self) -> 'LazyFile':
|
||||
def __enter__(self) -> LazyFile:
|
||||
...
|
||||
|
||||
def __exit__(self, exc_type, exc_value, tb):
|
||||
@@ -62,7 +62,7 @@ class KeepOpenFile:
|
||||
def __init__(self, file: IO) -> None:
|
||||
...
|
||||
|
||||
def __enter__(self) -> 'KeepOpenFile':
|
||||
def __enter__(self) -> KeepOpenFile:
|
||||
...
|
||||
|
||||
def __exit__(self, exc_type, exc_value, tb):
|
||||
|
||||
2
third_party/2and3/dateutil/_common.pyi
vendored
2
third_party/2and3/dateutil/_common.pyi
vendored
@@ -3,7 +3,7 @@ from typing import Optional
|
||||
class weekday(object):
|
||||
def __init__(self, weekday: int, n: Optional[int]=...) -> None: ...
|
||||
|
||||
def __call__(self, n: int) -> 'weekday': ...
|
||||
def __call__(self, n: int) -> weekday: ...
|
||||
|
||||
def __eq__(self, other) -> bool: ...
|
||||
|
||||
|
||||
2
third_party/2and3/requests/sessions.pyi
vendored
2
third_party/2and3/requests/sessions.pyi
vendored
@@ -77,7 +77,7 @@ class Session(SessionRedirectMixin):
|
||||
adapters = ... # type: MutableMapping
|
||||
redirect_cache = ... # type: RecentlyUsedContainer
|
||||
def __init__(self) -> None: ...
|
||||
def __enter__(self) -> 'Session': ...
|
||||
def __enter__(self) -> Session: ...
|
||||
def __exit__(self, *args) -> None: ...
|
||||
def prepare_request(self, request): ...
|
||||
def request(self, method: str, url: str,
|
||||
|
||||
2
third_party/2and3/werkzeug/wrappers.pyi
vendored
2
third_party/2and3/werkzeug/wrappers.pyi
vendored
@@ -27,7 +27,7 @@ class BaseRequest:
|
||||
@property
|
||||
def url_charset(self) -> str: ...
|
||||
@classmethod
|
||||
def from_values(cls, *args, **kwargs) -> 'BaseRequest': ...
|
||||
def from_values(cls, *args, **kwargs) -> BaseRequest: ...
|
||||
@classmethod
|
||||
def application(cls, f): ...
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user