Relative Content

Tag Archive for pythonjsondictionary

loading dictionary using json and method chaining

first way:
original = json.loads(path.read_text())
original.update(users)
in the first way, json loads a dictionary into a the ‘original’ variable. then we update the ‘original’ dictionary with users.
second way:
original = json.loads(path.read_text()).update(users)
this second way does not work. it returns None. why does it not work?