mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-20 10:02:51 +08:00
@@ -3,11 +3,13 @@ import typing
|
||||
from typing import (
|
||||
AbstractSet,
|
||||
Any,
|
||||
AsyncGenerator as AsyncGenerator,
|
||||
AsyncIterable as AsyncIterable,
|
||||
AsyncIterator as AsyncIterator,
|
||||
Awaitable as Awaitable,
|
||||
ByteString as ByteString,
|
||||
Callable as Callable,
|
||||
Collection as Collection,
|
||||
Container as Container,
|
||||
Coroutine as Coroutine,
|
||||
Dict,
|
||||
@@ -38,9 +40,6 @@ from typing import (
|
||||
|
||||
Set = AbstractSet
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from typing import AsyncGenerator as AsyncGenerator, Collection as Collection
|
||||
|
||||
_S = TypeVar("_S")
|
||||
_T = TypeVar("_T")
|
||||
_KT = TypeVar("_KT")
|
||||
@@ -57,7 +56,7 @@ if sys.version_info >= (3, 7):
|
||||
defaults: Optional[Iterable[Any]] = ...,
|
||||
) -> Type[Tuple[Any, ...]]: ...
|
||||
|
||||
elif sys.version_info >= (3, 6):
|
||||
else:
|
||||
def namedtuple(
|
||||
typename: str,
|
||||
field_names: Union[str, Iterable[str]],
|
||||
@@ -67,11 +66,6 @@ elif sys.version_info >= (3, 6):
|
||||
module: Optional[str] = ...,
|
||||
) -> Type[Tuple[Any, ...]]: ...
|
||||
|
||||
else:
|
||||
def namedtuple(
|
||||
typename: str, field_names: Union[str, Iterable[str]], verbose: bool = ..., rename: bool = ...
|
||||
) -> Type[Tuple[Any, ...]]: ...
|
||||
|
||||
class UserDict(MutableMapping[_KT, _VT]):
|
||||
data: Dict[_KT, _VT]
|
||||
def __init__(self, __dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ...
|
||||
@@ -194,9 +188,6 @@ class UserString(Sequence[str]):
|
||||
def upper(self: _UserStringT) -> _UserStringT: ...
|
||||
def zfill(self: _UserStringT, width: int) -> _UserStringT: ...
|
||||
|
||||
# Technically, deque only derives from MutableSequence in 3.5 (before then, the insert and index
|
||||
# methods did not exist).
|
||||
# But in practice it's not worth losing sleep over.
|
||||
class deque(MutableSequence[_T], Generic[_T]):
|
||||
@property
|
||||
def maxlen(self) -> Optional[int]: ...
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import sys
|
||||
|
||||
from . import (
|
||||
AsyncGenerator as AsyncGenerator,
|
||||
AsyncIterable as AsyncIterable,
|
||||
AsyncIterator as AsyncIterator,
|
||||
Awaitable as Awaitable,
|
||||
ByteString as ByteString,
|
||||
Callable as Callable,
|
||||
Collection as Collection,
|
||||
Container as Container,
|
||||
Coroutine as Coroutine,
|
||||
Generator as Generator,
|
||||
@@ -19,11 +19,9 @@ from . import (
|
||||
MutableMapping as MutableMapping,
|
||||
MutableSequence as MutableSequence,
|
||||
MutableSet as MutableSet,
|
||||
Reversible as Reversible,
|
||||
Sequence as Sequence,
|
||||
Set as Set,
|
||||
Sized as Sized,
|
||||
ValuesView as ValuesView,
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from . import AsyncGenerator as AsyncGenerator, Collection as Collection, Reversible as Reversible
|
||||
|
||||
Reference in New Issue
Block a user