“pydantic arbitrary_types_allowed” Ответ

pydantic arbitrary_types_allowed

from pydantic import BaseModel as PydanticBaseModel


class BaseModel(PydanticBaseModel):
    class Config:
        arbitrary_types_allowed = True


class MyClass:
    """A random class"""


class Model(BaseModel):
    x: MyClass
Crowded Caracal

pydantic arbitrary_types_allowed

from pydantic import BaseModel as PydanticBaseModel


class BaseModel(PydanticBaseModel):
    class Config:
        arbitrary_types_allowed = True


class MyClass:
    """A random class"""


class Model(BaseModel):
    x: MyClass
Crowded Caracal

Ответы похожие на “pydantic arbitrary_types_allowed”

Смотреть популярные ответы по языку

Смотреть другие языки программирования