Skip to content

Feat file backed dict#9

Closed
Poofjunior wants to merge 2 commits into
mainfrom
feat-file-backed-dict
Closed

Feat file backed dict#9
Poofjunior wants to merge 2 commits into
mainfrom
feat-file-backed-dict

Conversation

@Poofjunior

@Poofjunior Poofjunior commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Vibe-code hierarchical, saveable dict. (I made some edits and wrote the tests.) This is a useful pattern, though we might revisit it with models later. This repo seems to be the best spot for it for now.

  • FileBackedDicts are dict-like objects that are created from file (yaml or json)
  • Once loaded from a file, FileBackedDicts can be manipulated like dicts.
  • FileBackedDicts can contain FileBackedDicts ("subdicts"). These subdicts
    have their own save() method.
    • Calling save() from a subdict only saves the keys/values in the scope
      of the subdict to the original file.
    • Calling save() from a parent dict also saves any keys/values altered
      by the child. (This is consistent with how normal dicts work.)
    • FileBackedDicts can be converted to plain dictionaries with to_dict().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant