[New-bugs-announce] [issue21507] memory used by frozenset created from set differs from that of frozenset created from other iterable

Lev Givon report at bugs.python.org
Wed May 14 14:32:52 CEST 2014


New submission from Lev Givon:

Not sure if this is indicative of a bug, but I noticed that a frozenset created from a set seems to occupy a different amount of memory than a frozenset created from some other iterable. I observed this behavior with Python 2.7.5 and with Python 3.4.0 on Ubuntu 14.04 x86_64:

>>> from sys import getsizeof
>>> x = range(100)
>>> s = set(x)
>>> f0 = frozenset(x)
>>> f1 = frozenset(s)
>>> getsizeof(s)
8424
>>> getsizeof(f0)
8424
>>> getsizeof(f1)
4328
>>> f0==f1
True

Original question on StackOverflow available at https://stackoverflow.com/questions/23618259/memory-occupied-by-set-vs-frozenset-in-python-2-7

----------
messages: 218524
nosy: lebedov
priority: normal
severity: normal
status: open
title: memory used by frozenset created from set differs from that of frozenset created from other iterable
type: resource usage
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21507>
_______________________________________


More information about the New-bugs-announce mailing list