Dicts - shmolyneaux/SquareJam GitHub Wiki
Dict inherits from PStorBaseObject. It has be designed to replicate the functionality of standard python dictionaries, but on a persistent database.
The class contains the following methods:
__init____len____getitem____setitem__getcontents__str____repr____add____delitem____contains__iterclearcopyfromkeysgethas_keyitemskeysvaluesiteritemsiterkeyspoppopitemupdatesetdefault
Members
All of the names of the above methods are added to __reserved__ from PStorBaseObject except for __init__ and getcontents (though these may be an error). contents is also appended to __reserved__ though it isn't a method - this may be an issue.
Methods
Except for the listed methods below, Dict methods should behave the same way as standard dictionaries. See the python documentation for detail on methods that have not been listed below.
_init_( connection, key )
- creates a reference object that refers to a mutable object in the persistent storage system.
getcontents()
- returns a list containing the
__key__of each attribute.
keys()
- returns a list of keys as opposed to a View in standard python 3
_str_()
- returns
Dict(%s)where%sisrepr(self.__key__).
_repr_()
- functional the same as
__str__.
_add_()
- not implemented in python 3, and currently does not work. This is a known issue.