Proposal: New documentation page covering using Django with type hints

@anze3db’s recent blog post here has a good foundation for what we might say:

Pyrefly would need mentioning. And Zuban (from the author of Jedi) for that matter.

To quote Hynek, ty is “barely functional” — and its status is somewhat in doubt. I know Astral had all the momentum, but we really should see what happens now before recommending ty.

Yep. My recent DjangoCon Europe talk was precisely about this.

tl;dr Django is dynamic by design.

My particular conjecture here is that retrofitting typing is a lost cause/fool’s errand/etc, and so my approach is to build static islands on top — hence django-mantle.

But this is just a conjecture: a suitably herculean effort might show that it is possible. (At DjangoCon Europe Tim Bell — not on the forum? — was telling me that there’s an engineer at Kraken trying it [i.e. to fully type the ORM]; @hakib also wanted to see it actually typed, and muttered “it’s not that dynamic” at one point; and there are others — including you I think — who would like to see it done.)

Explaining that this is an open question, and where we’re at, wouldn’t hurt at all.

(FWIW: I also think we should be leaning into Python’s dynamic features, or we should all be using Rust, but that’s a different topic/aspect, and not for today :sweat_smile:)

So this would be a Topic page.

4 Likes