Closed wimglenn closed 3 years ago
>>> from typing import Optional >>> import dataclassy as dataclass >>> @dataclass.dataclass ... class Node: ... value: str ... linked_node: Optional[Node] = None ... >>> n = Node("n") >>> n.linked_node = n >>> n --------------------------------------------------------------------------- RecursionError Traceback (most recent call last) ... RecursionError: maximum recursion depth exceeded while calling a Python object
A stdlib tool to avoid this is reprlib.recursive_repr.
reprlib.recursive_repr
Thanks for this, fixed!
>>> n Node(value='n', linked_node=Node(this))
A stdlib tool to avoid this is
reprlib.recursive_repr
.