SimTk/openmm — pull request #69 by rmcgibbo (2013-07-22 06:34:52+00:00)
Title: Add support for pickle protocol 2 for Vec3

Currently, vec3 doesn't support the highest protocol for pickle. This PR adds support, via [this](http://docs.python.org/2/library/pickle.html#object.__getnewargs__) magic method.

```
>>> # current master
>>> import pickle
>>> import simtk.openmm as mm
>>> vec3 = mm.Vec3(1,1,1)
>>> assert vec3 == pickle.loads(pickle.dumps(vec3, pickle.HIGHEST_PROTOCOL))
Traceback (most recent call last):
File "f.py", line 5, in
assert vec3 == pickle.loads(pickle.dumps(vec3, pickle.HIGHEST_PROTOCOL))
File "/home/rmcgibbo/opt/python/2.7.5/lib/python2.7/pickle.py", line 1382, in loads
return Unpickler(file).load()
File "/home/rmcgibbo/opt/python/2.7.5/lib/python2.7/pickle.py", line 858, in load
dispatch[key](self)
File "/home/rmcgibbo/opt/python/2.7.5/lib/python2.7/pickle.py", line 1083, in load_newobj
obj = cls.__new__(cls, *args)
TypeError: __new__() takes exactly 4 arguments (2 given)
```