Skip to content

sys.getsizeof reaturn misleading result #1

@intellimath

Description

@intellimath

sys.getsizeof for dataclass-based instance return the size of the basic instance structure: PyGC_Head + reference to the type of the instance + refcount + refernce to __dict__ + refrence to __weakref__ = 24+8+8+8+8=56. It don't count the space for attribute's values from __dict__ and the space for __dict__ instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions