specio.core.Dict¶
-
class
specio.core.
Dict
(**kwds)[source][source]¶ A dict in which the keys can be get and set as if they were attributes. Very convenient in combination with autocompletion.
This Dict still behaves as much as possible as a normal dict, and keys can be anything that are otherwise valid keys. However, keys that are not valid identifiers or that are names of the dict class (such as ‘items’ and ‘copy’) cannot be get/set as attributes.
-
__init__
(**kwds)[source]¶ Initialize an ordered dictionary. The signature is the same as regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary.
Methods
__init__
(**kwds)Initialize an ordered dictionary. clear
()copy
()fromkeys
(S[, v])If not specified, the value defaults to None. get
(k[,d])has_key
(k)items
()iteritems
()od. iterkeys
()itervalues
()od. keys
()pop
(k[,d])value. popitem
()Pairs are returned in LIFO order if last is true or FIFO order if false. setdefault
(k[,d])update
([E, ]**F)If E present and has a . values
()viewitems
()viewkeys
()viewvalues
()-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source]¶ If not specified, the value defaults to None.
-
get
(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
-
has_key
(k) → True if D has a key k, else False¶
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source]¶ value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source]¶ Pairs are returned in LIFO order if last is true or FIFO order if false.
-