classification
Title: instancemethod wrapper for PyCFunctions
Type: feature request Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, gvanrossum (2)
Priority: normal Keywords patch

Created on 2007-12-11 12:40 by christian.heimes, last changed 2008-01-06 22:29 by admin.

Files
File name Uploaded Description Edit Remove
py3k_instancemethod.patch christian.heimes, 2007-12-11 12:40
Messages (5)
msg58425 - (view) Author: Christian Heimes (christian.heimes) Date: 2007-12-11 12:40
The patch implements the instancemethod wrapper as discussed on the py3k
mailing list. The patch is roughly based on Marcin Kowalczyk patch but
it contains more fancy slots like repr, call etc. The rest is mostly
based on PyMethod_Type.
msg58446 - (view) Author: Guido van Rossum (gvanrossum) Date: 2007-12-11 17:51
I'm tempted to call YAGNI on this.
msg58455 - (view) Author: Christian Heimes (christian.heimes) Date: 2007-12-11 18:56
The wrapper is useful for C code which used PyMethod_New(func, NULL,
type) in 2.5. W/o a wrapper people may have to rewrite and redesign
their code base.

For example see http://bugs.python.org/issue1505 and r59215. I had to
rewrite a good bunch of code just to get one C function right.

I'm +1 to add a wrapper and +0 to expose it to Python code and -0 to
expose it as built-in. I used a built-in for quick testing.
msg58458 - (view) Author: Guido van Rossum (gvanrossum) Date: 2007-12-11 19:04
OK, you've convinced me. Let's just make it a C API for now.

On Dec 11, 2007 10:56 AM, Christian Heimes <report@bugs.python.org> wrote:
>
> Christian Heimes added the comment:
>
> The wrapper is useful for C code which used PyMethod_New(func, NULL,
> type) in 2.5. W/o a wrapper people may have to rewrite and redesign
> their code base.
>
> For example see http://bugs.python.org/issue1505 and r59215. I had to
> rewrite a good bunch of code just to get one C function right.
>
> I'm +1 to add a wrapper and +0 to expose it to Python code and -0 to
> expose it as built-in. I used a built-in for quick testing.
>
>
> __________________________________
> Tracker <report@bugs.python.org>
> <http://bugs.python.org/issue1587>
> __________________________________
>
msg58461 - (view) Author: Christian Heimes (christian.heimes) Date: 2007-12-11 19:57
Applied in r59469
The PyInstanceMethod_Type is not exposed to Python programs.
History
Date User Action Args
2008-01-06 22:29:44adminsetkeywords: - py3k
versions: Python 3.0
2007-12-11 19:57:55christian.heimessetstatus: open -> closed
resolution: fixed
messages: + msg58461
2007-12-11 19:04:39gvanrossumsetmessages: + msg58458
2007-12-11 18:56:03christian.heimessetmessages: + msg58455
2007-12-11 17:51:37gvanrossumsetnosy: + gvanrossum
messages: + msg58446
2007-12-11 12:40:19christian.heimescreate