[issue10994] implementation details in sys module

2013-01-22 Thread Ezio Melotti
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 ___

[issue10994] implementation details in sys module

2011-05-23 Thread Terry J. Reedy
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

[issue10994] implementation details in sys module

2011-02-04 Thread Martin v . Löwis
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

[issue10994] implementation details in sys module

2011-02-04 Thread Armin Rigo
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

[issue10994] implementation details in sys module

2011-01-25 Thread Armin Rigo
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

[issue10994] implementation details in sys module

2011-01-25 Thread Antoine Pitrou
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

[issue10994] implementation details in sys module

2011-01-25 Thread Maciej Fijalkowski
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

[issue10994] implementation details in sys module

2011-01-25 Thread Antoine Pitrou
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

[issue10994] implementation details in sys module

2011-01-25 Thread Maciej Fijalkowski
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

[issue10994] implementation details in sys module

2011-01-25 Thread Brett Cannon
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. --

[issue10994] implementation details in sys module

2011-01-25 Thread Antoine Pitrou
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

[issue10994] implementation details in sys module

2011-01-24 Thread Maciej Fijalkowski
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,

[issue10994] implementation details in sys module

2011-01-24 Thread Antoine Pitrou
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 ___

[issue10994] implementation details in sys module

2011-01-24 Thread Łukasz Langa
Changes by Łukasz Langa luk...@langa.pl: -- nosy: +lukasz.langa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10994 ___ ___ Python-bugs-list

[issue10994] implementation details in sys module

2011-01-24 Thread Antoine Pitrou
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

[issue10994] implementation details in sys module

2011-01-24 Thread Maciej Fijalkowski
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

[issue10994] implementation details in sys module

2011-01-24 Thread Antoine Pitrou
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

[issue10994] implementation details in sys module

2011-01-24 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10994 ___ ___ Python-bugs-list