在 mypy 中,reveal_locals 未定义
In mypy, reveal_locals is not defined
运行 mypy 在以下文件中报告 reveal_locals
未定义的错误:
from typing import Iterable
def f(stream: Iterable[str]):
for val in stream:
reveal_locals()
我 运行 Windows 10 Python 3.6.4 和 mypy 0.580。我在控制台上看到的实际错误是
$ python -m mypy file.py
file.py:5: error: Name 'reveal_locals' is not defined
我是在使用错误的 python 版本还是遗漏了什么?我对 the documentation 的解释似乎表明我正在做我应该做的事情。
reveal_locals
仅在 mypy 0.610 中添加(已发布 about a month ago);检查您是否是 运行 最新版本。
运行 mypy 在以下文件中报告 reveal_locals
未定义的错误:
from typing import Iterable
def f(stream: Iterable[str]):
for val in stream:
reveal_locals()
我 运行 Windows 10 Python 3.6.4 和 mypy 0.580。我在控制台上看到的实际错误是
$ python -m mypy file.py
file.py:5: error: Name 'reveal_locals' is not defined
我是在使用错误的 python 版本还是遗漏了什么?我对 the documentation 的解释似乎表明我正在做我应该做的事情。
reveal_locals
仅在 mypy 0.610 中添加(已发布 about a month ago);检查您是否是 运行 最新版本。