PEP 245
Carlos Alberto Reis Ribeiro
cribeiro at mail.inet.com.br
Sun Apr 1 23:22:18 EDT 2001
At 16:29 01/04/01 -0700, Alex Shindich wrote:
>I do not want to restart the whole discussion on the difference between
>base classes and interfaces, but I am of the opinion that they both
>represent an is-a relationship.
Almost... base classes represent an "is-a" relationship. Interface
implementation represent an "work-as" relatioship (if there is anything
like this :-).
>Arguably, this behavior is already available through runtime method
>binding.
That's right. I was just saying that I prefer it to stay this way.
>This makes interfaces to be as good as doc strings...
In a sense, yes. In a dynamic typed language almost nothing is enforced;
there's the language syntax and nothing else. The documentation is the last
resort. Readability also helps a lot. If the interface support makes for
more readable code, then I'm all for it, if just for this reason.
Carlos Ribeiro
More information about the Python-list
mailing list