Skip to content

Instantly share code, notes, and snippets.

@weakish
Created January 11, 2020 11:54
Embed
What would you like to do?
Fast dump to pretty formatted JSON file.
def dump_to_pretty_json_file(thing: Any, file: TextIO) -> None:
"""Fast dump to pretty formatted JSON file."""
json.dump(thing, file,
check_circular=False, allow_nan=False,
indent=2, separators=(',', ': '))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment