Are there 'Interfaces' in Python??

Brian Quinlan BrianQ at ActiveState.com
Wed Sep 26 20:23:49 EDT 2001


Lee wrote:

> A previous poster also suggested mutiple inheritance that
> raises errors when methods aren't implemented. That
> implementation mean you get errors only at runtime when
> the method is called.
>
> I'd like to see interfaces to make this error checking
> explicit at byte-compile time.

Aside from the fact that this would not fit at all with the rest of
Python, from a philosophical point of view, it would also require a
complete revamp of the Python compilation semantics to work (imports
would have to be evaluated a compile-time, type-checking would have to
be done at compile-time, etc.).

Paul Prescod (leader of the types SIG) has done some thinking about
interfaces in Python but, in his model, they would be runtime
constructs like everything else.

Actually, the more I think about, the more your idea horrifies me :-)

Cheers,
Brian





More information about the Python-list mailing list