ValueMap¶
- class dsviper.ValueMap¶
Bases:
objectA class used to represent a value of type map<key_type, element_type>. Seamless with a Python dict[object, object].
Or use Value.create(type_map [, initial_value]).
- at(key: _InputValues, *, encoded: bool = True) _OutputValues¶
Return the value for a key.
- clear() None¶
Remove all items.
- contains(key: _InputValues) bool¶
Return True if the value is present.
- discard(key: _InputValues) None¶
Remove the key if present.
- empty() bool¶
Return True if the container is empty.
- get(key: _InputValues, default: _InputValues | None = None) None | _OutputValues¶
Return the value associated with the key or default.
- hash() int¶
Return the hash value.
- items(*, encoded: bool = True) ValueMapItemsIter¶
Return a MapItemsIter.
- keys(*, encoded: bool = True) ValueMapKeysIter¶
Return a MapKeysIter.
- max(*, encoded: bool = True) _OutputValues¶
Return the max key.
- min(*, encoded: bool = True) _OutputValues¶
Return the min key.
- pop(key: _InputValues, default: _InputValues | None = None, *, encoded: bool = True) _OutputValues¶
Remove the key and return the corresponding value. If the key is not found, return the default if given; otherwise raise.
- popitem() ValueTuple¶
Remove and return a (key, value) pair as a 2-tuple. Raises error if the map is empty.
- remove(key: _InputValues) None¶
Remove the key or raises.
- representation() str¶
Return the representation.
- set(key: _InputValues, value: _InputValues) None¶
Set the value for a key.
- setdefault(key: _InputValues, value: _InputValues) None¶
Insert the value for the key if the key is not in the map. Return the value for the key if the key is in the map, else default.
- size() int¶
Return the number of elements.
- type_code() str¶
Return the type code.
- update(value: _InputValues) None¶
for k, v in other: self[key] = v.
- values(*, encoded: bool = True) ValueMapValuesIter¶
Return a MapValuesIter.