Guest User

Untitled

a guest
Jan 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. def to_dict(self):
  2. return dict({'identification': self.identifier,
  3. 'information': self.information,
  4. 'nodes': {e.position: e.to_dict for e in self.children}
  5. })
  6.  
  7. def to_dict(self):
  8. return dict({'identification': self.identifier,
  9. 'information': self.information,
  10. 'nodes': {e.position: e.to_dict for e in self.children} if self.children
  11. })
  12.  
  13. def to_dict(self):
  14. retval = {'identification': self.identifier,
  15. 'information': self.information,
  16. }
  17. if self.children:
  18. retval['nodes'] = {e.position: e.to_dict for e in self.children}
  19. return retval
  20.  
  21. def to_dict(self):
  22. retval = dict(identification=self.identifier,
  23. information=self.information)
  24. if self.children:
  25. retval['nodes'] = {e.position: e.to_dict for e in self.children}
  26. return retval
Add Comment
Please, Sign In to add comment