Skip to content

Commit 9387fdf

Browse files
committed
update news and docs
Signed-off-by: Manjusaka <me@manjusaka.me>
1 parent 2d606cf commit 9387fdf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Doc/library/annotationlib.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,12 @@ Functions
393393
``sys.modules[obj.__module__].__dict__`` and *locals* defaults
394394
to the *obj* class namespace.
395395
* If *obj* is a callable, *globals* defaults to
396-
:attr:`obj.__globals__ <function.__globals__>`,
397-
although if *obj* is a wrapped function (using
398-
:func:`functools.update_wrapper`), a :class:`functools.partial` object,
399-
or a :class:`functools.partialmethod` object,
400-
it is unwrapped until a non-wrapped function is found.
396+
:attr:`obj.__globals__ <function.__globals__>`.
397+
If *obj* has a :attr:`~function.__wrapped__` attribute (such as functions
398+
decorated with :func:`functools.update_wrapper`), or if it is a
399+
:class:`functools.partial` object, it is unwrapped by following the
400+
:attr:`!__wrapped__` attribute or :attr:`~functools.partial.func` attribute
401+
repeatedly until a function with :attr:`~function.__globals__` is found.
401402

402403
Calling :func:`!get_annotations` is best practice for accessing the
403404
annotations dict of any object. See :ref:`annotations-howto` for

0 commit comments

Comments
 (0)