Message191491
I was unable to find any references to previous problems with json and floats. A quick-n-dirty patch yields the following:
--> from json import dumps, loads
--> from enum import Enum
--> class FE(float, Enum):
... pass
...
--> class Test(FE):
... one = 1.0
...
--> Test.one
<Test.one: 1.0>
--> str(Test.one)
'1.0'
--> dumps(Test.one)
'1.0'
--> loads(dumps(Test.one))
1.0
All json and enum tests are still passing.
If this is an acceptable solution I'll create a nicer patch and post for review. |
|
Date |
User |
Action |
Args |
2013-06-19 20:15:25 | ethan.furman | set | recipients:
+ ethan.furman, barry, amaury.forgeotdarc, ncoghlan, pitrou, eli.bendersky, eric.snow |
2013-06-19 20:15:25 | ethan.furman | set | messageid: <1371672925.54.0.894913100286.issue18264@psf.upfronthosting.co.za> |
2013-06-19 20:15:25 | ethan.furman | link | issue18264 messages |
2013-06-19 20:15:25 | ethan.furman | create | |
|