Remove Python 3.7 branches (#11238)

This commit is contained in:
Sebastian Rittau
2024-01-05 11:39:39 +01:00
committed by GitHub
parent 4e62577002
commit 23604858a6
122 changed files with 1952 additions and 3800 deletions

View File

@@ -45,11 +45,9 @@ __all__ = [
"MethodWrapperType",
"WrapperDescriptorType",
"resolve_bases",
"CellType",
]
if sys.version_info >= (3, 8):
__all__ += ["CellType"]
if sys.version_info >= (3, 9):
__all__ += ["GenericAlias"]
@@ -68,9 +66,7 @@ _VT_co = TypeVar("_VT_co", covariant=True)
@final
class _Cell:
if sys.version_info >= (3, 8):
def __new__(cls, __contents: object = ...) -> Self: ...
def __new__(cls, __contents: object = ...) -> Self: ...
def __eq__(self, __value: object) -> bool: ...
__hash__: ClassVar[None] # type: ignore[assignment]
cell_contents: Any
@@ -118,10 +114,8 @@ class CodeType:
def __hash__(self) -> int: ...
@property
def co_argcount(self) -> int: ...
if sys.version_info >= (3, 8):
@property
def co_posonlyargcount(self) -> int: ...
@property
def co_posonlyargcount(self) -> int: ...
@property
def co_kwonlyargcount(self) -> int: ...
@property
@@ -203,30 +197,11 @@ class CodeType:
__freevars: tuple[str, ...] = ...,
__cellvars: tuple[str, ...] = ...,
) -> Self: ...
elif sys.version_info >= (3, 8):
def __new__(
cls,
__argcount: int,
__posonlyargcount: int,
__kwonlyargcount: int,
__nlocals: int,
__stacksize: int,
__flags: int,
__codestring: bytes,
__constants: tuple[object, ...],
__names: tuple[str, ...],
__varnames: tuple[str, ...],
__filename: str,
__name: str,
__firstlineno: int,
__lnotab: bytes,
__freevars: tuple[str, ...] = ...,
__cellvars: tuple[str, ...] = ...,
) -> Self: ...
else:
def __new__(
cls,
__argcount: int,
__posonlyargcount: int,
__kwonlyargcount: int,
__nlocals: int,
__stacksize: int,
@@ -286,7 +261,7 @@ class CodeType:
co_name: str = ...,
co_linetable: bytes = ...,
) -> CodeType: ...
elif sys.version_info >= (3, 8):
else:
def replace(
self,
*,
@@ -515,7 +490,7 @@ class ClassMethodDescriptorType:
class TracebackType:
def __new__(cls, tb_next: TracebackType | None, tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> Self: ...
tb_next: TracebackType | None
# the rest are read-only even in 3.7
# the rest are read-only
@property
def tb_frame(self) -> FrameType: ...
@property
@@ -598,8 +573,7 @@ def coroutine(func: Callable[_P, Generator[Any, Any, _R]]) -> Callable[_P, Await
@overload
def coroutine(func: _Fn) -> _Fn: ...
if sys.version_info >= (3, 8):
CellType = _Cell
CellType = _Cell
if sys.version_info >= (3, 9):
class GenericAlias: