3 ms·
It's because it makes it harder to prove that a function does one of only two things: returns a known type, or throws and exception. In Python it's legal to hav
by gaius 15y ago
It's because it makes it harder to prove that a function does one of only two things: returns a known type, or throws and exception. In Python it's legal to have a function that can return 0 or return "hello" or nothing at all.
- mb21 15y agoI don't understand. I can't tell if you are arguing for or against explicit returns. Can you elaborate?
- silentbicycle 15y agoI suspect he read "typing return" as "return having one specific type" (i.e., "return an int (not string, float, etc.)". That's a different (but related) issue.