``odict.byindex (index)``
For this API, I think it's important to make some performance
guarantees. It seems fairly difficult to make byindex O(1), and
simultaneously also make insertion/deletion better than O(n).
IOW, the PEP should somehow specify which operations are efficient,
and which ones aren't.
Regards,
Martin
>
Index-based lookup is supported by ``byindex()`` which returns
the key/value pair for an index, that is, the "position" of a
key in the ordered dict. 0 is the first key/value pair, -1
the last.
>
('foo', 'bar')
Index-based lookup is supported by ``byindex()`` which returns
the key/value pair for an index, that is, the "position" of a
key in the ordered dict. 0 is the first key/value pair, -1
the last.
>
>>d.byindex(2 )
guarantees. It seems fairly difficult to make byindex O(1), and
simultaneously also make insertion/deletion better than O(n).
IOW, the PEP should somehow specify which operations are efficient,
and which ones aren't.
Regards,
Martin
Comment