A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-December/059228.html below:

[Python-Dev] When do sets shrink?

[Python-Dev] When do sets shrink? [Python-Dev] When do sets shrink?Noam Raphael noamraph at gmail.com
Thu Dec 29 00:22:03 CET 2005
Hello,

If I do something like this:

s = set()
for i in xrange(1000000):
    s.add(i)
while s:
    s.pop()
gc.collect()

the memory consumption of the process remains the same even after the pops.

I checked the code (that's where I started from, really), and there's
nothing in set.pop or set.remove that resizes the table. And it turns
out that it's the same with dicts.

Should something be done about it?

Noam
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4