8000 Docs: Postponed evaluation of annotations deferred to 3.11 · Issue #10648 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content
Docs: Postponed evaluation of annotations deferred to 3.11 #10648
Closed
@ShadowLNC

Description

@ShadowLNC

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.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0