Make arbitrary_types_allowed
default to True with dataclass decorator
#3744
jzwick-narmi
started this conversation in
Feature Request
Replies: 1 comment
-
For anybody who (like me) came here trying to figure out how to set from pydantic import ConfigDict
from pydantic.dataclasses import dataclass
class MyClass:
pass
@dataclass(config=ConfigDict(arbitrary_types_allowed=True))
class MyPydanticDataclass:
a: MyClass |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
from the docs:
But needing to define a config and pass it to all my already defined dataclasses in order for them to work out of the box makes it strictly not a drop-in replacement. Plus, I don't see why this would be restricted to begin with, why would it be useful NOT to allow arbitrary class types? Seems niche to me.
If there is no interest in defaulting to
True
here, perhaps update the documentation with this caveat.Beta Was this translation helpful? Give feedback.
All reactions