Ruff author warns: setting MYPY speeds up type checking on Pydantic but collapses types to Mapping[str, Any]

charliermarsh · x · 2026-11-21

Charlie Marsh (Ruff/uv author, Astral founder) responded to a viral "discovery" that setting MYPY makes type checkers run faster on Pydantic codebases. He confirmed the trick works but stressed it's actually bad: that code path collapses all types into Mapping[str, Any], dropping essentially all type precision — so you shouldn't do it.

A non-obvious flag worth knowing about, paired with a clear warning about its cost.

Related event: Ruff Author Finds Pretending to Be Mypy Speeds Up Pydantic Type Checking(2 posts)→

Original post →

More from coding & agent

coding & agent channel →