Idea: change AST nodes from pydantic.BaseModel to pydantic.dataclasses.dataclass #61
hacker-DOM
started this conversation in
Technical
Replies: 1 comment
-
|
Good idea ! |
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
Uh oh!
There was an error while loading. Please reload this page.
-
It seems that pydantic dataclasses provide all the features of BaseModel, or at least all those we are interested in.
The only disadvantage is that before pydantic/pydantic#4007 is merged, we have to use a workaround[1]
The advantages will be fewer auto-complete noise both in type checking and at runtime (ipython). E.g.
in iPython,
dc.has onlyaandb.(On the other hand, using BaseModel, there would be:
)
[1] from pydantic/pydantic#4006 (comment)
Beta Was this translation helpful? Give feedback.
All reactions