Drop support for Python 3.5 (#4675)

Python 3.5 EOL was on 2020-09-30.
This commit is contained in:
Sebastian Rittau
2020-11-02 16:18:20 +01:00
committed by GitHub
parent 57b86e0e71
commit d2a7889fe0
64 changed files with 546 additions and 1174 deletions

View File

@@ -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]: ...

View File

@@ -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