You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Use Pycharm IDE
Open file
Insert code
run
That implementation causes the PyCharm debugger to fail, even if the code works.
@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 parent of gf_ref is set to the root object and so when gf_ref is attempted to be serialized, it attempts to serialize the root object again and then it attempts to serialize gf_ref again and so on.
@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: