I hate backslashes :P. Amongst being ugly they can introduce nasty bugs if someone accidentally adds trailing whitespace (not here, that'd blow up, but in general). Can you use parens, either from the call to json.dumps if that fits, or just surround with extraneous parens.