An ordered map that accepts non-hashable types for keys. It also maintains the insertion order of items, behaving as OrderedDict in that regard. These maps are constructed and read just as normal mapping types, exept that they may contain arbitrary collections and other non-hashable items as keys:
>>> od = OrderedMap([({'one': 1, 'two': 2}, 'value'), ... ({'three': 3, 'four': 4}, 'value2')]) >>> list(od.keys()) [{'two': 2, 'one': 1}, {'three': 3, 'four': 4}] >>> list(od.values()) ['value', 'value2']
These constructs are needed to support nested collections in Cassandra 2.1.3+, where frozen collections can be specified as parameters to others*:
CREATE TABLE example ( ... value map<frozen<map<int, int>>, double> ... )
This class derives from the (immutable) Mapping API. Objects in these maps are not intended be modified.
* Note: Because of the way Cassandra encodes nested types, when using the driver with nested collections, protocol_version
must be 3 or higher.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4