Skip to content

Commit 7b7b90d

Browse files
gh-119180: Add annotationlib module to support PEP 649 (#119891)
Co-authored-by: Alex Waygood <[email protected]>
1 parent 64e221d commit 7b7b90d

15 files changed

+1815
-510
lines changed

Doc/howto/descriptor.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -1366,11 +1366,15 @@ Using the non-data descriptor protocol, a pure Python version of
13661366
def __call__(self, *args, **kwds):
13671367
return self.f(*args, **kwds)
13681368
1369+
@property
1370+
def __annotations__(self):
1371+
return self.f.__annotations__
1372+
13691373
The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute
13701374
that refers to the underlying function. Also it carries forward
13711375
the attributes necessary to make the wrapper look like the wrapped
1372-
function: :attr:`~function.__name__`, :attr:`~function.__qualname__`,
1373-
:attr:`~function.__doc__`, and :attr:`~function.__annotations__`.
1376+
function, including :attr:`~function.__name__`, :attr:`~function.__qualname__`,
1377+
and :attr:`~function.__doc__`.
13741378

13751379
.. testcode::
13761380
:hide:

0 commit comments

Comments
 (0)