|
|
|
|
|
by rand_r
979 days ago
|
|
Did you manage to get MyPy + Django to work together usefully? I tried the plugin you mentioned but it still seemed stymied by the dynamic nature of Django (reverse relations, etc), so I gave up on it. If it’s actually possible to live in typed nirvana with Django I’ll bang my head against the wall some more. We’re using Django 3.2 btw + FactoryBoy. Actually there’s a number of annoyingly dynamic Python libraries out there where methods are created dynamically that it feels a bit like playing whack-a-mole. Is the situation like TypeScript where you need a MyLibrary.types.ts for each library? |
|
Here's our plugin setup in mypy.ini in case this helps (Django 4.2 + drf 3.14)
with packages: with this horror of a regex in make (because you'll get drowned in wrong type errors in all of the untype files, and errors get shown from imports even if you don't care about that imported file), add more file targets as necessary: This allows you to get proper errors for things like and even errors on typos like