This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lukasz.langa
Recipients adelfino, cheryl.sabella, docs@python, gvanrossum, levkivskyi, lukasz.langa, matrixise, r.david.murray
Date 2018-05-15.04:06:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526357197.24.0.682650639539.issue32769@psf.upfronthosting.co.za>
In-reply-to
Content
Guido, do you really want to stress at this point for Python 3.8 that annotations do not have an intended purpose? That is clearly not true.

1. PEP 526 was created purely with types in mind and was inspired by PEP 484's lack of this functionality.

2. PEP 563 defines a future import which will become the default in a future release (currently marked as 4.0). This default stops evaluating annotations at runtime, which again was inspired by the typing use case.

3. Dataclasses in PEP 557 are designed to leverage types in annotations. A few quotes from that PEP:

> A class decorator is provided which inspects a class definition for variables with type annotations as defined in PEP 526, "Syntax for Variable Annotations".

> One main design goal of Data Classes is to support static type checkers. The use of PEP 526 syntax is one example of this, but so is the design of the fields() function and the @dataclass decorator.

4. PEP 560 added support for `__class_getitem__` and `__mro_entries__` in core purely for the purpose of generic types.

5. For the above reasons, PEP 563 states that non-typing usage of annotations is deprecated:

https://www.python.org/dev/peps/pep-0563/#non-typing-usage-of-annotations
History
Date User Action Args
2018-05-15 04:06:37lukasz.langasetrecipients: + lukasz.langa, gvanrossum, r.david.murray, docs@python, matrixise, levkivskyi, cheryl.sabella, adelfino
2018-05-15 04:06:37lukasz.langasetmessageid: <1526357197.24.0.682650639539.issue32769@psf.upfronthosting.co.za>
2018-05-15 04:06:37lukasz.langalinkissue32769 messages
2018-05-15 04:06:36lukasz.langacreate