-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Steps to reproduce
mypy can't seem to find a class defined inside a function. For example:
import typing
def foo() -> typing.Any:
class Bar(typing.NamedTuple):
member: str
o = Bar(member='fee')
return o
Current behavior
I get the following when I run mypy on the above code (saved in a file named "t1.py"):
t1.py:4: error: Name 'Bar' is not defined
t1.py:7: error: Missing positional arguments "typename", "fields", "verbose", "rename", "kwargs" in call to "Bar"
Expected behavior
No errors or warning from mypy.
mypy --version output
mypy 0.540