[Python-Dev] type categories

Samuele Pedroni Samuele Pedroni" <pedroni@inf.ethz.ch
Mon, 26 Aug 2002 17:59:59 +0200

> [me]
> > E.g.
> > my ideas of declaring partial conformance and of super-interfaces
> > identified as a base-interface plus a subset of signatures do not
> > fit so well in a just-abstract-classes model. But OTOH I insist,
> > IMO, given how python code is written now, they would be handy
> > although complex.
> Yes, I'll have to think about that idea some more.  It's appealing
> because it matches current Pythonic practice better than anything
> else.

Thanks, I was under the impression nobody cared. In the end you could discard
the notion, the semantics are maybe too complex, but I think it is really worth
some thinking.

> OTOH I want a solution that can be verified at compile time.

Here I don't get what you are referring to. 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.