Skip to content

Type annotation "List"[int] generates runtime error but is accepted by mypy #9932

Open
@erictraut

Description

@erictraut

This bug was just logged against pyright (and fixed): microsoft/pyright#1393

I noticed that mypy also fails to report this error.

from typing import List
foo: "List"[int] = [1] # Accepted by mypy but generates runtime error

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions