New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__repr__ recursion #9424
Comments
Hmm, nice find. Definitely a bug. Seems relatively low stakes, so will leave this as a good first issue for anyone interested! |
@sushart In this example, I'm curious what the output you're expecting is? The reason I ask is because the model has a cycle. The @sydney-runkle Is an error here not the appropriate response? How were you thinking these cycles should be handled differently? |
@eugenetriguba I would expect that I can chose which elements are involved in the compare process or if done automatically recursion is recognised and interrupted. Like repr=False compare=False wouldn't it be a nice and worthy feature? |
Initial Checks
Description
Hi people,
great job so far, but imho there is a recursion issue caused by pydantics __ repr__ implementation, when I need to do some referencing between objects. The code is as example below.
I could fix this issue setting the repr=False, but the problem also appears in the eq when I compare objects.
Thank you for your work.
How to reproduce:
That implementation causes the PyCharm debugger to fail, even if the code works.
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: