Skip to content

AssertionError: Var is lacking info - access to class variable imported in context class #11641

Closed
@ampanasiuk

Description

@ampanasiuk

Crash Report

# user.py
name = 'Bob'

# hello.py
class Hello:
    from user import name

    def greet(self) -> None:
          print(self.name)

Traceback

mypy/nodes.py:2705 (__getattribute__) is the deepest frame

To Reproduce

$ mypy hello.py

Your Environment

  • Mypy version used: 0.910
  • Mypy command-line flags: filename
  • Mypy configuration options from mypy.ini (and other config files): no
  • Python version used: 3.8.12
  • Operating system and version: cygwin

Thanks for looking into this,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions