mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 04:52:23 +08:00
@@ -9,8 +9,12 @@ from typing import (
|
||||
from . import abc
|
||||
|
||||
from typing import (
|
||||
AsyncIterable as AsyncIterable,
|
||||
AsyncIterator as AsyncIterator,
|
||||
Awaitable as Awaitable,
|
||||
Callable as Callable,
|
||||
Container as Container,
|
||||
Coroutine as Coroutine,
|
||||
Hashable as Hashable,
|
||||
Iterable as Iterable,
|
||||
Iterator as Iterator,
|
||||
@@ -34,13 +38,6 @@ if sys.version_info >= (3, 6):
|
||||
Collection as Collection,
|
||||
AsyncGenerator as AsyncGenerator,
|
||||
)
|
||||
if sys.version_info >= (3, 5):
|
||||
from typing import (
|
||||
Awaitable as Awaitable,
|
||||
Coroutine as Coroutine,
|
||||
AsyncIterable as AsyncIterable,
|
||||
AsyncIterator as AsyncIterator,
|
||||
)
|
||||
|
||||
_S = TypeVar('_S')
|
||||
_T = TypeVar('_T')
|
||||
@@ -118,8 +115,7 @@ class UserString(Sequence[str]):
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __complex__(self) -> complex: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def __getnewargs__(self) -> Tuple[str]: ...
|
||||
def __getnewargs__(self) -> Tuple[str]: ...
|
||||
def __lt__(self, string: Union[str, UserString]) -> bool: ...
|
||||
def __le__(self, string: Union[str, UserString]) -> bool: ...
|
||||
def __gt__(self, string: Union[str, UserString]) -> bool: ...
|
||||
@@ -132,8 +128,7 @@ class UserString(Sequence[str]):
|
||||
def __mul__(self: _UserStringT, n: int) -> _UserStringT: ...
|
||||
def __mod__(self: _UserStringT, args: Any) -> _UserStringT: ...
|
||||
def capitalize(self: _UserStringT) -> _UserStringT: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def casefold(self: _UserStringT) -> _UserStringT: ...
|
||||
def casefold(self: _UserStringT) -> _UserStringT: ...
|
||||
def center(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ...
|
||||
def count(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ...
|
||||
def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ...
|
||||
@@ -141,8 +136,7 @@ class UserString(Sequence[str]):
|
||||
def expandtabs(self: _UserStringT, tabsize: int = ...) -> _UserStringT: ...
|
||||
def find(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ...
|
||||
def format(self, *args: Any, **kwds: Any) -> str: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def format_map(self, mapping: Mapping[str, Any]) -> str: ...
|
||||
def format_map(self, mapping: Mapping[str, Any]) -> str: ...
|
||||
def index(self, sub: str, start: int = ..., end: int = ...) -> int: ...
|
||||
def isalpha(self) -> bool: ...
|
||||
def isalnum(self) -> bool: ...
|
||||
@@ -151,8 +145,7 @@ class UserString(Sequence[str]):
|
||||
def isidentifier(self) -> bool: ...
|
||||
def islower(self) -> bool: ...
|
||||
def isnumeric(self) -> bool: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def isprintable(self) -> bool: ...
|
||||
def isprintable(self) -> bool: ...
|
||||
def isspace(self) -> bool: ...
|
||||
def istitle(self) -> bool: ...
|
||||
def isupper(self) -> bool: ...
|
||||
@@ -160,13 +153,12 @@ class UserString(Sequence[str]):
|
||||
def ljust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ...
|
||||
def lower(self: _UserStringT) -> _UserStringT: ...
|
||||
def lstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
@staticmethod
|
||||
@overload
|
||||
def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ...
|
||||
@staticmethod
|
||||
@overload
|
||||
def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ...
|
||||
@staticmethod
|
||||
@overload
|
||||
def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ...
|
||||
@staticmethod
|
||||
@overload
|
||||
def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ...
|
||||
def partition(self, sep: str) -> Tuple[str, str, str]: ...
|
||||
def replace(self: _UserStringT, old: Union[str, UserString], new: Union[str, UserString], maxsplit: int = ...) -> _UserStringT: ...
|
||||
def rfind(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ...
|
||||
@@ -197,8 +189,7 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
def append(self, x: _T) -> None: ...
|
||||
def appendleft(self, x: _T) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def copy(self) -> deque[_T]: ...
|
||||
def copy(self) -> deque[_T]: ...
|
||||
def count(self, x: _T) -> int: ...
|
||||
def extend(self, iterable: Iterable[_T]) -> None: ...
|
||||
def extendleft(self, iterable: Iterable[_T]) -> None: ...
|
||||
@@ -238,10 +229,9 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
|
||||
def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ...
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
def __add__(self, other: deque[_T]) -> deque[_T]: ...
|
||||
def __mul__(self, other: int) -> deque[_T]: ...
|
||||
def __imul__(self, other: int) -> None: ...
|
||||
def __add__(self, other: deque[_T]) -> deque[_T]: ...
|
||||
def __mul__(self, other: int) -> deque[_T]: ...
|
||||
def __imul__(self, other: int) -> None: ...
|
||||
|
||||
_CounterT = TypeVar('_CounterT', bound=Counter)
|
||||
|
||||
|
||||
@@ -4,7 +4,13 @@
|
||||
import sys
|
||||
|
||||
from . import (
|
||||
AsyncIterable as AsyncIterable,
|
||||
AsyncIterator as AsyncIterator,
|
||||
Awaitable as Awaitable,
|
||||
ByteString as ByteString,
|
||||
Container as Container,
|
||||
Coroutine as Coroutine,
|
||||
Generator as Generator,
|
||||
Hashable as Hashable,
|
||||
Iterable as Iterable,
|
||||
Iterator as Iterator,
|
||||
@@ -22,16 +28,6 @@ from . import (
|
||||
ValuesView as ValuesView,
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
from . import (
|
||||
Generator as Generator,
|
||||
ByteString as ByteString,
|
||||
Awaitable as Awaitable,
|
||||
Coroutine as Coroutine,
|
||||
AsyncIterable as AsyncIterable,
|
||||
AsyncIterator as AsyncIterator,
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from . import (
|
||||
Collection as Collection,
|
||||
|
||||
Reference in New Issue
Block a user