Skip to content

mypy does not recognize __qualname__ #6473

Closed
@jtmoon79

Description

@jtmoon79
  1. Given Python file test1.py
class A(object):
    NAME = __qualname__
  1. run mypy checking

    mypy test1.py
    
  2. BUG: mypy reports not defined

    test1.py:2: error: Name '__qualname__' is not defined
    

The Python interpreter runs the code without error.

__qualname__ has been available since Python 3.3.

Tested on Python 3.7.1, using mpypy 0.670.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions