Fridge is a subclass of dict and thus fully conforms to its interface.
Fridge keeps an open file until it’s closed, so you have to call close() when you’re done using it.
Fridge implements __enter__() and __exit__() so you can use with statement.
Parameters: |
|
---|
path and file arguments are mutually exclusive
Close the fridge. Calls save() and closes the underlying file object unless an already open file was passed to the constructor. This method has no effect if the file is already closed.
After the fridge is closed save() and load() will raise an exception but you will still be able to use it as an ordinary dictionary.