I just learned (*ahem* the Hard Way) that CPython 2.7.3
namedtuple is buggy when combined with pickling and older Python versions.
If you pickle a
namedtuple using CPython 2.7.3, you won’t be able to successfully unpickle it using 2.7.2 (nor, presumably, using even earlier versions).
Here’s a short example. First, run this with Python 2.7.3:
# Pickle a namedtuple with python 2.7.3
from collections import namedtuple
Point = namedtuple('Point', ('x', 'y'))
a = Point(4, 9)
with open('foo', 'w') as f:
pickle.dump(a, f, -1)
Then, run this with 2.7.2:
…read the rest →