does lack of type declarations make Python unsafe?

David Abrahams dave at
Wed Jun 18 16:25:54 CEST 2003

Alex Martelli <aleax at> writes:

> But this has little to do with the need of 'type declarations'.  I
> suspect that a statically typed language would also be better off
> without them, relying on type inferencing instead, a la Haskell (and
> Haskell's typeclasses to keep the inferencing as wide as feasible),
> for example.  But I have no research to back this up;-).

I don't have any first-hand experience, but the experience of friends
of mine who have used Haskell is that it can be exceedingly difficult
to locate the source of a type error when it does occur, since the
inference engine may propagate the "wrong" type back much further than
the source of the error.

Furthermore, if you do everything by inference you lose the
explanatory power of type declarations.

Dave Abrahams
Boost Consulting

More information about the Python-list mailing list