Conventions suggest the use of '__complex__'. There are parts of Pyramid that use '__json__' to encode the object, especially on object response. So basically, you return the object and if you've set the response renderer to 'json' the object will automatically encode. This is nice for testing BTW, because then you don't have to parse the raw response. But I digress...