New submission from Ciaran Welsh <ciaranwelsh00...@gmail.com>:
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 ``` ---------- assignee: docs@python components: Documentation messages: 402227 nosy: CiaranWelsh, docs@python priority: normal severity: normal status: open title: Documentation example in copyreg errors type: behavior versions: Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45248> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com