Skip to content

Modify snapshot function representation of classes #1289

@david-yz-liu

Description

@david-yz-liu

Given the following code:

def f() -> None:
    my_type = int
    print(snapshot_to_json(snapshot()))

if __name__ == '__main__':
    f()

the JSON output contains the expanded __dict__ of the int class as the "value" of the object. We should modify this behaviour so that when recursing on type instances, the snapshot function just shows the repr of the type, e.g. (<class 'int'>), rather than expanding the __dict__.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions