PEP 563: Correct references to 3.10 default adoption (#2086)

This commit is contained in:
xochozomatli 2021-09-25 09:53:47 -06:00 committed by GitHub
parent 40ef5625b7
commit b9b44c4eb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -25,7 +25,7 @@ This PEP proposes changing function annotations and variable annotations
so that they are no longer evaluated at function definition time. so that they are no longer evaluated at function definition time.
Instead, they are preserved in ``__annotations__`` in string form. Instead, they are preserved in ``__annotations__`` in string form.
This change is going to be introduced gradually, starting with a new This change is being introduced gradually, starting with a
``__future__`` import in Python 3.7. ``__future__`` import in Python 3.7.
@ -45,6 +45,8 @@ hinting use case:
computationally free. computationally free.
Postponing the evaluation of annotations solves both problems. Postponing the evaluation of annotations solves both problems.
NOTE: PEP 649 proposes an alternative solution to the above issues,
putting this PEP in danger of being superceded.
Non-goals Non-goals
--------- ---------
@ -85,7 +87,7 @@ aforementioned PEPs should be considered deprecated.
Implementation Implementation
============== ==============
In Python 3.10, function and variable annotations will no longer be With this PEP, function and variable annotations will no longer be
evaluated at definition time. Instead, a string form will be preserved evaluated at definition time. Instead, a string form will be preserved
in the respective ``__annotations__`` dictionary. Static type checkers in the respective ``__annotations__`` dictionary. Static type checkers
will see no difference in behavior, whereas tools using annotations at will see no difference in behavior, whereas tools using annotations at
@ -283,9 +285,10 @@ Deprecation policy
Starting with Python 3.7, a ``__future__`` import is required to use the Starting with Python 3.7, a ``__future__`` import is required to use the
described functionality. No warnings are raised. described functionality. No warnings are raised.
In Python 3.10 this will become the default behavior. Use of annotations NOTE: Whether this will eventually become the default behavior is currently unclear
incompatible with this PEP is no longer supported. pending decision on PEP 649. In any case, use of annotations that depend upon
their eager evaluation is incompatible with both proposals and is no longer
supported.
Forward References Forward References
================== ==================