[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

Daniel Fleischman report at bugs.python.org
Sat Jul 3 01:44:23 EDT 2021


Daniel Fleischman <danielfleischman at gmail.com> added the comment:

Please find attached a more complete example of the issue I am reporting.

tl;dr: I can make `sum(d.values())` run in O(maximum_size_in_d's_history) instead of O(len(d)), even when len(d) == 1.

The linked list approach would work in terms of making it faster, but we would still be using too much space.

----------
Added file: https://bugs.python.org/file50138/bad_dict_example.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44555>
_______________________________________


More information about the Python-bugs-list mailing list