Menu

Lists

SHMolyneaux

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 a string "List(%s)" where %s is repr(self.__key__)

__repr__()

  • functional the same as __str__.

Related

Wiki: Conventions
Wiki: Dicts, Lists, and Objects Basics
Wiki: Getting Started Explanation
Wiki: Links
Wiki: PStorBaseObject
Wiki: Table of Contents
Wiki: Usable Python Types

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.