|
|
|
|
|
by wcdolphin
1262 days ago
|
|
Has anyone migrated a large code base between MyPy and Pyright? In particular would love to hear about experiences with Django.
Mypy’s performance and the join based type merging are quite limiting. At the same time, the ecosystem support around MyPy seems strong. |
|
At same time this only affects a subset of Django behavior and I have used pyright with a Django codebase and it mostly worked well. The more you use very dynamic features of Django the more this matters.
One note for both is you do want to tune configuration settings. Pyright basic is fairly easy to satisfy, pyright strict is too hard for most codebases. Similarly mypy defaults are too lenient, but mypy strict is pretty hard (even mypy doesn't use strict to check itself). I roughly go for strict for both and then remove ~5 hardest rules and call that good enough. Strictest rules pretty much require all of your dependencies to be well typed/stubbed.