|
|
|
|
|
by quotemstr
1 day ago
|
|
The Python typing community has known about the expressiveness problems for years. It's forward-only, has no HKTs, no type computation, no complement. I can't even do generic parameter list transforms. All of these are known deficiencies. Everyone who brings them up is told to pound sand, their use cases deemed illegitimate. Might as well be GNOME. It's fundamentally unfair that Django gets to use aspects of the language other tools can't, and one hard coded dataclass-style transform is inadequate. So help me God, if I ever do another large scale Python project, then if these issues aren't fixed in typing, I will vendor and modify a type checker in the project itself and teach it my project's patterns directly. I will not twist and distort my design vision so it rhymes with dataclass. |
|
You can just ... not typecheck parts of your code. All of these tools are gradual, since Python's much too dynamic to encompass everything. Falling back to runtime "I know how this works" dynamism isn't a sin, it just requires a little care. Add restrictions (typed wrappers, verbosity/limitations a la dataclass_transform) at the boundaries where people make frequent mistakes, and move on with your life.