Skip to content

Instantly share code, notes, and snippets.

@Bas-Man
Last active May 11, 2020 11:33
Show Gist options
  • Save Bas-Man/2cafb068e76936dc5f43b308e710b252 to your computer and use it in GitHub Desktop.
Save Bas-Man/2cafb068e76936dc5f43b308e710b252 to your computer and use it in GitHub Desktop.
return json string for complex python objects

Link found here

example usage in my case

def json():
  return json.dumps(self.__dict__,default=lambda o: o.__dict__,
                    ensure_ascii=False,indent=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment