[Types-sig] lambdas, classes, tuples, default arguments, map

Jeremy Hylton jeremy@cnri.reston.va.us
Fri, 21 Jan 2000 13:03:10 -0500 (EST)

>>>>> "TL" == Tony Lownds <tony@metanet.com> writes:

  TL> 5. map has a function signature that is pretty hard to declare,
  TL> even with parameterization of functions. I hope it will be
  TL> special-cased rather than under-specified.

We can write functions like map in dynamically typed Python, but I
don't have much hope that we'll be able to write statically checkable
types for these functions.  (Happy to be proved wrong.)  The hard
problem is the combination of *args and polymorphic types.  The
type of one argument implies some constraint on the *number* or types
of the other arguments.  (I think Tim posted an extended example of
the problem for map, but I can't find it at the moment.)

If we can't write statically check these types, then it appears that
any module that includes them can never be a statically checked
module.  (Assuming for the moment Guido's definition: "The Python
implementation should guarantee that a checked module cannot raise
TypeError and similar exceptions...")  This leads to my worry that
performance could be worse with partial static typing that it is with
all runtime typechecks.