[Python-Dev] PEP 246: let's reset

Guido van Rossum gvanrossum at gmail.com
Sun Jan 16 18:15:35 CET 2005


The various PEP 246 threads are dead AFAIC -- I won't ever have the
time to read them in full length, and because I haven't followed them
I don't get much of the discussion that's still going on.

I hear that Clark and Alex are going to do a revision of the PEP; I'm
looking forward to the results.

In the mean time, here's a proposal to reduce the worries about
implicit adaptation: let's not do it!

Someone posted a new suggestion to my blog: it would be good if an
optimizing compiler (or a lazy one) would be allowed to ignore all
type declarations, and the program should behave the same
(except for things like catching TypeError). This rules out using
adapt() for type declarations, and we're back to pure typechecking.
Given the many and various issues with automamtic adaptation
(transitivity, lossiness, statelessness, and apparently more still)
that might be a better approach.

Typechecking can be trivially defined in terms of adaptation:

def typecheck(x, T):
   y = adapt(x, T)
   if y is x:
       return y
   raise TypeError("...")

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list