Description
Documentation
As per the mailing list, the postponed evaluation of annotations has been deferred to 3.11.
However, the docs still refer to it becoming default in 3.10: https://mypy.readthedocs.io/en/stable/runtime_troubles.html
It also seems like the current behaviour is that mypy
considers all type annotations to be using postponed evaluation, even when missing the future statement. For example, mypy
reports no issues with the following code:
class X:
def func(self) -> X:
pass
As expected, it will not run without from __future__ import annotations
.
Based on the title of the linked documentation page ("Annotation issues at runtime") and the opening sentence, it suggests that this might be intended behaviour? If so, can this please be added to the documentation? (If it's not intended behaviour, I can file a bug, but didn't want to open extra issues unnecessarily.)