Skip to content

Treat triple-quoted type annotation expressions as implicitly parenthesized #9

@erictraut

Description

@erictraut

I would like to request that the typing council consider a clarification to the typing spec with regard to the proper behavior of a triple-quoted (forward reference) type annotation expression.

For details, refer to this discussion.

Here's a PR with the proposed spec language change: python/typing#1578.

The proposed behavior is consistent with pyright's current behavior. Mypy 1.8.0 doesn't behave this way, but the next version of mypy will include this commit which allows it to conform to the prescribed behavior.

Pyre and pytype do not currently conform to this behavior, so they would need to make small changes to implement it.

  • Eric
  • Guido
  • Jelle
  • Rebecca
  • Shantanu

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions