-
Notifications
You must be signed in to change notification settings - Fork 520
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
Support for enum.StrEnum
#722
Comments
Current workaround for this specific case:
It may need to be repeated for the all the various dumpers that may be used used, and it unfortunately does not work with |
Just use add_multi_representer for the base class, so all sub-classes will use the base representer: yaml.SafeDumper.add_multi_representer(
StrEnum,
yaml.representer.SafeRepresenter.represent_str,
) |
would be nice to have this included in pyyaml library |
hope pyyaml can support
enum.StrEnum
element of StrEnum is consider str in Python
stdlib json support this:
print(json.dumps({'status': Status.A}))
The text was updated successfully, but these errors were encountered: