This style of development is unfair to innovators and ossifies the ecosystem.
Plugins do provide a more level playing field, and we aren't closed to the possibility of supporting them in future. But they come with a whole host of challenging technical problems, and we have a lot of other high-priority things to work on.
But (1) django is older than Python's type system, so it uses some very dynamic patterns that are hard to express using Python types. And (2) it's very popular, which means both that lots of people want their type checker to do Something Useful™ with django code, and that it would be very difficult to retrofit django to use dynamic patterns that _are_ more compatible with the type system. That combination makes it worth our time to add specific custom support for it.
For your own future library, the hope is that the type system has become capable enough that you wouldn't _need_ custom type checker support. Things like `dataclass_transform` [1] were added specifically so that _all_ libraries could express these kinds of things in ways that are visible to the type checkers without custom support.
If you're doing something that still doesn't fit into what the typing system provides, then the Python typing community wants to learn about your use case so that we can see if we can extend the typing system even further to support it.
[1] https://typing.python.org/en/latest/spec/dataclasses.html
The real issue is that ty's Django support is still early: reverse relations and django-stubs aren't supported yet, and django-types is already lagging behind Django 6.
Does adding `django-stubs` not work?
I haven't tried it myself, as I don't use Django.
I have nothing against Ty, it is quite powerful, and released under MIT.
This blog post also tells us that Ty is used extensively at OpenAI, like we're meant to be impressed.
I got a 2 weeks ban on the python discuss instance for suggesting that core contributors who contribute as their job should disclose who their employer is.
Funnily though I’ve started to care less about typing in Python. Since Rust got good most projects where I’d want strong types I’m not using Python anymore. Python is still great for glue code, as it was intended. Typing helps there if libraries have good support but I find myself writing Python type annotations less now. It’s always been a bit awkward and ugly in Python anyway.
Remember when Astral told us in 2024 they would not sell out?
Summarizing, for something that is an argument with specific fields you'd use a Mapping or a MutableMapping as the annotation, and if that's a return value, then it should be a TypedDict. Sometimes TypedDict also makes sense as an argument annotation, e.g., if it has to be a dict strictly.
For a generic dictionary, like you know that you're drawing from a set of possible kwargs that are all string values, you can also just annotate them with an "anonymous" dict like what Ty is inferring on your codebase.
Ty – A fast Python type checker, written in Rust - https://news.ycombinator.com/item?id=46100637 - Nov 2025 (15 comments)
Pyrefly vs. Ty: Comparing Python's two new Rust-based type checkers - https://news.ycombinator.com/item?id=44107655 - May 2025 (160 comments)
Ty: A fast Python type checker and language server - https://news.ycombinator.com/item?id=43918484 - May 2025 (287 comments)