|
def | __delitem__ (self, key, dict_delitem=dict.__delitem__) |
|
def | __eq__ (self, other) |
|
def | __init__ (self, args, kwds) |
|
def | __iter__ (self) |
|
def | __ne__ (self, other) |
|
def | __reduce__ (self) |
|
def | __repr__ (self, _repr_running={}) |
|
def | __reversed__ (self) |
|
def | __setitem__ (self, key, value, dict_setitem=dict.__setitem__) |
|
def | clear (self) |
|
def | copy (self) |
|
def | fromkeys (cls, iterable, value=None) |
|
def | items (self) |
|
def | iteritems (self) |
|
def | iterkeys (self) |
|
def | itervalues (self) |
|
def | keys (self) |
|
def | pop (self, key, default=__marker) |
|
def | popitem (self, last=True) |
|
def | setdefault (self, key, default=None) |
|
def | update (args, kwds) |
|
def | values (self) |
|
def | viewitems (self) |
|
def | viewkeys (self) |
|
def | viewvalues (self) |
|
Definition at line 18 of file odict.py.
◆ __init__()
def __init__ |
( |
|
self, |
|
|
|
args, |
|
|
|
kwds |
|
) |
| |
Initialize an ordered dictionary. Signature is the same as for
regular dictionaries, but keyword arguments are not recommended
because their insertion order is arbitrary.
Definition at line 30 of file odict.py.
References OrderedDict.__map, OrderedDict.__root, OrderedDict.__update, and len().
30 def __init__(self, *args, **kwds):
31 '''Initialize an ordered dictionary. Signature is the same as for 32 regular dictionaries, but keyword arguments are not recommended 33 because their insertion order is arbitrary. 37 raise TypeError(
'expected at most 1 arguments, got %d' %
len(args))
40 except AttributeError:
41 self.__root = root = []
42 root[:] = [root, root,
None]
44 self.__update(*args, **kwds)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
◆ __delitem__()
def __delitem__ |
( |
|
self, |
|
|
|
key, |
|
|
|
dict_delitem = dict.__delitem__ |
|
) |
| |
Definition at line 56 of file odict.py.
References OrderedDict.__map, and OrderedDict.pop().
56 def __delitem__(self, key, dict_delitem=dict.__delitem__):
57 'od.__delitem__(y) <==> del od[y]' 60 dict_delitem(self, key)
61 link_prev, link_next, key = self.__map.pop(key)
62 link_prev[1] = link_next
63 link_next[0] = link_prev
◆ __eq__()
def __eq__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive
while comparison to a regular mapping is order-insensitive.
Definition at line 237 of file odict.py.
References playtones_def.items, playtones_state.items, ewscal_pvt.items, OrderedDict.items(), notify_option.items, resource_list.items, featuregroup.items, test_config.items, and len().
237 def __eq__(self, other):
238 '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive 239 while comparison to a regular mapping is order-insensitive. 242 if isinstance(other, OrderedDict):
243 return len(self)==
len(other)
and self.items() == other.items()
244 return dict.__eq__(self, other)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
◆ __iter__()
◆ __ne__()
def __ne__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
Definition at line 246 of file odict.py.
246 def __ne__(self, other):
247 return not self == other
◆ __reduce__()
Definition at line 212 of file odict.py.
References OrderedDict.copy().
212 def __reduce__(self):
213 'Return state information for pickling' 214 items = [[k, self[k]]
for k
in self]
215 inst_dict = vars(self).
copy()
216 for k
in vars(OrderedDict()):
217 inst_dict.pop(k,
None)
219 return (self.__class__, (items,), inst_dict)
220 return self.__class__, (items,)
static int copy(char *infile, char *outfile)
Utility function to copy a file.
◆ __repr__()
def __repr__ |
( |
|
self, |
|
|
|
_repr_running = {} |
|
) |
| |
Definition at line 199 of file odict.py.
References id, playtones_def.items, playtones_state.items, ewscal_pvt.items, OrderedDict.items(), notify_option.items, resource_list.items, featuregroup.items, and test_config.items.
199 def __repr__(self, _repr_running={}):
200 'od.__repr__() <==> repr(od)' 201 call_key =
id(self), _get_ident()
202 if call_key
in _repr_running:
204 _repr_running[call_key] = 1
207 return '%s()' % (self.__class__.__name__,)
208 return '%s(%r)' % (self.__class__.__name__, self.items())
210 del _repr_running[call_key]
◆ __reversed__()
Definition at line 73 of file odict.py.
References OrderedDict.__root.
73 def __reversed__(self):
74 'od.__reversed__() <==> reversed(od)' 77 while curr
is not root:
◆ __setitem__()
def __setitem__ |
( |
|
self, |
|
|
|
key, |
|
|
|
value, |
|
|
|
dict_setitem = dict.__setitem__ |
|
) |
| |
Definition at line 46 of file odict.py.
References OrderedDict.__map, and OrderedDict.__root.
46 def __setitem__(self, key, value, dict_setitem=dict.__setitem__):
47 'od.__setitem__(i, y) <==> od[i]=y' 53 last[1] = root[0] = self.__map[key] = [last, root, key]
54 dict_setitem(self, key, value)
◆ clear()
◆ copy()
Definition at line 222 of file odict.py.
Referenced by OrderedDict.__reduce__().
223 'od.copy() -> a shallow copy of od' 224 return self.__class__(self)
static int copy(char *infile, char *outfile)
Utility function to copy a file.
◆ fromkeys()
def fromkeys |
( |
|
cls, |
|
|
|
iterable, |
|
|
|
value = None |
|
) |
| |
OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S
and values equal to v (which defaults to None).
Definition at line 227 of file odict.py.
227 def fromkeys(cls, iterable, value=None):
228 '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S 229 and values equal to v (which defaults to None).
◆ items()
◆ iteritems()
Definition at line 139 of file odict.py.
140 'od.iteritems -> an iterator over the (key, value) items in od'
◆ iterkeys()
Definition at line 130 of file odict.py.
131 'od.iterkeys() -> an iterator over the keys in od'
◆ itervalues()
Definition at line 134 of file odict.py.
Referenced by OrderedDict.clear().
134 def itervalues(self):
135 'od.itervalues -> an iterator over the values in od'
◆ keys()
Definition at line 118 of file odict.py.
119 'od.keys() -> list of keys in od'
◆ pop()
def pop |
( |
|
self, |
|
|
|
key, |
|
|
|
default = __marker |
|
) |
| |
od.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
Definition at line 179 of file odict.py.
References OrderedDict.__marker.
Referenced by OrderedDict.__delitem__().
179 def pop(self, key, default=__marker):
180 '''od.pop(k[,d]) -> v, remove specified key and return the corresponding value. 181 If key is not found, d is returned if given, otherwise KeyError is raised. 188 if default
is self.__marker:
◆ popitem()
def popitem |
( |
|
self, |
|
|
|
last = True |
|
) |
| |
od.popitem() -> (k, v), return and remove a (key, value) pair.
Pairs are returned in LIFO order if last is true or FIFO order if false.
Definition at line 93 of file odict.py.
References OrderedDict.__map, and OrderedDict.__root.
93 def popitem(self, last=True):
94 '''od.popitem() -> (k, v), return and remove a (key, value) pair. 95 Pairs are returned in LIFO order if last is true or FIFO order if false. 99 raise KeyError(
'dictionary is empty')
113 value = dict.pop(self, key)
◆ setdefault()
def setdefault |
( |
|
self, |
|
|
|
key, |
|
|
|
default = None |
|
) |
| |
Definition at line 192 of file odict.py.
192 def setdefault(self, key, default=None):
193 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od'
◆ update()
def update |
( |
|
args, |
|
|
|
kwds |
|
) |
| |
od.update(E, **F) -> None. Update od from dict/iterable E and F.
If E is a dict instance, does: for k in E: od[k] = E[k]
If E has a .keys() method, does: for k in E.keys(): od[k] = E[k]
Or if E is an iterable of items, does: for k, v in E: od[k] = v
In either case, this is followed by: for k, v in F.items(): od[k] = v
Definition at line 144 of file odict.py.
References len().
144 def update(*args, **kwds):
145 '''od.update(E, **F) -> None. Update od from dict/iterable E and F. 147 If E is a dict instance, does: for k in E: od[k] = E[k] 148 If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] 149 Or if E is an iterable of items, does: for k, v in E: od[k] = v 150 In either case, this is followed by: for k, v in F.items(): od[k] = v 154 raise TypeError(
'update() takes at most 2 positional ' 155 'arguments (%d given)' % (
len(args),))
157 raise TypeError(
'update() takes at least 1 argument (0 given)')
163 if isinstance(other, dict):
165 self[key] = other[key]
166 elif hasattr(other,
'keys'):
167 for key
in other.keys():
168 self[key] = other[key]
170 for key, value
in other:
172 for key, value
in kwds.items():
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
◆ values()
Definition at line 122 of file odict.py.
123 'od.values() -> list of values in od' 124 return [self[key]
for key
in self]
◆ viewitems()
Definition at line 259 of file odict.py.
260 "od.viewitems() -> a set-like object providing a view on od's items" 261 return ItemsView(self)
◆ viewkeys()
Definition at line 251 of file odict.py.
252 "od.viewkeys() -> a set-like object providing a view on od's keys" 253 return KeysView(self)
◆ viewvalues()
Definition at line 255 of file odict.py.
255 def viewvalues(self):
256 "od.viewvalues() -> an object providing a view on od's values" 257 return ValuesView(self)
The documentation for this class was generated from the following file: