Re: [Python-Dev] Unbinding of methods

2012-07-19 Thread M Stefan
On 7/19/2012 9:54 PM, Antoine Pitrou wrote: On Thu, 19 Jul 2012 19:53:27 +0300 M Stefan wrote: Hey, As part of pickle4, I found it interesting to add the possibility of pickling bound functions (instance methods). This is done by pickling f.__self__ and f.__func__ separately, and then adding a

Re: [Python-Dev] Unbinding of methods

2012-07-19 Thread Richard Oudkerk
On 19/07/2012 7:54pm, Antoine Pitrou wrote: > Instead of a specific opcode, can't you use a suitable __reduce__ > magic (or __getnewargs__, perhaps)? We want to limit the number of > opcodes except for performance-critical types (and I don't think > bound methods are performance-critical for the p

Re: [Python-Dev] Unbinding of methods

2012-07-19 Thread Antoine Pitrou
On Thu, 19 Jul 2012 19:53:27 +0300 M Stefan wrote: > Hey, > > As part of pickle4, I found it interesting to add the possibility > of pickling bound functions (instance methods). This is done by > pickling f.__self__ and f.__func__ separately, and then adding > a BIND opcode to tie them together.

Re: [Python-Dev] Unbinding of methods

2012-07-19 Thread Brett Cannon
The issue is http://bugs.python.org/issue15397 [Stefan accidentally replied privately to me] On Thu, Jul 19, 2012 at 1:00 PM, Brett Cannon wrote: > > > On Thu, Jul 19, 2012 at 12:53 PM, M Stefan wrote: > >> Hey, >> >> As part of pickle4, I found it interesting to add the possibility >> of pickl

Re: [Python-Dev] Unbinding of methods

2012-07-19 Thread Brett Cannon
On Thu, Jul 19, 2012 at 12:53 PM, M Stefan wrote: > Hey, > > As part of pickle4, I found it interesting to add the possibility > of pickling bound functions (instance methods). This is done by > pickling f.__self__ and f.__func__ separately, and then adding > a BIND opcode to tie them together. >

[Python-Dev] Unbinding of methods

2012-07-19 Thread M Stefan
Hey, As part of pickle4, I found it interesting to add the possibility of pickling bound functions (instance methods). This is done by pickling f.__self__ and f.__func__ separately, and then adding a BIND opcode to tie them together. While this appears to work fine for python methods (non-builti