Use a Protocol to ensure instance being serialized is a dataclass #512
davetapley
started this conversation in
Ideas
Replies: 0 comments
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.
-
I just stumbled upon python/mypy#6568 (comment) and it made me think:
#312 is amazing, but it still (I presume) requires that the class being (de)serialized is a
@dataclass?If so then perhaps we could do:
And then change
o: Anyhere too: DataClassProtocol:pyserde/serde/se.py
Lines 433 to 434 in ad8c148
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions