Answer the question
In order to leave comments, you need to log in
What is the __reduce__ magic method for?
Hey!
I read here https://docs.python.org/3/library/pickle.html?high... but didn't get it.
Answer the question
In order to leave comments, you need to log in
In short, it returns the current state of the object so that you can create exactly the same one, for example, using copy.copy. Or serialize it into bytes (pickle), and then get it from there to get an object no worse than the one you serialized.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question