Skip to content

Instantly share code, notes, and snippets.

@buchanae
Created April 24, 2013 01:00
Show Gist options
  • Save buchanae/5448778 to your computer and use it in GitHub Desktop.
Save buchanae/5448778 to your computer and use it in GitHub Desktop.
jsonpickle fails to decode namedtuple
from collections import namedtuple
import jsonpickle
Foo = namedtuple('Foo', 'bar')
foo = Foo('bar')
encoded = jsonpickle.encode(foo)
decoded = jsonpickle.decode(encoded)
assert isinstance(decoded, Foo), 'decoded has type {}'.format(type(decoded))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment