Skip to content

Conversation

@trendels
Copy link
Contributor

@trendels trendels commented Oct 2, 2020

The auto-generated __repr__ for inspected objects currently does not work because a lot of objects contain circular references (for example index <-> constraint) which leads to infinite recursion.

This PR adds a fix for this by keeping track of which objects have already been visited during a call to __repr__ and returning '...' for recursive references instead of resolving them. I've shamelessly stolen the technique from the popular "attrs" library: https://github.com/python-attrs/attrs/blob/f680c5b83e65413eeb684c68ece60198015058c3/src/attr/_make.py#L1643

@djrobstep djrobstep force-pushed the master branch 3 times, most recently from 13f62b5 to ebbc2e4 Compare September 18, 2022 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant