A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pydantic/pydantic/issues/1370 below:

GitHub ยท Where software is built

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4