Package schrodinger :: Package application :: Package desmond :: Module energygroup :: Class PairDict
[hide private]
[frames] | no frames]

Class PairDict

PairDict is a special dictionary that treats pairs with the same element as equals, independent of order.

For a general dictionary, D[(1,2)] and D[(2,1)] are two different elements. They are considered as the same element in PairDict.

Instance Methods [hide private]
 
__init__(self)
 
__cmp__(self, key1, key2)
 
__contains__(self, key)
 
__delitem__(self, key)
 
__eq__(self, key1, key2)
 
__ge__(self, key1, key2)
 
__getitem__(self, key)
 
__len__(self)
 
_reorder(self, key)
 
__setitem__(self, key, value)
 
clear(self)
 
copy(self)
 
get(self, key, default=None)
True if D has a key k, else False
has_key(D, k)
list of D's (key, value) pairs, as 2-tuples
items(D)
an iterator over the (key, value) items of D
iteritems(D)
an iterator over the keys of D
iterkeys(D)
an iterator over the values of D
itervalues(D)
list of D's keys
keys(D)
v, remove specified key and return the corresponding value
pop(D, k, d=...)
If key is not found, d is returned if given, otherwise KeyError is raised
(k, v), remove and return some (key, value) pair as a
popitem(D)
2-tuple; but raise KeyError if D is empty
D.get(k,d), also set D[k]=d if k not in D
setdefault(D, k, d=...)
 
update(self, other_pair_dict)
list of D's values
values(D)
 
fromkeys(self, keys, v=None)