Back to Ruff

NameError: name 'reveal_type' is not defined

crates/ty_python_semantic/resources/lint_docs/undefined-reveal.md

0.15.18294 B
Original Source

What it does

Checks for calls to reveal_type without importing it.

Why is this bad?

Using reveal_type without importing it will raise a NameError at runtime.

Examples

python
# NameError: name 'reveal_type' is not defined
# error
reveal_type(1)  # revealed: Literal[1]