Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Abstract Methods & Abstract Class

Thread Tools

Re: Abstract Methods & Abstract Class

Gerald Klix
Posts: n/a

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

the right thing to do?


----- Original Message -----
From: "Andreas Kostyrka" <(E-Mail Removed)>
To: "Iyer, Prasad C" <(E-Mail Removed)>
Cc: <(E-Mail Removed)>
Sent: Thursday, October 20, 2005 8:56 AM
Subject: Re: Abstract Methods & Abstract Class

> 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
> --

Reply With Quote
Posts: n/a

def method(self):
assert not "must be overrided"

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to find the class methods of a class, just like'methods' finds the instance methods? Kenneth McDonald Ruby 5 09-26-2008 03:09 PM
what is the difference between abstract class and pure abstract class? C++ 4 05-17-2006 08:07 AM
Abstract Methods & Abstract Class Iyer, Prasad C Python 0 10-20-2005 06:35 AM
Deriving abstract class from non-abstract class Matthias Kaeppler Java 1 05-22-2005 01:28 PM
Abstract Classes w/o abstract methods DaKoadMunky Java 4 04-20-2004 04:53 AM