Hacker News new | ask | show | jobs
by one2three4 1825 days ago
> miss languages with better type checking. What about python type hints?
2 comments

It's hard to static type with DRF, even with drf-stubs package. Good luck with static typing your managers, it's impossible due to circular imports. It's easier if you add services layer but not many people like it. There's also a lib which allows you to convert db entities into dataclasses so it's easier to throw around types but it's not a "Djangoese" approach so I'd be very careful with that.

With microframeworks it's easier as you can structure your project as you like add more layers of abstraction so it's not that tightly coupled. Fe. sqlalchemy -> pydantic schema.

That's why he said "better". Have you used both

A. python with type hints

and

B. Typescript, or a statically typed language such as Rust/Java

? I'm guessing not.