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: Make PyInstanceMethod_Type available or remove it
Type: Stage:
Components: Interpreter Core Versions: Python 3.1
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, benjamin.peterson, brett.cannon, christian.heimes, gvanrossum, python-dev
Priority: release blocker Keywords: needs review, patch

Created on 2008-09-05 18:51 by christian.heimes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
instancemethod_public.patch christian.heimes, 2008-09-05 18:51
instancemethod_capi.patch christian.heimes, 2008-09-05 19:41
Messages (8)
msg72619 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-09-05 18:51
A long time ago I added the PyInstanceMethod_Type in r59469. It's a
wrapper that turns every function including PyCFunctions into a bindable
function.

class Example:
    id = instancemethod(id)

Example().id()

Without instancemethod the builtin function is not called with 'self' as
first argument.

The code is in the core for a long time but it has neither been used and
unit tested nor was it exposed yet. The feature was requested by the
Pyrex and Cython developers. The feature should either be removed or
exposed somehow. 

I know it's very late in the release cycle but I feel uncomfortable with
code that has no tests. If you don't want to expose it to the user but
only to C extension writers I'll come up with another plan. For example
I could add the type to the testcapi module and test it there.
msg72621 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2008-09-05 19:30
It's really to late to add any new features, so adding tests to testcapi
seems like the right thing to do.
msg72622 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-09-05 19:41
Here is a new patch as discussed on IRC. It adds the type to the
_testcapi module and the tests to test_capi.
msg72646 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-09-05 23:12
The issue is no longer a release blocker for the first rc1. Barry has
decided against adding instancemethod. However the new tests should be
added until the final roles out.
msg72648 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-09-05 23:21
Usually, when you expose things under _tescapi for testing you test it
with related concepts.. I'm not sure what the correct place for this one
is, though. (maybe test_class?) Anyway, you could also nest
InstanceMethod and testfunction inside the test function its self to
avoide pollution.
msg73482 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-09-21 05:16
Is this really meant to be for 3.1, or should this be a 3.0 blocker?
msg74879 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2008-10-16 22:59
Let's commit the capi patch but not expose instancemethod.  Make it so.
msg74882 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-10-16 23:56
Applied in r66947.
History
Date User Action Args
2022-04-11 14:56:38adminsetgithub: 48037
2012-03-08 01:09:46benjamin.petersonsetmessages: - msg155140
2012-03-08 00:53:07python-devsetnosy: + python-dev
messages: + msg155140
2008-10-16 23:56:43benjamin.petersonsetstatus: open -> closed
keywords: patch, patch, needs review
messages: + msg74882
2008-10-16 22:59:19barrysetkeywords: patch, patch, needs review
resolution: accepted
messages: + msg74879
2008-10-02 12:54:43barrysetpriority: deferred blocker -> release blocker
keywords: patch, patch, needs review
2008-09-26 22:19:23barrysetpriority: release blocker -> deferred blocker
keywords: patch, patch, needs review
2008-09-21 05:16:58brett.cannonsetkeywords: patch, patch, needs review
nosy: + brett.cannon
messages: + msg73482
2008-09-18 05:43:01barrysetpriority: deferred blocker -> release blocker
keywords: patch, patch, needs review
2008-09-05 23:21:10benjamin.petersonsetkeywords: patch, patch, needs review
nosy: + benjamin.peterson
messages: + msg72648
2008-09-05 23:12:22christian.heimessetpriority: release blocker -> deferred blocker
keywords: patch, patch, needs review
messages: + msg72646
2008-09-05 19:41:46christian.heimessetkeywords: patch, patch, needs review
files: + instancemethod_capi.patch
messages: + msg72622
2008-09-05 19:30:22barrysetkeywords: patch, patch, needs review
messages: + msg72621
2008-09-05 18:51:59christian.heimescreate