-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
FailuresubsclassesBaseException.BaseExceptionimplements the reduce pickle API, in C.- As a result, you need to override
__reduce__to impact pickling behavior.
Demonstration—notice that Failure.__getstate__ does c["pickled"] = 1 in its implementation in the dictionary it returns.
Python 3.11.8 (main, Feb 25 2024, 16:39:33) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle
>>> from twisted.python.failure import Failure
>>> f = Failure(ZeroDivisionError())
>>> pickle.loads(pickle.dumps(f)).pickled
0Reactions are currently unavailable