Skip to content

False-positive name-error in match statement #1435

@sizmailov

Description

@sizmailov

Source foo.py:

import bar

match 0:
    case 0:
        x: int = bar.f(0)

Command:

pytype --disable import-error foo.py 

Error:

File "foo.py", line 5, in <module>: Name '__annotations__' is not defined [name-error]

System info:

$ python --version
Python 3.10.6
$ pytype --version
2023.05.24

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcat: corecore language and typing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions