mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Add @deprecated to abstractclass/staticmethod/property (#11488)
This commit is contained in:
@@ -3,7 +3,7 @@ import sys
|
||||
from _typeshed import SupportsWrite
|
||||
from collections.abc import Callable
|
||||
from typing import Any, Literal, TypeVar
|
||||
from typing_extensions import Concatenate, ParamSpec
|
||||
from typing_extensions import Concatenate, ParamSpec, deprecated
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_R_co = TypeVar("_R_co", covariant=True)
|
||||
@@ -28,15 +28,17 @@ class ABCMeta(type):
|
||||
def register(cls: ABCMeta, subclass: type[_T]) -> type[_T]: ...
|
||||
|
||||
def abstractmethod(funcobj: _FuncT) -> _FuncT: ...
|
||||
|
||||
@deprecated("Deprecated, use 'classmethod' with 'abstractmethod' instead")
|
||||
class abstractclassmethod(classmethod[_T, _P, _R_co]):
|
||||
__isabstractmethod__: Literal[True]
|
||||
def __init__(self, callable: Callable[Concatenate[type[_T], _P], _R_co]) -> None: ...
|
||||
|
||||
@deprecated("Deprecated, use 'staticmethod' with 'abstractmethod' instead")
|
||||
class abstractstaticmethod(staticmethod[_P, _R_co]):
|
||||
__isabstractmethod__: Literal[True]
|
||||
def __init__(self, callable: Callable[_P, _R_co]) -> None: ...
|
||||
|
||||
@deprecated("Deprecated, use 'property' with 'abstractmethod' instead")
|
||||
class abstractproperty(property):
|
||||
__isabstractmethod__: Literal[True]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user