MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / PTBDeprecationWarning

Class PTBDeprecationWarning

src/telegram/warnings.py:51–87  ·  view source on GitHub ↗

Custom warning class for deprecations in this library. .. versionchanged:: 20.0 Renamed TelegramDeprecationWarning to PTBDeprecationWarning. Args: version (:obj:`str`): The version in which the feature was deprecated. .. versionadded:: 21.2 message

Source from the content-addressed store, hash-verified

49# DeprecationWarning. We also subclass from PTBUserWarning so users can easily 'switch off'
50# warnings
51class PTBDeprecationWarning(PTBUserWarning, DeprecationWarning):
52 """
53 Custom warning class for deprecations in this library.
54
55 .. versionchanged:: 20.0
56 Renamed TelegramDeprecationWarning to PTBDeprecationWarning.
57
58 Args:
59 version (:obj:`str`): The version in which the feature was deprecated.
60
61 .. versionadded:: 21.2
62 message (:obj:`str`): The message to display.
63
64 .. versionadded:: 21.2
65
66 Attributes:
67 version (:obj:`str`): The version in which the feature was deprecated.
68
69 .. versionadded:: 21.2
70 message (:obj:`str`): The message to display.
71
72 .. versionadded:: 21.2
73 """
74
75 __slots__ = ("message", "version")
76
77 def __init__(self, version: str, message: str) -> None:
78 self.version: str = version
79 self.message: str = message
80
81 def __str__(self) -> str:
82 """Returns a string representation of the warning, using :attr:`message` and
83 :attr:`version`.
84
85 .. versionadded:: 21.2
86 """
87 return f"Deprecated since version {self.version}: {self.message}"

Callers 15

effective_attachmentMethod · 0.90
de_jsonMethod · 0.90
__init__Method · 0.90
correct_option_idMethod · 0.90
send_pollMethod · 0.90
get_timedelta_valueFunction · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by 1

test_warnMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…