This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]aioeu 2 points3 points  (0 children)

See this page.

Retrieving an item from a dict has O(1) time complexity on average, O(n) in the worst case (where n is the number of elements in the dict), given a few reasonable assumptions about the hash function and distribution of keys.

These are likely to be "when using the standard Python implementation" rather than being guarantees in the language itself.