[Types-sig] Static typing: Towards closure?

David Ascher da@ski.org
Thu, 20 Jan 2000 14:39:23 -0800


Martijn Faassen:

> Interfaces can be implied:
>
> class Foo implements Alpha:
[...]
> class Bar implements Alpha:
[..]
> Alpha is now deduced to be the following interface:

This is very odd, IMO.  I'd expect Python not to *deduce* the interface but
to *check* that the interface is indeed being followed.

> These consequences may be advantages during development;
> interfaces (or types) can be quickly and conveniently created and used,
> and they are always _right_; we're not bothered by interface compliance
> errors as the interfaces are implied.

How does the deduced interface get communicated to the programmer, and/or
used?

class MyFileObject implements Stream:
  def read_bytes(numBytes : integer) -> string

class MyOtherFileObject implements Stream:
  def readBytes(numBytes : integer) -> string

leads to an empty interface Stream, due to a typo.  What are the semantic
consequences of the implements statement?

I'm missing the point, I fear.

> I posted earlier to the list on this idea, but either nobody read it,
> nobody understood it or everybody thought it was obviously a bad idea. I'd
> like to be informed on which is the right explanation. :)

First time around, i didn't read it.  This time, I don't understand it. =)

-david