Closed erikw closed 2 years ago
Good catch. I have updated the version on GitHub with a fix. Please give it a try and let me know if it works for you as expected.
Thank you for quick response! With HEAD of the master branch, the above program now yields
nestedtext.NestedTextError: 0, 0, 0: cyclic reference found: cannot be dumped.
I have released the updated version to pypi. Thanks for reporting this and testing the fix.
This program
will give
As I just constructed these simple objects, it is obvious what this error mean. But for a more complex object, that I did not write just now or even myself, the user of NestedText might be confused.
Solution ideas:
RecursionError
and raise an error describing that the object to be dumped have cyclic references, and thus can not be dumped.