News for hackers. Stuff that matters.
Re:Astral – "We're building a new static type checker for Py... by claytonjy on Wednesday January 29, 2025 @03:53PM (#42871017)
is Django working towards using native types instead of all they stuff they invented before type hints existed?
Re:Astral – "We're building a new static type checker for Py... by rtpg on Wednesday January 29, 2025 @04:00PM (#42871093)
I am not part of the DSF or anything but I can say with a good amount of confidence that the answer to this is “No”.

Moving to a Pydantic-style model would be a whole different ballgame. Hell of a lot of work, and meanwhile we can’t even really get to “let’s have type hints in some of the Django infernals”.

But! I do think someone who wants to have fun could try to build a type hint based Model subclass as a third party lib! There’s a looooot of stuff to resolve in that world but for any proposal like that the general vibe is “prove the feasibility with a third party package first”.

Re:Astral – "We're building a new static type checker for Py... by c-fe on Wednesday January 29, 2025 @04:31PM (#42871450)
I think there is potential for a new python web framework with batteries included (like django) but using newer paradigms (typing, …). Fastapi itself is a nice concept but its a bit of a mess (the main author just keeps closing bug issues and adds somewhat useless things (just check the git commit log)), and also it requires db tooling (sqlalchemy) and other things
Re:Astral – "We're building a new static type checker for Py... by rtpg on Wednesday January 29, 2025 @06:35PM (#42872800)
I kind of agree, though at least Django with type stubs gets me 95% of the way there.

At the end of the day I end up writing a service layer over everything so I'm not super bugged by most of this. But it's busywork when first starting up a project.

Re:Astral – "We're building a new static type checker for Py... by IceWreck on Wednesday January 29, 2025 @04:57PM (#42871756)
You should check out litestar

It's essentially what you described and it's growing in popularity.

Re:Astral – "We're building a new static type checker for Py... by c-fe on Thursday January 30, 2025 @07:31AM (#42877153)
Thanks, ill check it out!
Re:Astral – "We're building a new static type checker for Py... by physicsguy on Thursday January 30, 2025 @10:25AM (#42878608)
It's really nothing like Django, which is a full stack development framework. This is more akin to Django REST Framework or Django Ninja which are REST API frameworks that sit on top of Django.
Re:Astral – "We're building a new static type checker for Py... by physicsguy on Thursday January 30, 2025 @10:24AM (#42878597)
It's also super clunky if you get into certain advanced things because it's built on top of Starlette and piggybacks off much of that. Want to adjust how many background threads you want running? Oh wait, you can't, it's a Starlette setting that's not really exposed.
Re:Astral – "We're building a new static type checker for Py... by physicsguy on Thursday January 30, 2025 @10:23AM (#42878583)
Django's magic is that you can set various class variables as either a value or a method. So typing that becomes incredibly hard, everything is effectively Union typed.