On 05/07/2013 01:10 PM, Bjorn Madsen wrote:
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
Just curious: what did you expect? Sets have a different purpose,
basically to be able to do an 'in' operation instantly, while lists have
to scan every item in the list.
I figure the ratio to be more like 75% larger, since the 10,000 objects
are going to take up maybe 24 bytes each.
--
DaveA
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor