Skip to content

MNayer/fsdict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FSDict

Design principles

  1. Every key of a fsdict must be of type 'str' or 'FunctionType'.
  2. A fsdict may not be part of a list.
  3. A fsdict may contain other fsdicts.
  4. Dictionaries in python are passed by reference; so are fsdicts. By default an fsdict is always passed by refernece. That is, its values are not copied but the fsdict is symlinked to the new position.

Internals

Keys of type 'str' work just as normal dictionary keys. Keys of type 'FunctionType' are used as filters for the keys of an fsdict. So

dictionary[lambda key: "foo" in key]

would return a generator which yields the values for keys which contain the string 'foo'.

Possible value types and how they are handled:

  • fsdict - a directory
  • 'bytes' type - written to file as is
  • any other python object (except for 'bytes') - pickled

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published