We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I run asizeof on a normal tuple, I get the following:
>>> from pympler import asizeof >>> asizeof.asizeof(list(range(1000)), "foo") 41160
If I create a named tuple and run asizeof on that object, I don't get the correct size:
>>> from pympler import asizeof >>> from collections import namedtuple >>> TestTuple = namedtuple("TestTuple", ["a", "b"]) >>> asizeof.asizeof(TestTuple(list(range(1000)), "foo")) 120
I believe asizeof should be returning roughly the same values for these calls.
This output was produced on Python 3.4 using pympler 0.4.3. Perhaps this is related to #10?
The text was updated successfully, but these errors were encountered:
Size namedtuple values
f7e1573
This change includes values when sizing a namedtuple. Before this values were ignored: >>> from pympler import asizeof >>> import collections >>> Point = collections.namedtuple('Point', ('x', 'y')) >>> >>> print(asizeof.asized(Point(x=11, y=22), detail=1).format()) Point(x=11, y=22) size=136 flat=72 __slots__ size=64 flat=64 __class__ size=0 flat=0 Now values appear like a tuple's do: >>> print(asizeof.asized(Point(x=11, y=22), detail=1).format()) Point(x=11, y=22) size=184 flat=72 __slots__ size=64 flat=64 11 size=24 flat=24 22 size=24 flat=24 __class__ size=0 flat=0 >>> print(asizeof.asized((11, 22), detail=1).format()) (11, 22) size=120 flat=72 11 size=24 flat=24 22 size=24 flat=24 Fixes pympler#35 The modified namedtuple test also passes: $ python test/runtest.py --verbose=3 test/asizeof
+1
Sorry, something went wrong.
Thanks for the report and the fix!
No branches or pull requests
If I run asizeof on a normal tuple, I get the following:
If I create a named tuple and run asizeof on that object, I don't get the correct size:
I believe asizeof should be returning roughly the same values for these calls.
This output was produced on Python 3.4 using pympler 0.4.3. Perhaps this is related to #10?
The text was updated successfully, but these errors were encountered: