flufl.enum and pyyaml

Issue #36 new
Sébastien Celles
created an issue

Hello,

I'm facing an issue

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import yaml
from flufl.enum import Enum

class MyEnum(Enum):
    VAL1 = 1
    VAL2 = 2
    VAL3  = 3

e = MyEnum.VAL1

yaml.safe_dump(e)

raises

yaml.representer.RepresenterError: cannot represent an object: MyEnum.VAL1

I don't know if it's a bug on pyyaml side or flufl.enum side or a misunderstanding on my side.

Anyway any help is welcome.

In [43]: yaml.__version__
Out[43]: '3.11'

Kind regards

Sébastien

Comments (1)

  1. Log in to comment