interfaces?
Syver Enstad
syver at NOSPAMcyberwatcher.com
Sun Feb 4 15:50:07 EST 2001
"Chris Tavares" <ctavares at develop.com> wrote > I think that the Smalltalk
approach to interfaces would be more appropriate
> for Python than the Java one - dynamic vs. static and all.
>
> The equivalent code in Python would be:
>
> class IDontDoAnything:
> def UselessMethod(self):
> return self.SubclassResponsibility()
Wouldn't you rather do it like this in Python:
class IDontDoAnything:
def UselessMethod(self):
raise NotImplementedError()
More information about the Python-list
mailing list