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-39153: Clarify refcounting semantics #18220

Merged
merged 3 commits into from Jan 29, 2020
Merged

Conversation

@nanjekyejoannah
Copy link
Contributor

nanjekyejoannah commented Jan 27, 2020

Clarify refcounting semantics for the following functions:

  • PyObject_SetItem
  • PyMapping_SetItemString
  • PyDict_SetItem
  • PyDict_SetItemString

https://bugs.python.org/issue39153

nanjekyejoannah
@brandtbucher

This comment has been minimized.

Copy link
Member

brandtbucher commented Jan 28, 2020

Thanks @nanjekyejoannah; I can't tell you how many times I've had to dig through the source code to remember this!

@nanjekyejoannah

This comment has been minimized.

Copy link
Contributor Author

nanjekyejoannah commented Jan 28, 2020

@ncoghlan and @serhiy-storchaka , if this looks fine, I will merge it.

Copy link
Member

corona10 left a comment

@nanjekyejoannah
Thanks for the great work.
I left some feedback for this PR :)

Doc/c-api/dict.rst Show resolved Hide resolved
nanjekyejoannah
Copy link
Member

corona10 left a comment

LGTM

@ncoghlan ncoghlan merged commit e1e8000 into python:master Jan 29, 2020
5 checks passed
5 checks passed
Docs
Details
Azure Pipelines PR #20200128.34 succeeded
Details
bedevere/issue-number Issue number 39153 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jan 29, 2020

Thanks @nanjekyejoannah for the PR, and @ncoghlan for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 29, 2020

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

miss-islington added a commit to miss-islington/cpython that referenced this pull request Jan 29, 2020
Some of the *SetItem methods in the C API steal a reference to the
given value. This annotates the better behaved ones to assure the
reader that these are not the ones with the inconsistent behaviour.

* 📜🤖 Added by blurb_it.

* make docs consistent with signature

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit e1e8000)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
miss-islington added a commit that referenced this pull request Jan 29, 2020
Some of the *SetItem methods in the C API steal a reference to the
given value. This annotates the better behaved ones to assure the
reader that these are not the ones with the inconsistent behaviour.

* 📜🤖 Added by blurb_it.

* make docs consistent with signature

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit e1e8000)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.