Skip to content

Commit

Permalink
pythongh-119180: Add annotationlib module to support PEP 649 (pytho…
Browse files Browse the repository at this point in the history
…n#119891)

Co-authored-by: Alex Waygood <[email protected]>
  • Loading branch information
2 people authored and nohlson committed Jul 24, 2024
1 parent efa6eae commit 9fd92ac
Show file tree
Hide file tree
Showing 15 changed files with 1,815 additions and 510 deletions.
8 changes: 6 additions & 2 deletions Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1366,11 +1366,15 @@ Using the non-data descriptor protocol, a pure Python version of
def __call__(self, *args, **kwds):
return self.f(*args, **kwds)
@property
def __annotations__(self):
return self.f.__annotations__

The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute
that refers to the underlying function. Also it carries forward
the attributes necessary to make the wrapper look like the wrapped
function: :attr:`~function.__name__`, :attr:`~function.__qualname__`,
:attr:`~function.__doc__`, and :attr:`~function.__annotations__`.
function, including :attr:`~function.__name__`, :attr:`~function.__qualname__`,
and :attr:`~function.__doc__`.

.. testcode::
:hide:
Expand Down
Loading

0 comments on commit 9fd92ac

Please sign in to comment.