true.
i am all for types in general and for types annotations in python. but i have seen some heavily type-annotated python code lately and i don't think that's where we want to be.
we are starting to look like a heavily templatized cpp code.
true.
i am all for types in general and for types annotations in python. but i have seen some heavily type-annotated python code lately and i don't think that's where we want to be.
we are starting to look like a heavily templatized cpp code.
Is the point where your Python codebase needs type hinting to be readable a signal that you've hit the dynamic language/complexity impedance mismatch?
Or is it a sign that your code's readability could be better?
Your "session" remark reminds me of trying to understand the Ruby IMAP library when the only documentation was autogenerated API docs, I had to follow one variable through the entire stack to figure out what it's original type and thus capability, was.
I taught myself to code in Python, and find that well-written Python makes sense without types (tooling support aside), but then being honest, most of the Python code I meet professionally, is barely okay written.
I guess it's like Java, industrial programming code needs a type system to make code written averagely understandable, but not so much of a type system that you spend your time fighting obscure compiler errors.
- mypy: that's another story, but it's also optional, use it if you want... (my opinion, like in typescript, if I want types I will do it with go or rust)
Long term goal is to create a lightweight Pandas equivalent by and for the Rust community, but with slight differences in focus..."
https://docs.rs/black-jack/0.1.0/blackjack/
EDIT: That one looks like it's not being worked on actively. Here's a reddit thread with more ideas. Weld looks interesting.
https://www.reddit.com/r/rust/comments/apo66e/dataframes_wha...
And Arrow looks like a new project Wes McKinney is contributing to.
But most importantly, `def foo(lst: list, idx: int):` is fine in 95% of cases. Most of the time, you don't need to go full Java, full verbosity. Document the most important elements - you're taking in a list and an int - and move on.
Since I started using them, the number of runtime errors coming out from my own code has been drastically reduced.
Of course one can always go overboard with those `Generic[T]` hints. Though this is a problem of the tool user, not the tool.
Which was my main concern when type-hints were added
Give a hand to the strong-typed people and they will take the whole arm.
They will take Python as "now it's like Java" and will push it all the way through.
(Though yeah templates in C++ turn the ugliness to 11)
Not to mention Python is "strongly-typed". But it doesn't require variables to have a pre-determined type and doesn't do compile time type checks by itself.