Just make Typethon.
If it becomes so widespread, we might see a direct integration into Python in a future release, like how we got dataclasses
I mean, it should just be TypedDataClasses. But I think if you look at the Pydantic docs you will see why it can't just go into the standard library, Pydantic type coercion and exceptions are probably as random sounding as JavaScript
"First time?"
~JS users who've had TypeScript rammed down their throats for over a decade.
Ehh but there are lots of type validation libraries in typical JS fashion
Are there none other than Pydantic for Python?
It’s 2025. Type validation and serde should be built into the language.
I don't know, seems like if you want strict typing you just don't use Python.
It's not really extravagant to want your program to be strict for some of its inputs.
Python is strongly typed, so in some cases you want to ensure you won't run into type issues at run time that would be due to user/external data. And internally keep it flexible/dynamic.
It can be nice to have both, I like having separate components that talk to each other via heavily validated pydantic models. This way, if any one component isn't doing its job, it fails loudly and quickly at this point of communication.
You really can’t choose in certain fields though, e.g. data science. What am I gonna use? Scala?
Facts. So many Python scripts over the years have failed in the middle of execution for some stupid type reason.
No, it shouldn't, because then it will end up like TS where it's only a paint job on top and I in spend half my time writing boilerplate that doesn't even actually reduce the number of bugs in the product.
I feel like the point of Python is to be simple and easy to do things with it. Adding types feels a bit counterintuitive to making a simple language, and this is coming from someone who likes typed languages
It's nice to have type checking sometimes, for example when pulling data from an API or for communication between subsystems. Adding this functionality to the standard library wouldn't fundamentally change the language, it's just another tool in the toolbox.
If types give you the feeling something is difficult, then the person should not be a programmer. How can one even write code without knowing all the time what type a certain variable is supposed to be, is beyond me. Hence why I use strict type checking when writing Python, but not all libraries have good type support, sadly.
I fucking held off for sooooo long to even bother to learn typing in python. And now I love it and kinda still fucking hate it. Mypy can fuck right off tho. We have that in one of our git actions and fuck mypy to hell.
Mypy is literally the worst. So many hours spent fighting inane and impossible errors
The problem is our OCD. If you write a new simple function, please, type it. If you tackle an old Django app, please don't try and make the types work.
HAHAHA LOL
having to deal with typing in python is such a pain in the ass when you are used to real statically typed languages
lol, wtf. I always See people complaining about typing in Python while there are proper tools and solutions. Would it been better If typing hadn't been an afterthought? Defenitely. But the Status quo IS really good. (Except for the case where you have dependencies that have no proper types...)
However, this is not what pydantic addresses. Pydantic actually uses the flexibility and reflection abilities of Python to provide annotations and Checks that would be Impossible in other strictly typed languages like C++ out of the box.
Java people writing Python.
Lol, Python pulling out that Draw 25 card rather than committing to static typing is such a mood. Can relate, sometimes adding that type-hinting feels like overcommitting to a relationship 😂 #JustPythonThings
ok LLM
Just piss off Microsoft with Python and they will make Typethon