PEP 563: Postponed evaluation of annotations: enable it by default before Python 4.0
Hi, When the "PEP 563 -- Postponed Evaluation of Annotations" was accepted and implemented in Python 3.7, the feature was introduced as an opt-in choice, and the switch to enable it by default was scheduled for Python 4.0. I dislike scheduling too many incompatible changes in Python 4.0, and I would prefer to have them happening earlier :-) Would you be ok to have annotations as string by default in Python 3.10, or even in Python 3.9? If Python 3.9 is picked, the change must be done before "3.9.0 beta 1: Monday, 2020-05-18 (No new features beyond this point.)" and 3.9.0 final is scheduled for Monday, 2020-10-05 (PEP 596). Is it too early? See https://bugs.python.org/issue38605 for the previous discussion. -- Example: # from __future__ import annotations def func(x: int): pass print((func.__annotations__)) Currently (Python 3.7 and 3.8), we get: {'x': <class 'int'>} PEP 563 annotations (if you uncomment the __future__) gives: {'x': 'int'} Victor -- Night gathers, and now my watch begins. It shall not end until my death.
participants (1)
-
Victor Stinner