In Python 2.x when you want to mark a method as abstract, you can define it like so:
class Base:
def foo(self):
raise NotImplementedError(\"Subcl
Yes, you can. Use the @property
decorator. For instance, if you have a field called "example" then can't you do something like this:
class Base(object):
@property
def example(self):
raise NotImplementedError("Subclasses should implement this!")
Running the following produces a NotImplementedError
just like you want.
b = Base()
print b.example