This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author danielfleischman
Recipients Dennis Sweeney, danielfleischman, methane, rhettinger, serhiy.storchaka
Date 2021-07-03.16:44:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625330685.99.0.159982141427.issue44555@roundup.psfhosted.org>
In-reply-to
Content
I think the idea of augmenting the struts to maintain a linked list of elements together with periodically shrinking on removal would solve both time and space issues, right? 

Space will be always linear, and operations would still be constant amortized time (of course the worst case of removing will be linear because of the shrinking, but I guess this behavior is expected).

I wrote a worse example in bad_dict_example.py submitted to this issue.  This example would be fixed simply by the shrinking, but as is it's a pretty unexpected bug, as a simple sum(d.values()) can take milliseconds on a dictionary with only one entry (both key and value are int).
History
Date User Action Args
2021-07-03 16:44:46danielfleischmansetrecipients: + danielfleischman, rhettinger, methane, serhiy.storchaka, Dennis Sweeney
2021-07-03 16:44:45danielfleischmansetmessageid: <1625330685.99.0.159982141427.issue44555@roundup.psfhosted.org>
2021-07-03 16:44:45danielfleischmanlinkissue44555 messages
2021-07-03 16:44:45danielfleischmancreate