This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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

Created on 2007-12-11 12:40 by christian.heimes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py3k_instancemethod.patch christian.heimes, 2007-12-11 12:40
Messages (6)
msg58425 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) 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) * (Python committer) Date: 2007-12-11 17:51
I'm tempted to call YAGNI on this.
msg58455 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) 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) * (Python committer) 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) * (Python committer) Date: 2007-12-11 19:57
Applied in r59469
The PyInstanceMethod_Type is not exposed to Python programs.
msg339445 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2019-04-04 13:08
> I'm tempted to call YAGNI on this.

Indeed. See https://bugs.python.org/issue36525
History
Date User Action Args
2022-04-11 14:56:28adminsetgithub: 45928
2019-04-04 13:08:50jdemeyersetnosy: + jdemeyer
messages: + msg339445
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