-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bug V1Bug related to Pydantic V1.XBug related to Pydantic V1.X
Description
Bug
RecursionError: maximum recursion depth exceeded while calling a Python object
I get this error message, when using recursive models.
class A(BaseModel):
...
class B(A):
key: List[B]
...
Using
from __future__ import annotations
from typings import ForwardRef
B = ForwardRef('B')
...
B.update_forward_refs()
does not make a difference aswell.
Issue #531 did not have any clue on how to solve this. The docs don't cover the usage with lists.
Hope you understand my issue here 😄
Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:
pydantic version: 1.4
pydantic compiled: True
install path: /usr/local/lib/python3.8/site-packages/pydantic
python version: 3.8.2 (default, Feb 26 2020, 14:58:38) [GCC 8.3.0]
platform: Linux-5.3.0-45-generic-x86_64-with-glibc2.2.5
optional deps. installed: ['email-validator']
EDIT:
Just saw that the issue is pointed to in #524, but there is no response. Maybe there is a solution for it now?
wshayes, theDataFox, xppt, sbadisa, yoppe and 1 more
Metadata
Metadata
Assignees
Labels
bug V1Bug related to Pydantic V1.XBug related to Pydantic V1.X