Re: Static typing in Python
I think this tells more about habits than anything fundamental in a language. Static typing is primarily an aid for the compiler which optimise based around it. While I have had plenty of facepalm moments when passing the values with the wrong types into a function, raising an exception at some point, the return value has never been an issue; this could happen in any runtime and would not necessarily be avoided by static typing. There is something to be said about not being able to explicitly return an error value in Python but other than that it's not something people discuss.
My own experience has been that I much prefer tests, preferably using pytest, to understand how code works over any kind of comment or declaration. This gently encourages code that is easier to read and maintain, which in turn leads to fewer problems.
But I would have no problem with something like a returning
keyword for the definition. Anything is better than the type hints noise! I think we may get an idea of what works best in Mojo where the declarations necessary for optimisation are explicitly optional.