Skip to content

Instantly share code, notes, and snippets.

@jsbueno
Created February 27, 2026 14:41
Show Gist options
  • Select an option

  • Save jsbueno/8aeaa5eea2e7e62d2390264ee8783dad to your computer and use it in GitHub Desktop.

Select an option

Save jsbueno/8aeaa5eea2e7e62d2390264ee8783dad to your computer and use it in GitHub Desktop.
Python3.15 parse Json as deep-imutable data structure:
import json
frozen = json.loads(
json_str, object_hook=lambda dct: frozendict({k: (tuple(v) if isinstance(v, list) else v) for k, v in dct.items()}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment