CodyIT@programming.dev to Programmer Humor@programming.devEnglish · 1 month agoEveryone's asking, 'Who's Json?', but nobody's asking, 'How's Json?'programming.devimagemessage-square133linkfedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageEveryone's asking, 'Who's Json?', but nobody's asking, 'How's Json?'programming.devCodyIT@programming.dev to Programmer Humor@programming.devEnglish · 1 month agomessage-square133linkfedilink
minus-square_stranger_@lemmy.worldlinkfedilinkarrow-up0·1 month 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·1 month 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.