Catch bugs before you run your code
import json
data = json.lods(response)✕ Module `json` has no attribute `lods`. Did you mean `loads`?
$ pip install pyrefly && pyrefly initImprove code quality at your own pace
Set a preset in the [tool.pyrefly] section of your pyproject.toml to control how many errors you get. More info in the preset docs.
preset = "basic"Best for newcomers to type checking
Catch only the most obvious errors and ignore everything else.
preset = "default"Best for most projects, most of the time
You annotate where it helps and want those annotations properly checked.
preset = "strict"Best for libraries and shared code
Other people depend on your type correctness, so no implicit Any and no missing @override
Works where you or your agent writes Python
Performance Comparison
Type checking the PyTorch codebase from scratch.ⓘTested using Macbook
(10 cores: 8 performance + 2 efficiency cores, 32 GB RAM)
(10 cores: 8 performance + 2 efficiency cores, 32 GB RAM)
PyreflyⓘCommand: "pyrefly check"
Pyrefly uses as many threads as possible
Pyrefly uses as many threads as possible
PyrightⓘCommand: "pyright --threads=8"
8 threads yielded the best performance after testing multiple settings
8 threads yielded the best performance after testing multiple settings
MyPyⓘCommand: "dmypy run"