Skip to content

Commit 89409f0

Browse files
Apply suggestions from code review
Co-authored-by: Adam Turner <[email protected]>
1 parent 4fff347 commit 89409f0

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Doc/library/annotationlib.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ annotations from the class and puts them in a separate attribute:
486486
return typ
487487
488488
489-
Limitations of the ``STRING`` and ``FORWARDREF`` formats
490-
--------------------------------------------------------
489+
Limitations of the ``STRING`` format
490+
------------------------------------
491491

492492
The :attr:`~Format.STRING` format is meant to approximate the source code
493493
of the annotation, but the implementation strategy used means that it is not
@@ -511,8 +511,9 @@ code execution even with no access to any globals or builtins. For example:
511511
Hello world
512512
{'x': 'None'}
513513
514-
(This particular example works as of the time of writing, but it relies on implementation details
515-
and is not guaranteed to work in the future.)
514+
.. note::
515+
This particular example works as of the time of writing, but it relies on
516+
implementation details and is not guaranteed to work in the future.
516517

517518
Among the different kinds of expressions that exist in Python,
518519
as represented by the :mod:`ast` module, some expressions are supported,
@@ -570,6 +571,10 @@ The following are disallowed in annotation scopes and therefore not relevant:
570571
* :class:`ast.Yield`
571572
* :class:`ast.YieldFrom`
572573

574+
575+
Limitations of the ``FORWARDREF`` format
576+
----------------------------------------
577+
573578
The :attr:`~Format.FORWARDREF` format aims to produce real values as much
574579
as possible, with anything that cannot be resolved replaced with
575580
:class:`ForwardRef` objects. It is affected by broadly the same Limitations

Doc/reference/compound_stmts.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,6 @@ all annotations are instead stored as strings::
18981898
>>> f.__annotations__
18991899
{'param': 'annotation'}
19001900

1901-
19021901
This future statement will be deprecated and removed in a future version of Python,
19031902
but not before Python 3.13 reaches its end of life (see :pep:`749`).
19041903
When it is used, introspection tools like

0 commit comments

Comments
 (0)