Hacker News new | ask | show | jobs
by zem 357 days ago
it's that django does metaprogramming that cannot be expressed in terms of python's static type annotations. you need dedicated plugins that essentially replicate that metaprogramming to generate the relevant types.

it's not just django btw, pretty much any metaprogramming library needs that sort of custom support, including dataclasses - take a look at any python type checker and you will find code specifically replicating what dataclasses does in terms of code generation. for pytype we actually put dataclass and namedtuple support alongside our other third-party plugins in the codebase.