30 May 2010 13:33
Re: Pickling unbound methods on Python 3
On Sun, May 30, 2010 at 13:02, cool-RR <cool-rr@...> wrote: > I don't understand how that would happen. The code that I gave confirms that > the function found inside the class `is` the function that is being pickled, > so if it finds a different function with the same name, it will ignore it. How can it do that? How does it know that it should ignore it? But you are right, Martins solution wasn't as neat as I thought first, you basically need to do it the other way around, ie define the methods as functions, and then set them on the classes. Probably wrapper methods is neater and less hacky. -- -- Lennart Regebro: Python, Zope, Plone, Grok http://regebro.wordpress.com/ +33 661 58 14 64
RSS Feed