PEP-0563 and from __future__ import annotations

Remarks from Guido Van Rossum

If you’re using Python type annotations, please ask yourself whether it works when you add ‘from __future__ import annotations’.

This will be the default in 3.10 and we need you to prepare for that. (Also, 3.9.0 is now out.)

To clarify, this is part of PEP 563. It will affect inspect.signature() for annotated functions, the types come back stringified. E.g. (a: ‘int’) instead of (a: int

Issue 38605

The PEP 563: Postponed evaluation of annotations was introduced an opt-in feature using “from __future__ import annotations”.

It is scheduled to become the default in Python 4.0.

I would prefer to limit the number of incompatible changes in Python 4.0: it should just a “regular” release, with a regular number of incompatible changes. The version number change is going to cause enough troubles…

Would it be possible possible to enable postponed evaluation of annotations either before or after Python 4.0 ?

For example, can we imagine to enable it by default in Python 3.9 ? If not, what about Python 3.10 ?