python decorator and interface

from functools import wraps

def interface (fn):
    def to_be_implemented (*args):
        raise Exception ("Interface '%s' is not implemented!" % fn.__name__)
    return to_be_implemented

class Foo (object):
    def test (self): pass

class Bar(Foo):
    def test (self): pass

class Qux(Foo):


Leave a Reply

Your email address will not be published. Required fields are marked *

To submit your comment, click the image below where it asks you to...
Clickcha - The One-Click Captcha