In the following lines, can we just always use the ```out.append("'%s':'%s'," % (str(k), str(v)))``` code that's in the else block?  Why test for types?