socek

Untitled

May 5th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. class Application(object):
  2.  
  3.     def __init__(self):
  4.         print('-> init application')
  5.         self.do_init()
  6.         print('<- init application')
  7.  
  8.  
  9.     def do_init(self):
  10.         print('1. app')
  11.  
  12.  
  13. class SecondApp(Application):
  14.  
  15.     def do_init(self):
  16.         print('-> 2. SecondApp')
  17.         super().do_init()
  18.         print('<- 2. SecondApp')
  19.  
  20.  
  21. class ThirdApp(Application):
  22.  
  23.     def do_init(self):
  24.         print('-> 3. ThirdApp')
  25.         super().do_init()
  26.         print('<- 3. ThirdApp')
  27.  
  28.  
  29. class FourApp(ThirdApp):
  30.  
  31.     def do_init(self):
  32.         print('-> 4. FourApp')
  33.         super().do_init()
  34.         print('<- 4. FourApp')
  35.  
  36.  
  37. class FiveApp(ThirdApp):
  38.  
  39.     def do_init(self):
  40.         print('-> 5. FiveApp')
  41.         super().do_init()
  42.         print('<- 5. FiveApp')
  43.  
  44.  
  45. class FinApp(SecondApp, FourApp, FiveApp):
  46.  
  47.     def do_init(self):
  48.         print('-> FinApp')
  49.         super().do_init()
  50.         print('<- FinApp')
  51.  
  52. testing = FinApp()
Advertisement
Add Comment
Please, Sign In to add comment