[Python-3000] PEP 3100 Comments

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Wed May 10 20:27:43 CEST 2006


"Phillip J. Eby" <pje at telecommunity.com> writes:

> Note that if the notion of "interface" is reduced to "a set of generic
> functions to which an object may be passed", then it's not necessary
> to have explicit interface declaration - it's an automatic side effect
> of implementing methods for the generic functions involved.

Right. So I must correct myself: it's not an either-or choice for
the entire language, but for each interface separately.

There are formalized interfaces or abstract supertypes which can be
used for dispatch, and are usually declared explicitly (or at least
computed from other explicit interfaces); and informal interfaces or
predicates, not reified in the program but present in the programmers'
minds.

The choice is which concrete interfaces are of the first kind,
and which are of the second kind. For example whether sequences
or file-like objects are explicit.

Note that being declared explicitly doesn't imply that they would have
to be declared right at the point where the type is implemented. They
should be possible to be added later.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Python-3000 mailing list