Created
February 27, 2026 14:41
-
-
Save jsbueno/8aeaa5eea2e7e62d2390264ee8783dad to your computer and use it in GitHub Desktop.
Python3.15 parse Json as deep-imutable data structure:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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