Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class foo:
- def __init__(self,name):
- self.name = name
- #other attributes
- self.children = [] #Child objects in self.children
- def convert(self):
- return vars(self)
- {'name': 'name', 'children': [object1,object2...]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement