Advertisement
Guest User

javish.py

a guest
May 5th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. #!/usr/bin/env python2
  2. # -*- coding:utf-8 -*-
  3. from __future__ import print_function, division, unicode_literals
  4.  
  5.  
  6. class AInterface(object):
  7.     def methodA(self, args):
  8.         raise Exception("Interface method needs to be implemented")
  9.  
  10.  
  11. class BInterface(object):
  12.     def methodB(self, args):
  13.         raise Exception("Interface method needs to be implemented")
  14.  
  15.  
  16. class BAbstract(AInterface):
  17.  
  18.     cname = "Base"
  19.  
  20.     def __init__(self, something):
  21.         self.something = something
  22.  
  23.  
  24. class B(BAbstract, BInterface):
  25.  
  26.     def __init__(self, something):
  27.         super(B, self).__init__(something)
  28.  
  29.     def methodA(self, args):
  30.         pass
  31.  
  32.     def methodB(self, args):
  33.         pass
  34.  
  35.  
  36. if __name__ == "__main__":
  37.  
  38.     b = B("something")
  39.     b.methodA("x")
  40.  
  41. # vim: ts=4 sw=4 sts=4 expandtab
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement