Abstract Methods & Abstract Class

Andreas Kostyrka andreas at kostyrka.org
Thu Oct 20 02:56:44 EDT 2005


On Thu, Oct 20, 2005 at 12:05:05PM +0530, Iyer, Prasad C wrote:
> 
> Do we have something like abstract methods & Abstract class.
> 
> So that my class would just define the method. And the implementation
> would be defined by somebody else.

class AbstractBase:
    def method(self):
        raise TypeError("abstract method called")

But basically, Python does not have abstract methods, and usually doesn't
need them.

Andreas



More information about the Python-list mailing list