Skip to content

Commit 0e8a698

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

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Doc/library/annotationlib.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,10 @@ Functions
368368
doesn't have its own annotations dict, returns an empty dict.
369369
* All accesses to object members and dict values are done
370370
using ``getattr()`` and ``dict.get()`` for safety.
371-
* For :class:`functools.partial` and :class:`functools.partialmethod` objects,
372-
only returns annotations for parameters that have not been bound by the
373-
partial application, along with the return annotation if present.
374-
See :ref:`below <functools-objects-annotations>` for details.
371+
* Supports objects that provide their own :attr:`~object.__annotate__` method,
372+
such as :class:`functools.partial` and :class:`functools.partialmethod`.
373+
See :ref:`below <functools-objects-annotations>` for details on using
374+
:func:`!get_annotations` with :mod:`functools` objects.
375375

376376
*eval_str* controls whether or not values of type :class:`!str` are
377377
replaced with the result of calling :func:`eval` on those values:
@@ -394,10 +394,10 @@ Functions
394394
to the *obj* class namespace.
395395
* If *obj* is a callable, *globals* defaults to
396396
:attr:`obj.__globals__ <function.__globals__>`.
397-
If *obj* has a :attr:`~function.__wrapped__` attribute (such as functions
397+
If *obj* has a ``__wrapped__`` attribute (such as functions
398398
decorated with :func:`functools.update_wrapper`), or if it is a
399399
:class:`functools.partial` object, it is unwrapped by following the
400-
:attr:`!__wrapped__` attribute or :attr:`~functools.partial.func` attribute
400+
``__wrapped__`` attribute or :attr:`~functools.partial.func` attribute
401401
repeatedly until a function with :attr:`~function.__globals__` is found.
402402

403403
Calling :func:`!get_annotations` is best practice for accessing the
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Support :class:`functools.partial` and :class:`functools.partialmethod`
2-
inspect in :func:`annotationlib.get_annotations`
1+
Support `__annotate__` for :class:`functools.partial`
2+
and :class:`functools.partialmethod`

0 commit comments

Comments
 (0)