esnme/ultrajson — Issue #27: toDict not working?
Author: kmanley
Created: 2011-12-20 18:05:52+00:00
State: open

Using this test program

--- snip ---

import ujson

class thing:
def __init__(self):
pass
def toDict(self):
print "toDict called!"
return {"foo" : 1}

t = thing()
print ujson.dumps(t)

--- snip ---

I see that toDict is called but the returned dictionary is not used in the serialization to JSON. Am I doing something wrong?

Thanks for your help--ujson is great!