Bases: _abcoll.MutableMapping
A class which behaves like a dictionary.
Parameters: | data (dict, optional) Dictionary with initial keywords. |
---|
Basic Usage
You may use the following syntax to change or access data in this class.
>>> stats = AttribDict()
>>> stats.network = 'BW'
>>> stats['station'] = 'ROTZ'
>>> stats.get('network')
'BW'
>>> stats['network']
'BW'
>>> stats.station
'ROTZ'
>>> x = stats.keys()
>>> x = sorted(x)
>>> x[0:3]
['network', 'station']
Attributes
__abstractmethods__ | frozenset() -> empty frozenset object |
__dict__ | |
__doc__ | str(object) -> string |
__hash__ | |
__module__ | str(object) -> string |
__weakref__ | list of weak references to the object (if defined) |
defaults | dict() -> new empty dictionary |
readonly | list() -> new empty list |
Public Methods
clear | |
copy | |
get | |
items | |
iteritems | |
iterkeys | |
itervalues | |
keys | |
pop | |
popitem | |
setdefault | |
update | |
values |
Private Methods
_pretty_str | Return better readable string representation of AttribDict object. |
Special Methods
__contains__ | |
__deepcopy__ | |
__delattr__ | |
__delitem__ | |
__eq__ | |
__getattr__ | |
__getitem__ | |
__getstate__ | |
__init__ | An AttribDict can be initialized in two ways. It can be given an |
__iter__ | |
__len__ | |
__ne__ | |
__repr__ | |
__setattr__ | |
__setitem__ | |
__setstate__ | |
__subclasshook__ |