classes
classes copied to clipboard
Crash: lookup of unknown name
Screen shot sent by our user:

Repro: https://github.com/ftaebi/demo
I am getting this error as well on the following line of my project: https://github.com/ruancomelli/boiling-learning/blob/main/boiling_learning/describe/describers.py#L36.
I was able to simplify that file as
from classes import typeclass
@typeclass
def describe(instance: str) -> str:
'''Return a JSON description of an object.'''
@describe.instance(str) # Internal error: attempted lookup of unknown name [misc]
def _describe_basics(instance: str) -> str:
return instance
and the error still persists:
$ mypy boiling_learning/describe/describers.py
boiling_learning/describe/describers.py:9: error: Internal error: attempted lookup of unknown name [misc]
Found 1 error in 1 file (checked 1 source file)
Tested with mypy==0.971 and classes==0.4.1 on Ubuntu 20.04 with Python 3.9.14.
The problem probably has something to do with my project (either a configuration or another Python file), because I could NOT reproduce it by creating a draft project containing only that offending file.