Skip to content

Instantly share code, notes, and snippets.

@fish2000
Created September 9, 2011 20:04
Show Gist options
  • Save fish2000/1207178 to your computer and use it in GitHub Desktop.
Save fish2000/1207178 to your computer and use it in GitHub Desktop.
Something to keep in mind w/r/t msgpack-vs.-json
>>> {'yo': ('dogg','yodogg', ['i', 'heard', 'you', 'liked'])}
{'yo': ('dogg', 'yodogg', ['i', 'heard', 'you', 'liked'])}
>>> dic = {'yo': ('dogg','yodogg', ['i', 'heard', 'you', 'liked'])}
>>> msgpack.dumps(dic)
'\x81\xa2yo\x93\xa4dogg\xa6yodogg\x94\xa1i\xa5heard\xa3you\xa5liked'
>>> packitup = msgpack.dumps(dic)
>>> msgpack.loads(packitup)
{'yo': ('dogg', 'yodogg', ('i', 'heard', 'you', 'liked'))}
>>> msgpack.loads(packitup) == dic
False
>>> dic = {'yo': ('dogg','yodogg', ('i', 'heard', 'you', 'liked'))}
>>> msgpack.loads(packitup) == dic
True
>>>
ASIO-OTUS:ost2[dharma •]$ figlet -f colossal "YO DOGG. I heard you like cats."
Y88b d88P .d88888b. 8888888b. .d88888b. .d8888b. .d8888b.
Y88b d88P d88P" "Y88b 888 "Y88bd88P" "Y88bd88P Y88bd88P Y88b
Y88o88P 888 888 888 888888 888888 888888 888
Y888P 888 888 888 888888 888888 888
888 888 888 888 888888 888888 88888888 88888
888 888 888 888 888888 888888 888888 888
888 Y88b. .d88P 888 .d88PY88b. .d88PY88b d88PY88b d88Pd8b
888 "Y88888P" 8888888P" "Y88888P" "Y8888P88 "Y8888P88Y8P
8888888 888 888
888 888 888
888 888 888
888 88888b. .d88b. 8888b. 888d888 .d88888 888 888 .d88b. 888 888
888 888 "88bd8P Y8b "88b888P" d88" 888 888 888d88""88b888 888
888 888 88888888888.d888888888 888 888 888 888888 888888 888
888 888 888Y8b. 888 888888 Y88b 888 Y88b 888Y88..88PY88b 888
8888888 888 888 "Y8888 "Y888888888 "Y88888 "Y88888 "Y88P" "Y88888
888
Y8b d88P
"Y88P"
888d8b888 888
888Y8P888 888
888 888 888
888888888 888 .d88b. .d8888b 8888b. 888888.d8888b
888888888 .88Pd8P Y8b d88P" "88b888 88K
888888888888K 88888888 888 .d888888888 "Y8888b.
888888888 "88bY8b. Y88b. 888 888Y88b. X88d8b
888888888 888 "Y8888 "Y8888P"Y888888 "Y888 88888P'Y8P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment