PEP 372 -- Adding an ordered directory to collections
"Martin v. Löwis"
martin at v.loewis.de
Tue Jun 17 01:27:29 EDT 2008
>> For this API, I think it's important to make some performance guarantees.
>
> I may appreciate them for all Python collections :-)
See
http://wiki.python.org/moin/TimeComplexity
>> It seems fairly difficult to make byindex O(1), and
>> simultaneously also make insertion/deletion better than O(n).
>
> It may be possible to make both of them O(log n), but I may appreciate
> byindex O(n) and insertion/deletion O(1).
If so, what's the advantage of using that method over d.items[n]?
Regards,
Martin
More information about the Python-list
mailing list