mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Added stubs for deprecated package (#4423)
Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
1
third_party/2and3/deprecated/__init__.pyi
vendored
Normal file
1
third_party/2and3/deprecated/__init__.pyi
vendored
Normal file
@@ -0,0 +1 @@
|
||||
from .classic import deprecated as deprecated
|
||||
18
third_party/2and3/deprecated/classic.pyi
vendored
Normal file
18
third_party/2and3/deprecated/classic.pyi
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
from typing import Any, Callable, Optional, Type, TypeVar
|
||||
|
||||
_T = TypeVar("_T", bound=Callable[..., Any])
|
||||
|
||||
class ClassicAdapter:
|
||||
reason: str
|
||||
version: str
|
||||
action: Optional[str]
|
||||
category: Type[DeprecationWarning]
|
||||
def __init__(
|
||||
self, reason: str = ..., version: str = ..., action: Optional[str] = ..., category: Type[DeprecationWarning] = ...,
|
||||
) -> None: ...
|
||||
def get_deprecated_msg(self, wrapped: Callable[..., Any], instance: object) -> str: ...
|
||||
def __call__(self, wrapped: _T) -> Callable[[_T], _T]: ...
|
||||
|
||||
def deprecated(
|
||||
*, reason: str = ..., version: str = ..., action: Optional[str] = ..., category: Optional[Type[DeprecationWarning]] = ...,
|
||||
) -> Callable[[_T], _T]: ...
|
||||
28
third_party/2and3/deprecated/sphinx.pyi
vendored
Normal file
28
third_party/2and3/deprecated/sphinx.pyi
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
from typing import Any, Callable, Optional, Type, TypeVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .classic import ClassicAdapter
|
||||
|
||||
_T = TypeVar("_T", bound=Callable[..., Any])
|
||||
|
||||
class SphinxAdapter(ClassicAdapter):
|
||||
directive: Literal["versionadded", "versionchanged", "deprecated"]
|
||||
reason: str
|
||||
version: str
|
||||
action: Optional[str]
|
||||
category: Type[DeprecationWarning]
|
||||
def __init__(
|
||||
self,
|
||||
directive: Literal["versionadded", "versionchanged", "deprecated"],
|
||||
reason: str = ...,
|
||||
version: str = ...,
|
||||
action: Optional[str] = ...,
|
||||
category: Type[DeprecationWarning] = ...,
|
||||
) -> None: ...
|
||||
def __call__(self, wrapped: _T) -> Callable[[_T], _T]: ...
|
||||
|
||||
def versionadded(reason: str = ..., version: str = ...) -> Callable[[_T], _T]: ...
|
||||
def versionchanged(reason: str = ..., version: str = ...) -> Callable[[_T], _T]: ...
|
||||
def deprecated(
|
||||
*, reason: str = ..., version: str = ..., action: Optional[str] = ..., category: Optional[Type[DeprecationWarning]] = ...,
|
||||
) -> Callable[[_T], _T]: ...
|
||||
Reference in New Issue
Block a user