Logo Search packages:      
Sourcecode: python-biopython version File versions

Bio::EUtils::MultiDict::OrderedMultiDict Class Reference

Inheritance diagram for Bio::EUtils::MultiDict::OrderedMultiDict:

List of all members.

Detailed Description

Store key/value mappings.

Acts like a standard dictionary with the following features:
   - duplicate keys are allowed;

   - input order is preserved for all key/value pairs.

>>> od = OrderedMultiDict([("Food", "Spam"), ("Color", "Blue"),
...                        ("Food", "Eggs"), ("Color", "Green")])
>>> od["Food"]
>>> od.getall("Food")
['Spam', 'Eggs']
>>> list(od.allkeys())
['Food', 'Color', 'Food', 'Color']

The order of keys and values(eg, od.allkeys() and od.allitems())
preserves input order.

Can also pass in an object to the constructor which has an
allitems() method that returns a list of key/value pairs.

Definition at line 152 of file MultiDict.py.

Public Member Functions

def __contains__
def __delitem__
def __eq__
def __getitem__
def __init__
def __iter__
def __len__
def __ne__
def __repr__
def __setitem__
def __str__
def allitems
def allkeys
def allvalues
def get
def getall
def items
def keys
def values

Public Attributes


The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index