[Tutor] Why do sets use 6 times as much memory as lists?

Bjorn Madsen bjorn.h.madsen at googlemail.com
Tue May 7 19:10:15 CEST 2013


>>> import sys
>>> L=[x for x in range(10000)]
>>> sys.getsizeof(L)
43816
>>> L={x for x in range(10000)}
>>> sys.getsizeof(L)
262260
?
kind regards,
Bjorn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130507/1de8bfb7/attachment-0001.html>


More information about the Tutor mailing list