News for hackers. Stuff that matters.
Re:Why type hinting sucks (/r/Python) by JonChesterfield on Saturday February 11, 2023 @08:06AM (#34752005)
Not actually sufficient though, you'll need:

def slow_add_int_float(a: int, b: float) -> float: # etc

where an argument could be made for encoding the return type in the name as well, at least for functions that don't do addition.

What that has going for it is the warm familiarity of C99. People really like function (and sometimes operator, if they draw a distinction) overloading though, and can reasonably argue that writing template instantiations by hand is a poor use of their time.

Re:Why type hinting sucks (/r/Python) by 2h on Saturday February 11, 2023 @08:21AM (#34752111)
you should never be adding an int to a float. You should be casting one first.