collections.defaultdict equivalent implementation of list.
Project description
Documentation
The Documentation is hosted on http://defaultlist.readthedocs.io/en/0.1.0/
Getting started
List extending automatically to the maximum requested length.
Added indicies are filled with None by default.
>>> l = defaultlist() >>> l [] >>> l[2] = "C" >>> l [None, None, 'C'] >>> l[4] >>> l [None, None, 'C', None, None]
Simple factory functions can be created via lambda.
>>> l = defaultlist(lambda: 'empty') >>> l[2] = "C" >>> l[4] 'empty' >>> l ['empty', 'empty', 'C', 'empty', 'empty']
Installation
To install the defaultlist module run:
pip install defaultlist
If you do not have write-permissions to the python installation, try:
pip install defaultlist --user
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
defaultlist-0.1.0.tar.gz
(2.9 kB
view hashes)