-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
Bug Report
Annotated as descirbed by PEP 593 should work according to #7021 but does not if the Annotated is annotating a function parameter and contains a string literal, that is not itself a function parameter. Se examples below.
To Reproduce
a: Annotated[str, "metadata"]
is fine
def f(a: Annotated[str, str("metadata")]):
is also fine
def f(a: Annotated[str, "metadata"]):
gives Name 'metadata' is not defined
Expected Behavior
All thre examples should be valid
Actual Behavior
They are not.
Your Environment
- Mypy version used:master branch as of time of writing
- Mypy command-line flags:
- Mypy configuration options from
mypy.ini
(and other config files): - Python version used:3.9.1
- Operating system and version:Windows 10
Jasha10
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong