[issue15397] Unbinding of methods

2013-11-23 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- resolution: -> duplicate status: open -> closed superseder: -> Implement PEP 3154 (pickle protocol 4) ___ Python tracker ___ __

[issue15397] Unbinding of methods

2012-07-22 Thread Stefan Mihaila
Stefan Mihaila added the comment: Andrew, thanks for creating a separate issue (the refleak was very rare and I thought I'd put it in the same place, but now I realize it was a bad idea). Richard, actually, the isinstance(self, type) check I mentioned earlier would have to be before the hasta

[issue15397] Unbinding of methods

2012-07-22 Thread Stefan Mihaila
Stefan Mihaila added the comment: Richard, yes, I think that would work, I didn't think of using f.__self__'s type. You might want to replace if self is not None and not isinstance(self, types.ModuleType): with if self is not None and not isinstance(self, types.ModuleType) \

[issue15397] Unbinding of methods

2012-07-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: Stefan, I've fixed refleak found by you in #15404. Thanks. -- ___ Python tracker ___ ___ Python-bug

[issue15397] Unbinding of methods

2012-07-20 Thread Richard Oudkerk
Richard Oudkerk added the comment: Can't you unbind without any changes to the C code by doing def unbind(f): if hasattr(f, '__func__'): return f.__func__ self = getattr(f, '__self__', None) if self is not None and not isinstance(self, types.ModuleType):

[issue15397] Unbinding of methods

2012-07-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: Stefan, you right. A bit hairy idiom from my perspective, but it works. Looks like this way used only for PyCFunction_New, all other code follows standard schema with trampoline. -- ___ Python tracker

[issue15397] Unbinding of methods

2012-07-19 Thread Stefan Mihaila
Stefan Mihaila added the comment: Doesn't the definition I've added at the end of methodobject.c suffice? (http://codereview.appspot.com/6425052/patch/1/10) Or should the macro be removed altogether? -- ___ Python tracker

[issue15397] Unbinding of methods

2012-07-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: Andrew is right: PyCFunction_NewEx must stay, and must continue to get the same parameters as it currently does. This not only applies to extensions already built, but also to extensions that are built against the new header files: they still need to run und

[issue15397] Unbinding of methods

2012-07-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: Looks like PyCFunction_NewEx is part of Stable API. If I'm right you have to make stub for this one as simple trampoline to new PyCFunction_NewExEx implementation. Martin, please confirm. -- nosy: +loewis ___ Pytho

[issue15397] Unbinding of methods

2012-07-19 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue15397] Unbinding of methods

2012-07-19 Thread Stefan Mihaila
Stefan Mihaila added the comment: Yes, the patch is at http://codereview.appspot.com/6425052/ The code there also contains some tests I've written for functools.unbind. -- Added file: http://bugs.python.org/file26439/unbind_test.patch ___ Python trac

[issue15397] Unbinding of methods

2012-07-19 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue15397] Unbinding of methods

2012-07-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: Can you push patch in form available for review via Rietveld? -- ___ Python tracker ___ ___ Python-

[issue15397] Unbinding of methods

2012-07-19 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue15397] Unbinding of methods

2012-07-19 Thread Meador Inge
Changes by Meador Inge : -- nosy: +meador.inge stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue15397] Unbinding of methods

2012-07-19 Thread Stefan Mihaila
New submission from Stefan Mihaila : In order to implement pickling of instance methods, a means of separating the object and the unbound method is necessary. This is easily done for Python methods (f.__self__ and f.__func__), but not all of builtins support __func__. Moreover, there currently a

[issue15397] Unbinding of methods

2012-07-19 Thread Stefan Mihaila
Changes by Stefan Mihaila : -- nosy: +alexandre.vassalotti, ncoghlan, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing l