[issue18264] enum.IntEnum is not compatible with JSON serialisation

Guido van Rossum report at bugs.python.org
Sat Jun 22 06:55:33 CEST 2013


Guido van Rossum added the comment:

Yes for float() -- but for str() it would seem redundant? (Or what's
the context?)

On Fri, Jun 21, 2013 at 8:23 PM, Ethan Furman <report at bugs.python.org> wrote:
>
> Ethan Furman added the comment:
>
> On 06/21/2013 07:49 PM, Guido van Rossum wrote:
>> Eli Bendersky added the comment:
>>>
>>> Practically speaking, what should be done to make enum play well with JSON
>>> without writing new PEPs? I think we still want to convert those stdlib
>>> constants to IntEnums...
>>
>> Change json to call int() first.
>
> Should we have json call float() and str() first as well?  I'm thinking less of the stdlib and more of the unsuspecting
> user.
>
> ----------
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue18264>
> _______________________________________

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18264>
_______________________________________


More information about the Python-bugs-list mailing list