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

Bio::EUtils::MultiDict::UnorderedMultiDict Class Reference

Inheritance diagram for Bio::EUtils::MultiDict::UnorderedMultiDict:

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 values of a given
       key but not between different keys.

>>> ud = UnorderedMultiDict([("Food", "Spam"), ("Color", "Blue"),
...                          ("Food", "Eggs"), ("Color", "Green")])
>>> ud["Food"]
'Eggs'
>>> ud.getall("Food")
['Spam', 'Eggs']
>>>

The order of values from a given key (as from ud.getall("Food"))
is guaranteed but the order between keys (as from od.allkeys()
and od.allitems()) is not.

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 225 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

 data

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

Generated by  Doxygen 1.6.0   Back to index