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

bpo-38006: Avoid closure in weakref.WeakValueDictionary #15641

Merged
merged 2 commits into from Sep 9, 2019

Conversation

@vstinner
Copy link
Member

vstinner commented Sep 2, 2019

weakref.WeakValueDictionary defines a local remove() function used as
callback for weak references. This function was created with a
closure. Modify the implementation to avoid the closure.

https://bugs.python.org/issue38006

weakref.WeakValueDictionary defines a local remove() function used as
callback for weak references. This function was created with a
closure.  Modify the implementation to avoid the closure.
@tiran
tiran approved these changes Sep 2, 2019
Copy link
Member

tiran left a comment

The refactorization solves my segfault issue.

@vstinner vstinner merged commit a2af05a into python:master Sep 9, 2019
5 checks passed
5 checks passed
Azure Pipelines PR #20190902.6 succeeded
Details
bedevere/issue-number Issue number 38006 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vstinner vstinner deleted the vstinner:weakref_closure branch Sep 9, 2019
@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Sep 9, 2019

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

miss-islington added a commit to miss-islington/cpython that referenced this pull request Sep 9, 2019
weakref.WeakValueDictionary defines a local remove() function used as
callback for weak references. This function was created with a
closure.  Modify the implementation to avoid the closure.
(cherry picked from commit a2af05a)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Sep 9, 2019

GH-15787 is a backport of this pull request to the 3.8 branch.

@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Sep 9, 2019

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒🤖

@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Sep 9, 2019

Sorry, @vstinner, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker a2af05a0d3f0da06b8d432f52efa3ecf29038532 3.7

@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Sep 9, 2019

GH-15789 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Sep 9, 2019
weakref.WeakValueDictionary defines a local remove() function used as
callback for weak references. This function was created with a
closure.  Modify the implementation to avoid the closure.
(cherry picked from commit a2af05a)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
vstinner added a commit that referenced this pull request Sep 9, 2019
…H-15789)

weakref.WeakValueDictionary defines a local remove() function used as
callback for weak references. This function was created with a
closure.  Modify the implementation to avoid the closure.

(cherry picked from commit a2af05a)
vrpolakatcisco added a commit to vrpolakatcisco/cpython that referenced this pull request Sep 12, 2019
weakref.WeakValueDictionary defines a local remove() function used as
callback for weak references. This function was created with a
closure.  Modify the implementation to avoid the closure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.