> How about Lisp? It seems to do some good there, without getting in > the way.
I don't know much about lisp. But the thing is that one of the most important data structures in python (and basically the only one in LISP), lists, are a big problem to type-checking if they aren't homogenous. So I guess one can write a compiler that generates specialized code for lists of a certain homogenous kind, like lists of int, float and maybe string - and as long as you ensure that code is called with such a list, you're ok. But I think that is what psyco does, too (no idea how these two compare) Basically, all type-inferencing boils down to collecting constraints on variable values. Like in this expression z = x + y It will be internall represented by this: z:C = x:A + y:B which introduces type-variables A,Band C. That tells us that all operations __plus__ and their respective types could be meant, thus A B C are constrained by these types. Which, in an overloading-allowing language, can get pretty much. The trick is to find a solution for the variables that satisfy all the constraints. And a solution are actual types, not ad-hoc sets of types - otherwise, you can't create any specialized code, and the compiler will puke on you. Saying z += 10 now creates a constraint that binds C to int, and subsequently A and B. Now the problem is someting like this: if x is None: x = 10 else: x = x * 10 Lets assume A as type-var for x. Then we have the two contstraints A -> int and A -> None. Now - is there a type that satisfies both constraints? No. And even worse, A shall be int by x = 10 - but that collides with A->None. So the only thing you can do is resort to A=ANY - and interpret that code above :) Diez -- http://mail.python.org/mailman/listinfo/python-list