[Python-Dev] Re: Method __func__ objects are unpicklable

2022-06-10 Thread Brett Cannon
I believe a lot of people use https://pypi.org/project/cloudpickle/ thanks to its support for pickling functions. On Fri, Jun 10, 2022 at 4:56 AM haael wrote: > > > During some sophisticated pickling I noticed that method `__func__` > objects are unpicklable, because they share the name with the

[Python-Dev] Re: Method __func__ objects are unpicklable

2022-06-10 Thread Joao S. O. Bueno
This is not just about the content of the name attributes: ;bound methods do contain a reference to the specific instance they are bound too - which is not retrievable (or maybe is through some dunder attribute) - this instance has to be pickled, transported and its reference updated on unpickling.