-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Expand file tree
/
Copy pathdeprecation.pyi
More file actions
75 lines (64 loc) · 2.17 KB
/
deprecation.pyi
File metadata and controls
75 lines (64 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from collections.abc import Callable
import contextlib
from typing import Any, Literal, ParamSpec, TypedDict, TypeVar, overload
from typing_extensions import (
Unpack, # < Py 3.11
)
_P = ParamSpec("_P")
_R = TypeVar("_R")
_T = TypeVar("_T")
class MatplotlibDeprecationWarning(DeprecationWarning): ...
class DeprecationKwargs(TypedDict, total=False):
message: str
alternative: str
pending: bool
obj_type: str
addendum: str
removal: str | Literal[False]
class NamedDeprecationKwargs(DeprecationKwargs, total=False):
name: str
def warn_deprecated(since: str, **kwargs: Unpack[NamedDeprecationKwargs]) -> None: ...
def deprecated(
since: str, **kwargs: Unpack[NamedDeprecationKwargs]
) -> Callable[[_T], _T]: ...
class deprecate_privatize_attribute(Any):
def __init__(self, since: str, **kwargs: Unpack[NamedDeprecationKwargs]): ...
def __set_name__(self, owner: type[object], name: str) -> None: ...
DECORATORS: dict[Callable, Callable] = ...
@overload
def rename_parameter(
since: str, old: str, new: str, func: None = ...
) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
@overload
def rename_parameter(
since: str, old: str, new: str, func: Callable[_P, _R]
) -> Callable[_P, _R]: ...
class _deprecated_parameter_class: ...
_deprecated_parameter: _deprecated_parameter_class
@overload
def delete_parameter(
since: str, name: str, func: None = ..., **kwargs: Unpack[DeprecationKwargs]
) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
@overload
def delete_parameter(
since: str, name: str, func: Callable[_P, _R], **kwargs: Unpack[DeprecationKwargs]
) -> Callable[_P, _R]: ...
@overload
def make_keyword_only(
since: str, name: str, func: None = ...
) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
@overload
def make_keyword_only(
since: str, name: str, func: Callable[_P, _R]
) -> Callable[_P, _R]: ...
def deprecate_method_override(
method: Callable[_P, _R],
obj: object | type,
*,
allow_empty: bool = ...,
since: str,
**kwargs: Unpack[NamedDeprecationKwargs]
) -> Callable[_P, _R]: ...
def suppress_matplotlib_deprecation_warning() -> (
contextlib.AbstractContextManager[None]
): ...