Message191491
| Author |
ethan.furman |
| Recipients |
amaury.forgeotdarc, barry, eli.bendersky, eric.snow, ethan.furman, ncoghlan, pitrou |
| Date |
2013年06月19日.20:15:25 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1371672925.54.0.894913100286.issue18264@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|