mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Remove Python 3.7 branches (#11238)
This commit is contained in:
@@ -20,11 +20,10 @@ __all__ = [
|
||||
"partial",
|
||||
"partialmethod",
|
||||
"singledispatch",
|
||||
"cached_property",
|
||||
"singledispatchmethod",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ += ["cached_property", "singledispatchmethod"]
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
__all__ += ["cache"]
|
||||
|
||||
@@ -63,14 +62,10 @@ class _lru_cache_wrapper(Generic[_T]):
|
||||
def __copy__(self) -> _lru_cache_wrapper[_T]: ...
|
||||
def __deepcopy__(self, __memo: Any) -> _lru_cache_wrapper[_T]: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@overload
|
||||
def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
|
||||
@overload
|
||||
def lru_cache(maxsize: Callable[..., _T], typed: bool = False) -> _lru_cache_wrapper[_T]: ...
|
||||
|
||||
else:
|
||||
def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
|
||||
@overload
|
||||
def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
|
||||
@overload
|
||||
def lru_cache(maxsize: Callable[..., _T], typed: bool = False) -> _lru_cache_wrapper[_T]: ...
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
WRAPPER_ASSIGNMENTS: tuple[
|
||||
@@ -149,11 +144,7 @@ class partialmethod(Generic[_T]):
|
||||
def __init__(self, __func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __func: _Descriptor, *args: Any, **keywords: Any) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __get__(self, obj: Any, cls: type[Any] | None = None) -> Callable[..., _T]: ...
|
||||
else:
|
||||
def __get__(self, obj: Any, cls: type[Any] | None) -> Callable[..., _T]: ...
|
||||
|
||||
def __get__(self, obj: Any, cls: type[Any] | None = None) -> Callable[..., _T]: ...
|
||||
@property
|
||||
def __isabstractmethod__(self) -> bool: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -178,34 +169,33 @@ class _SingleDispatchCallable(Generic[_T]):
|
||||
|
||||
def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
class singledispatchmethod(Generic[_T]):
|
||||
dispatcher: _SingleDispatchCallable[_T]
|
||||
func: Callable[..., _T]
|
||||
def __init__(self, func: Callable[..., _T]) -> None: ...
|
||||
@property
|
||||
def __isabstractmethod__(self) -> bool: ...
|
||||
@overload
|
||||
def register(self, cls: type[Any], method: None = None) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
@overload
|
||||
def register(self, cls: Callable[..., _T], method: None = None) -> Callable[..., _T]: ...
|
||||
@overload
|
||||
def register(self, cls: type[Any], method: Callable[..., _T]) -> Callable[..., _T]: ...
|
||||
def __get__(self, obj: _S, cls: type[_S] | None = None) -> Callable[..., _T]: ...
|
||||
class singledispatchmethod(Generic[_T]):
|
||||
dispatcher: _SingleDispatchCallable[_T]
|
||||
func: Callable[..., _T]
|
||||
def __init__(self, func: Callable[..., _T]) -> None: ...
|
||||
@property
|
||||
def __isabstractmethod__(self) -> bool: ...
|
||||
@overload
|
||||
def register(self, cls: type[Any], method: None = None) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
@overload
|
||||
def register(self, cls: Callable[..., _T], method: None = None) -> Callable[..., _T]: ...
|
||||
@overload
|
||||
def register(self, cls: type[Any], method: Callable[..., _T]) -> Callable[..., _T]: ...
|
||||
def __get__(self, obj: _S, cls: type[_S] | None = None) -> Callable[..., _T]: ...
|
||||
|
||||
class cached_property(Generic[_T]):
|
||||
func: Callable[[Any], _T]
|
||||
attrname: str | None
|
||||
def __init__(self, func: Callable[[Any], _T]) -> None: ...
|
||||
@overload
|
||||
def __get__(self, instance: None, owner: type[Any] | None = None) -> Self: ...
|
||||
@overload
|
||||
def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: ...
|
||||
def __set_name__(self, owner: type[Any], name: str) -> None: ...
|
||||
# __set__ is not defined at runtime, but @cached_property is designed to be settable
|
||||
def __set__(self, instance: object, value: _T) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
class cached_property(Generic[_T]):
|
||||
func: Callable[[Any], _T]
|
||||
attrname: str | None
|
||||
def __init__(self, func: Callable[[Any], _T]) -> None: ...
|
||||
@overload
|
||||
def __get__(self, instance: None, owner: type[Any] | None = None) -> Self: ...
|
||||
@overload
|
||||
def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: ...
|
||||
def __set_name__(self, owner: type[Any], name: str) -> None: ...
|
||||
# __set__ is not defined at runtime, but @cached_property is designed to be settable
|
||||
def __set__(self, instance: object, value: _T) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def cache(__user_function: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ...
|
||||
|
||||
Reference in New Issue
Block a user