Serialization of enums

Issue #27 new
Antony Lee
created an issue

Python 3.4 enums are weird beasts, which is probably the reason why they break PyYaml:

>>> from enum import Enum; import yaml
>>> class C(Enum): a = 1
>>> yaml.dump(C.a)
<... traceback elided ...>
  File "/usr/lib/python3.3/site-packages/yaml/", line 313, in represent_object
    reduce = data.__reduce_ex__(2)
  File "/usr/lib/python3.3/", line 65, in _reduce_ex
    raise TypeError("can't pickle %s objects" % base.__name__)
TypeError: can't pickle int objects

Comments (0)

  1. Log in to comment