20 Dec
2019
20 Dec
'19
4:34 a.m.
[Nick]
I must admit that I was assuming without stating that a full OrderedSet implementation would support the MutableSequence interface.
Efficient access via index position too would be an enormous new requirement, My bet: basic operations would need to change from O(1) to O(log(N)). BTW, in previous msgs there are links to various implementations calling themselves "ordered sets". One of them supplies O(1) indexing, but at the expense of making deletion O(N) (!): https://pypi.org/project/ordered-set/ If efficient indexing is really wanted, then the original "use case" Larry gave was definitely obscuring an XY problem ;-)