Advertisement
Guest User

Untitled

a guest
May 4th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. class Collection():
  2. def __init__(self, db):
  3. self.x = db
  4.  
  5. def printDbName(self):
  6. print self.x
  7.  
  8. parent = Collection('hkpr')
  9.  
  10. parent.printDbName()
  11.  
  12. class Document(Collection):
  13. def __init__(self, db):
  14. self.db = db
  15. Collection.__init__(self, self.db)
  16.  
  17. def printChild(self):
  18. print self.x
  19.  
  20. child = Document('yabba')
  21. child.printChild()
  22. child.printDbName()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement