Skip to content

Instantly share code, notes, and snippets.

@bayerj
Created November 30, 2012 15:39
Show Gist options
  • Select an option

  • Save bayerj/4176500 to your computer and use it in GitHub Desktop.

Select an option

Save bayerj/4176500 to your computer and use it in GitHub Desktop.
In [1]: from collections import namedtuple
In [3]: p = namedtuple('p', ['bla'])
In [4]: pp = p(2)
In [5]: pp
Out[5]: p(bla=2)
In [6]: import pickle
In [7]: pickle.dumps(pp)
Out[7]: 'ccopy_reg\n_reconstructor\np0\n(c__main__\np\np1\nc__builtin__\ntuple\np2\n(I2\ntp3\ntp4\nRp5\n.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment