Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
gaius
· 15y ago · 0 comments
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.
Comments
[–]
mb21
15y ago
I don't understand. I can't tell if you are arguing for or against explicit returns. Can you elaborate?
[–]
silentbicycle
15y ago
I 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.