-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enum_union
#31
Comments
members= [*map( lambda x: x.value, [*Polynucleotide] )]
print(members)
x = "5SrRNA" in members
print(x)
|
TODO : Investigate whether enum_union can be rewritten in terms of pydantic.RootModel |
the serialiazation solution for now is @field_serializer('nomenclature')
def serialize_dt(self, nomenclature:list[PolymerClass], _info):
return [x.name for x in nomenclature]
``` |
It's been a good run of reckless arrogance and folly, but |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gives me a lot of headaches with serialization (value != name of the enum members), but is a really good sell in organizing the
PolymerTypes
. What is the essential functionality of it over the vanilla pythonEnum
? Can is be replaced? Trying withpydantic.Enum
.The text was updated successfully, but these errors were encountered: