Changes by Ezio Melotti ezio.melo...@gmail.com:
--
versions: +Python 3.3, Python 3.4 -Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10994
___
Terry J. Reedy tjre...@udel.edu added the comment:
The __sizeof__ special attribute shows up in dir(object) but appears not to be
documented other than with
help(object.__sizeof__)
Help on method_descriptor:
__sizeof__(...)
__sizeof__() - size of object in memory, in bytes
Should it have
Martin v. Löwis mar...@v.loewis.de added the comment:
I can propose a specification of getsizeof: if you somehow manage to traverse
all objects (without considering an object twice), and sum up the getsizeof
results, you should end up with something close to, but smaller than the actual
Armin Rigo ar...@users.sourceforge.net added the comment:
Martin: I kind of agree with you, although I guess that for pratical reasons if
you don't have a reasonable sys.getsizeof() implementation then it's better to
raise TypeError than return 0 (like CPython, which may raise TypeError: Type
Armin Rigo ar...@users.sourceforge.net added the comment:
The expectation is that it returns the memory footprint of the given
object, and only it (not taking into account sharing, caching,
dependencies or anything else).
It would be nice if this was a well-defined definition, but
Antoine Pitrou pit...@free.fr added the comment:
The expectation is that it returns the memory footprint of the given
object, and only it (not taking into account sharing, caching,
dependencies or anything else).
It would be nice if this was a well-defined definition, but
unfortunately
Maciej Fijalkowski fij...@gmail.com added the comment:
I can hardly think about a specification that would potentially help me
identify actual sizes. Even as a rough estimation. Which experts you had in
mind?
--
___
Python tracker
Antoine Pitrou pit...@free.fr added the comment:
Which experts you had in mind?
People who know how the Python implementation works.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10994
Maciej Fijalkowski fij...@gmail.com added the comment:
Which experts you had in mind?
People who know how the Python implementation works.
I'm serious. What semantics would make sense to anyone? Even if you know
implementation quite well a single number per object does not provide enough
Brett Cannon br...@python.org added the comment:
You could return -1 for everything. =)
In all seriousness, it could simply be proportional. IMO as long as people
realize if a list takes up less space than a dict then the numbers seem fine to
me.
--
Antoine Pitrou pit...@free.fr added the comment:
Even if you know implementation quite well a single number per object
does not provide enough information.
Enough information for what? It can certainly provide information about
the overhead of that particular object (again, regardless of
New submission from Maciej Fijalkowski fij...@gmail.com:
sys module documentation (as it is online) has some things that in my opinion
should be marked as implementation details, but are not. Feel free to counter
why not.
Some of them has info it should be used for specialized purposes only,
Changes by Antoine Pitrou pit...@free.fr:
--
stage: - needs patch
versions: +Python 2.7, Python 3.1, Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10994
___
Changes by Łukasz Langa luk...@langa.pl:
--
nosy: +lukasz.langa
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10994
___
___
Python-bugs-list
Antoine Pitrou pit...@free.fr added the comment:
Well, getsizeof is not better-defined under CPython than elsewhere. It just
gives a hint.
Agreed about the other.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
Maciej Fijalkowski fij...@gmail.com added the comment:
I suppose wrt getsizeof it's more of if you provide us with a reasonable
expectations, we can implement this other than anything else.
--
___
Python tracker rep...@bugs.python.org
Antoine Pitrou pit...@free.fr added the comment:
I suppose wrt getsizeof it's more of if you provide us with a
reasonable expectations, we can implement this other than anything
else.
The expectation is that it returns the memory footprint of the given
object, and only it (not taking into
Changes by Brett Cannon br...@python.org:
--
nosy: +brett.cannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10994
___
___
Python-bugs-list
18 matches
Mail list logo