Indexable Dictionary Recipe¶
-
class
sortedcollections.
IndexableDict
(*args, **kwargs)¶ Dictionary that supports numerical indexing.
Keys are numerically indexable using dict views. For example:
>>> indexable_dict = IndexableDict.fromkeys('abcde') >>> keys = indexable_dict.keys() >>> sorted(keys[:]) == ['a', 'b', 'c', 'd', 'e'] True
The dict views support the sequence abstract base class.