From my
deeply uneducated standpoint it seems to me like this wouldn't be a
horribly hard thing to do, to add static typing or enforced types to
python.
From a programmer's perspective, I /don't/ see it as easy to add
support for static typing to Python. It really must be all there or
all /not/. And having it /not/ is one of the beauties of Python. It
also made it slower. However, it's a tradeoff the language
designer(s) always have to make; it can't really happen at the coders'
level.
I suppose you could do things like:
def my_func(in):
if type(in) != type(""): raise ValueError()
. . . which emulate static types, but is still not a compile-time
error. In my early Python libraries, I found I was doing something of
this sort because I wanted it to be robust, even at the cost of
performance (this is a case where C++ wins: C++ is plenty fast, you
don't have to do this particular kind of error checking, and you can
put #ifdef/#endif around error-checking sections so that the code
isn't even /there/ when you don't want it).