[Python-Dev] Enum is really serializable using json? (original) (raw)
Facundo Batista facundobatista at gmail.com
Sat Feb 21 19:48:41 CET 2015
- Previous message: [Python-Dev] Request for Pronouncement: PEP 486 - Make the Python Launcher aware of virtual environments
- Next message: [Python-Dev] Enum is really serializable using json?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
We have this issue closed as resolved:
http://bugs.python.org/issue18264
It's called "enum.IntEnum is not compatible with JSON serialisation", and it looks that after a long conversation they added proper support for it in Py3.4.
However, this is still failing:
Python 3.4.2 (default, Oct 8 2014, 13🔞07) [GCC 4.9.1] on linux
import enum, json Foo = enum.Enum('Foo', 'bar baz') json.dumps(Foo.bar) Traceback (most recent call last): ... TypeError: <Foo.bar: 1> is not JSON serializable
Am I failing to understand the bug tracker saying the patch was applied for Py3.4?
(thought it was more polite to ask here than to reopen the whole thread in the issue tracker)
Thanks!
-- . Facundo
Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ Twitter: @facundobatista
- Previous message: [Python-Dev] Request for Pronouncement: PEP 486 - Make the Python Launcher aware of virtual environments
- Next message: [Python-Dev] Enum is really serializable using json?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]