Fix Bond pickling in Python 2.7
The pickle round trip for the Bond object does not preserve the `type` and `order` parameters in Python 2.7. Near as I can tell, its because the parent `namedtuple` already has a __getstate__ method, so the default of returning the `__dict__` is never given, so `__setstate__` is not called (as default). This leads to pickle restoring the state, but never invoking the `__new__` statement, resulting in `type` and `order` being lost. This PR fixes this problem in python 2.7, without breaking python 3.x versions. Related mdtraj/mdtraj#1308
Showing
Please register or sign in to comment