Open rtviii opened 10 months ago
members= [*map( lambda x: x.value, [*Polynucleotide] )]
print(members)
x = "5SrRNA" in members
print(x)
['mt12SrRNA', 'mt16SrRNA', '5SrRNA', '16SrRNA']
True
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 enum.StrEnum
ships with python3.11 so there is no reason to indulge in this masochism any further
enum.StrEnum
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
.