CodyIT@programming.dev to Programmer Humor@programming.devEnglish · 15 days agoEveryone's asking, 'Who's Json?', but nobody's asking, 'How's Json?'programming.devimagemessage-square132linkfedilinkarrow-up11
arrow-up11imageEveryone's asking, 'Who's Json?', but nobody's asking, 'How's Json?'programming.devCodyIT@programming.dev to Programmer Humor@programming.devEnglish · 15 days agomessage-square132linkfedilink
minus-square_stranger_@lemmy.worldlinkfedilinkarrow-up0·14 days agoYeah there’s other edge cases too, like Decimal, but as long as you have those things imported when you send it through dumps it should work.
minus-squaremel ♀@jlai.lulinkfedilinkarrow-up0·14 days agoJust tried it in an ipython shell import datetime import json json.dumps({"a": datetime.datetime(1970,1,1)}) And I got the TypeError: datetime not JSON serializable though.
Yeah there’s other edge cases too, like Decimal, but as long as you have those things imported when you send it through dumps it should work.
Just tried it in an ipython shell
import datetime import json json.dumps({"a": datetime.datetime(1970,1,1)})And I got the TypeError: datetime not JSON serializable though.