
July 28, 2011
10:46 a.m.
On Jul 28, 2011, at 10:57 AM, Ethan Furman wrote:
Barry Warsaw wrote:
In my experimental branch I've also made EnumValues subclasses of ints. This breaks one test in my Mailman 3 test suite, since I was using a custom encoder for json.dumps() which knew how to encode EnumValues. However, the json module doesn't allow you to override the encoding of basic types,
Isn't this a problem with json? An EnumValue is a subclass, after all, not a plain ol' straight-up int -- I would think that json should realize a subclass may be different and go the .default() route.
On first blush, I'd agree. _iterencode() just does an isinstance check, which is why this gets caught in the trap. -Barry