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

Add support for weak reference to bound methods #60656

Closed
sfeltman mannequin opened this issue Nov 11, 2012 · 3 comments
Closed

Add support for weak reference to bound methods #60656

sfeltman mannequin opened this issue Nov 11, 2012 · 3 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@sfeltman
Copy link
Mannequin

sfeltman mannequin commented Nov 11, 2012

BPO 16452
Nosy @mdickinson
Superseder
  • bpo-14631: Instance methods and WeakRefs don't mix.
  • 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 = None
    closed_at = <Date 2012-11-11.10:08:52.208>
    created_at = <Date 2012-11-11.09:56:06.497>
    labels = ['type-feature', 'library']
    title = 'Add support for weak reference to bound methods'
    updated_at = <Date 2012-11-11.10:19:04.421>
    user = 'https://bugs.python.org/sfeltman'

    bugs.python.org fields:

    activity = <Date 2012-11-11.10:19:04.421>
    actor = 'mark.dickinson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-11-11.10:08:52.208>
    closer = 'sfeltman'
    components = ['Library (Lib)']
    creation = <Date 2012-11-11.09:56:06.497>
    creator = 'sfeltman'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 16452
    keywords = []
    message_count = 3.0
    messages = ['175337', '175338', '175341']
    nosy_count = 2.0
    nosy_names = ['mark.dickinson', 'sfeltman']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'needs patch'
    status = 'closed'
    superseder = '14631'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue16452'
    versions = ['Python 3.4']

    @sfeltman
    Copy link
    Mannequin Author

    sfeltman mannequin commented Nov 11, 2012

    This is a feature request to include a "WeakMethod" or similar object to the weakref module. The object decomposes a bound method and holds a weakref to the object and unbound function. This can be a very useful utility in signal and ui based programming.

    The issue has come up a few times but I was unable to find a bug specifically requesting this feature. I think similar code has shown up in enough libraries at this point that it makes sense to just include it in pythons weakref module.

    See also:
    http://bugs.python.org/issue813299
    http://bugs.python.org/issue7464

    This is the recipes:
    http://code.activestate.com/recipes/81253/
    http://mindtrove.info/python-weak-references/

    @sfeltman sfeltman mannequin added the type-feature A feature request or enhancement label Nov 11, 2012
    @mdickinson
    Copy link
    Member

    Duplicate of http://bugs.python.org/issue14631 ?

    @mdickinson mdickinson added the stdlib Python modules in the Lib dir label Nov 11, 2012
    @sfeltman
    Copy link
    Mannequin Author

    sfeltman mannequin commented Nov 11, 2012

    Indeed a duplicate of: http://bugs.python.org/issue14631

    @sfeltman sfeltman mannequin closed this as completed Nov 11, 2012
    @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
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant