Indexable Set Recipe¶
-
class
sortedcollections.
IndexableSet
(*args, **kwargs)¶ Set that supports numerical indexing.
For example:
>>> indexable_set = IndexableSet('abcde') >>> list(indexable_set) ['d', 'e', 'c', 'b', 'a'] >>> indexable_set[0] 'd' >>> indexable_set[-2:] ['b', 'a']
IndexableSet implements the collections.Sequence interface.