cloudpipe / cloudpipe/cloudpickle
Unpickling modifies original class in unexpected ways
Open
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 195
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 1
Description
Consider the following test. I don't use the unpickled result, so I would consider it to be side-effect free, but it's not. I don't think pickling/unpickling an object should have such obvious effects on the class.
```
def test_cloudpickle(self):
log = []
class Foo(object):
def __init__(self):
log.append("hello from Foo init")
f = Foo()
if True: # set to False to make test pass
pickled = cloudpickle.dumps(f)
unpickeled = pickle.loads(pickled)
f2 = Foo()
self.assertEqual(len(log), 2)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.