Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python2
- # -*- coding:utf-8 -*-
- from __future__ import print_function, division, unicode_literals
- class AInterface(object):
- def methodA(self, args):
- raise Exception("Interface method needs to be implemented")
- class BInterface(object):
- def methodB(self, args):
- raise Exception("Interface method needs to be implemented")
- class BAbstract(AInterface):
- cname = "Base"
- def __init__(self, something):
- self.something = something
- class B(BAbstract, BInterface):
- def __init__(self, something):
- super(B, self).__init__(something)
- def methodA(self, args):
- pass
- def methodB(self, args):
- pass
- if __name__ == "__main__":
- b = B("something")
- b.methodA("x")
- # vim: ts=4 sw=4 sts=4 expandtab
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement