callable virtual method

Jean-Michel Pichavant jeanmichel at
Sun Aug 16 16:13:46 CEST 2009

Christian Heimes wrote:
> Jean-Michel Pichavant wrote:
>> talking about approaches:
>> 1/
>> class Interface:
>>     def foo(self):
>>        if ==
>>           raise NotImplementedError
>> 2/
>> class Interface:
>>     def foo(self):
>>        self._foo()
>>     def _foo(sef):
>>        raise NotImplementedError
> Please don't call it an interface when it's really an abstract base 
> class. And abstract base classes are probably the solution the OP is 
> looking for,
> Christian
Sadly I'm working with python 2.4. Anyway it's good to hear they've 
added ABC support to python, didn't know that. I didn't know there was a 
difference between interface and abstract classes as well. With a little 
bit of googling, I found out that actually Interface classes do not 
provide any implementation.
What I'm looking for is definitely an abstract class.


More information about the Python-list mailing list