Helper function used as a shortcut for warning with default values. .. versionadded:: 20.0 Args: message (:obj:`str` | :obj:`PTBUserWarning`): Specify the warnings message to pass to ``warnings.warn()``. .. versionchanged:: 21.2 Now als
(
message: str | PTBUserWarning,
category: type[Warning] = PTBUserWarning,
stacklevel: int = 0,
)
| 32 | |
| 33 | |
| 34 | def warn( |
| 35 | message: str | PTBUserWarning, |
| 36 | category: type[Warning] = PTBUserWarning, |
| 37 | stacklevel: int = 0, |
| 38 | ) -> None: |
| 39 | """ |
| 40 | Helper function used as a shortcut for warning with default values. |
| 41 | |
| 42 | .. versionadded:: 20.0 |
| 43 | |
| 44 | Args: |
| 45 | message (:obj:`str` | :obj:`PTBUserWarning`): Specify the warnings message to pass to |
| 46 | ``warnings.warn()``. |
| 47 | |
| 48 | .. versionchanged:: 21.2 |
| 49 | Now also accepts a :obj:`PTBUserWarning` instance. |
| 50 | |
| 51 | category (:obj:`type[Warning]`, optional): Specify the Warning class to pass to |
| 52 | ``warnings.warn()``. Defaults to :class:`telegram.warnings.PTBUserWarning`. |
| 53 | stacklevel (:obj:`int`, optional): Specify the stacklevel to pass to ``warnings.warn()``. |
| 54 | Pass the same value as you'd pass directly to ``warnings.warn()``. Defaults to ``0``. |
| 55 | """ |
| 56 | warnings.warn(message, category=category, stacklevel=stacklevel + 1) |
no outgoing calls
searching dependent graphs…