I’m trying to serialize obj using json (Python). I wish to skip json’s unknown type
I know I can add my own encoder, but what I’m interested in is to just skip the unknown type. I don’t want to use None instead. I have tried
icon=QIcon()
arr=["blablal",icon]
str1=simplejson.dumps(arr,skipkeys=True)
I used the skipkeys option to skip the icon object which is unknown type for json but I keep getting TypeError exception. What am I doing wrong?
Ok so i found the problem
icon isn’t a key but a value
if icon was used as a key in a dict it would have been ignored