Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. def converDictionary(dict):
  2. keys = dict.keys()
  3. values = dict.values()
  4. new_keys = []
  5. new_values = []
  6.  
  7. for key in keys:
  8. if key is None:
  9. key = convertNone()
  10. if isinstance(key, bool):
  11. key = convertBoolean(key)
  12. if isinstance(key, tuple):
  13. raise ValueError("Ошибка. Кортеж не может быть ключом в объекте json")
  14. new_keys.append(key)
  15.  
  16. for value in values:
  17. if value is None:
  18. value = convertNone()
  19. if isinstance(value, bool):
  20. value = convertBoolean(key)
  21. if isinstance(value, tuple):
  22. value = convertTuple(value)
  23. if isinstance(value, dict):
  24. valus = convertDictionary(value)
  25. new_values.append(value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement