29 May 2010 18:40
Re: Pickling unbound methods on Python 3
On Sat, May 29, 2010 at 5:46 PM, R. David Murray <rdmurray-2P5OLIWfD11Wk0Htik3J/w@public.gmane.org> wrote:
On Fri, 28 May 2010 21:55:28 +0200, cool-RR wrote:I believe that that is true. In Python3 there is no such thing as an
> One person told me that given an unbound method in Python 3.x, it's
> *impossible* to tell to which class it belongs. Is it true?
unbound method as a distinct object type. There are functions, and
there are bound methods. See the second sentence in this section:
http://docs.python.org/release/3.0.1/whatsnew/3.0.html#operators-and-special-methods
I see. Where would be a good place to discuss this decision? I would want 3.2 to allow pickling of unbound methods.
You'll probably have to explain more about the problem you are
trying to solve in order for us to help you find a solution.
--
R. David Murray www.bitdance.com
I found a hacky workaround: When I have a method `my_method` that I want to pickle, I write `my_method = my_class.my_method` in the method's module.
So no need to burden this list with the specifics of my problem.
Now I only worry about the future: I want 3.2 to enable pickling of unbound methods so I could get rid of this workaround in the future.
Ram.
_______________________________________________ Python-porting mailing list Python-porting@... http://mail.python.org/mailman/listinfo/python-porting
RSS Feed