[docs] [issue33872] doc Add list access time to list definition
report at bugs.python.org
Sun Jun 17 10:54:03 EDT 2018
INADA Naoki <songofacandy at gmail.com> added the comment:
In case of "difference with linked-list", I don't want to make list definition longer and longer for readers only small part of people. I think that's why difference with "linked-list" is documented only in glossary.
By adding all information for non-zero group of people, resulting document will be very long, redundant, and suitable for no one.
We should effort to make document "necessary and sufficient" state.
In case of time complexity, I agree it's useful for users. Not only for list, but also for all basic operation of basic types, too.
But at my understanding, we don't have formal spec for time complexity of stdtypes. We use consensus instead.
I think we can say random access is O(1) for bytes, bytearray, tuple, list, and range (except time for building large numeric value).
On the other hand, I'm not sure about str. Other Python implementation will want to use UTF-8 based implementation of str.
Python tracker <report at bugs.python.org>
More information about the docs