Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PyInstanceMethod_Type available or remove it #48037

Closed
tiran opened this issue Sep 5, 2008 · 8 comments
Closed

Make PyInstanceMethod_Type available or remove it #48037

tiran opened this issue Sep 5, 2008 · 8 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker

Comments

@tiran
Copy link
Member

tiran commented Sep 5, 2008

BPO 3787
Nosy @gvanrossum, @warsaw, @brettcannon, @tiran, @benjaminp
Files
  • instancemethod_public.patch
  • instancemethod_capi.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/warsaw'
    closed_at = <Date 2008-10-16.23:56:43.884>
    created_at = <Date 2008-09-05.18:51:59.403>
    labels = ['interpreter-core', 'release-blocker']
    title = 'Make PyInstanceMethod_Type available or remove it'
    updated_at = <Date 2012-03-08.01:09:46.609>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2012-03-08.01:09:46.609>
    actor = 'benjamin.peterson'
    assignee = 'barry'
    closed = True
    closed_date = <Date 2008-10-16.23:56:43.884>
    closer = 'benjamin.peterson'
    components = ['Interpreter Core']
    creation = <Date 2008-09-05.18:51:59.403>
    creator = 'christian.heimes'
    dependencies = []
    files = ['11395', '11397']
    hgrepos = []
    issue_num = 3787
    keywords = ['patch', 'needs review']
    message_count = 8.0
    messages = ['72619', '72621', '72622', '72646', '72648', '73482', '74879', '74882']
    nosy_count = 6.0
    nosy_names = ['gvanrossum', 'barry', 'brett.cannon', 'christian.heimes', 'benjamin.peterson', 'python-dev']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3787'
    versions = ['Python 3.1']

    @tiran
    Copy link
    Member Author

    tiran commented Sep 5, 2008

    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.

    @tiran tiran added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Sep 5, 2008
    @warsaw
    Copy link
    Member

    warsaw commented Sep 5, 2008

    It's really to late to add any new features, so adding tests to testcapi
    seems like the right thing to do.

    @tiran
    Copy link
    Member Author

    tiran commented Sep 5, 2008

    Here is a new patch as discussed on IRC. It adds the type to the
    _testcapi module and the tests to test_capi.

    @tiran
    Copy link
    Member Author

    tiran commented Sep 5, 2008

    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.

    @benjaminp
    Copy link
    Contributor

    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.

    @brettcannon
    Copy link
    Member

    Is this really meant to be for 3.1, or should this be a 3.0 blocker?

    @warsaw
    Copy link
    Member

    warsaw commented Oct 16, 2008

    Let's commit the capi patch but not expose instancemethod. Make it so.

    @benjaminp
    Copy link
    Contributor

    Applied in r66947.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants