[Python-Dev] type categories

Guido van Rossum guido@python.org
Mon, 26 Aug 2002 12:05:26 -0400


> > OTOH I want a solution that can be verified at compile time.
> 
> Here I don't get what you are referring to.

Not specifically to your proposal.

> I have indicated some possible
> sloppy interpretations but just in order to care for transitioning code. But
> under the precise interpretation they are checkable
> (maybe it is costly and complex to do so and that's your point?):
> 
> class Source:
>   def read(self):
>    ...
> 
>  # other methods
> 
> e.g. could declare to implement partially FileLike (that means
> the matching subset of signatures), or be very precise
> and declare that it implements   FileLike{read}
> 
> and FileLike{read} given FileLike has a very precise
> interpretation even at compile-time.

That's great.

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