Skip to content

mypy always fails with Python 3.10 match statement #11829

@wrobell

Description

@wrobell

Please consider:

a = 1
match a:  # type: ignore
    case 0:
        print('is zero')
    case 1:
        print('is one')

then

$ mypy t5.py
t5.py:2: error: Match statement is not supported
Found 1 error in 1 file (errors prevented further checking)

I would expect Mypy to ignore the whole match block.

Or is there an option I am missing, which I can pass to Mypy?

Mypy 0.930, Python 3.10.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions