Message402227
The example on https://docs.python.org/3/library/copyreg.html does not work:
```
import copyreg, copy, pickle
class C:
def __init__(self, a):
self.a = a
def pickle_c(c):
print("pickling a C instance...")
return C, (c.a,)
copyreg.pickle(C, pickle_c)
c = C(1)
d = copy.copy(c)
> p = pickle.dumps(c)
E AttributeError: Can't pickle local object 'RoadRunnerPickleTests.test_ex.<locals>.C'
picklable_swig_tests.py:133: AttributeError
``` |
|
Date |
User |
Action |
Args |
2021-09-20 12:27:27 | CiaranWelsh | set | recipients:
+ CiaranWelsh, docs@python |
2021-09-20 12:27:27 | CiaranWelsh | set | messageid: <1632140847.01.0.509914617617.issue45248@roundup.psfhosted.org> |
2021-09-20 12:27:26 | CiaranWelsh | link | issue45248 messages |
2021-09-20 12:27:26 | CiaranWelsh | create | |
|