fork download
  1. class dictObj(object):
  2. def __init__(self):
  3. self.x = 'red'
  4. self.y = 'Yellow'
  5. self.z = 'Green'
  6. def do_nothing(self):
  7. pass
  8. test = dictObj()
  9. print(test.__dict__)
Success #stdin #stdout 0.02s 9140KB
stdin
Standard input is empty
stdout
{'x': 'red', 'y': 'Yellow', 'z': 'Green'}