Skip to content

Commit

Permalink
sync docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Nov 29, 2023
1 parent b94255d commit e7a361b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Lib/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,16 @@ def g(x: int) -> int: ...
@overload
def g(x: str) -> int: ...
The warning specified by ``category`` will be emitted on use
of deprecated objects. For functions, that happens on calls;
The warning specified by *category* will be emitted at runtime
on use of deprecated objects. For functions, that happens on calls;
for classes, on instantiation and on creation of subclasses.
If the ``category`` is ``None``,
no warning is emitted. The ``stacklevel`` determines where the
If the *category* is ``None``, no warning is emitted at runtime.
The *stacklevel* determines where the
warning is emitted. If it is ``1`` (the default), the warning
is emitted at the direct caller of the deprecated object; if it
is higher, it is emitted further up the stack.
Static type checker behavior is not affected by the *category*
and *stacklevel* arguments.
The deprecation message passed to the decorator is saved in the
``__deprecated__`` attribute on the decorated object.
Expand Down

0 comments on commit e7a361b

Please sign in to comment.