Lists - shmolyneaux/SquareJam GitHub Wiki

List inherits from PStorBaseObject. It has be designed to replicate the functionality of standard python lists, but on a persistent database.

The class contains the following methods:

  • __init__
  • __len__
  • __getitem__
  • __setitem__
  • getcontents
  • __str__
  • __repr__
  • append
  • __add__
  • __delitem__
  • extend
  • count
  • index
  • inset
  • pop
  • remove
  • reverse
  • sort
  • __contains__
  • __iter__
  • __eq__
  • __ne__
  • __gt__
  • __ge__
  • __lt__
  • __le__

Members

All of the names of the above methods are added to __reserved__ from PStorBaseObject except for __init__ (though this may be an error).

Methods

Except for the listed methods below, List 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.

_str_()

  • returns List(%s) where %s is repr(self.__key__).

_repr_()

  • functional the same as __str__.