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
I get the error "maximum recursion depth exceeded while calling a Python object" when I try to use it. Any suggestions on how I can fix this would be greatly appreciated.
If I modify the Node.children type from List[Node[T]] to List[Node], then the error disappers.
Question
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:Issue
I wrote a generic model named Tree as shown in the following snippet.
I get the error "maximum recursion depth exceeded while calling a Python object" when I try to use it. Any suggestions on how I can fix this would be greatly appreciated.
If I modify the Node.children type from List[Node[T]] to List[Node], then the error disappers.
The problem in this case is that, it accepts any Node type as the children as shown in the following code.
I want it to support only
Node[int]
as children, and I want it throw a validation error in the above case.The text was updated successfully, but these errors were encountered: