Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information