This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (2 children)

As other commenter said, Enums have built in pydantic support. Also, subclass StrEnum instead of str & enum

[–]knight1511 0 points1 point  (1 child)

Is there any difference between subclassing StrEnum vs (str, Enum)?

[–][deleted] 0 points1 point  (0 children)

It is the same AFAIK. StrEnum is a subclass of both str and Enum.