-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
gh-144473: Add "steal" term to glossary; clarify "stealing" on error #144474
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
Conversation
With one exception, all "stealing" functions also steal on error, but it makes sense to note this in each case.
|
|
||
| steal | ||
| In Python's C API, "*stealing*" an argument means that ownership of the | ||
| argument is transferred to the called function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may add something like: "The caller must not use that reference after the call".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added that to the api-refcountdetails that's linked below. Do you think it needs to be here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it needs to be here as well?
Yes, IMO it's worth it to repeat it here.
| created, the old reference to *bytes* will still be discarded and the value | ||
| of *\*bytes* will be set to ``NULL``; the appropriate exception will be set. | ||
| appended to *bytes*; the caller will own the new reference. | ||
| The reference to the old value of *bytes* will be ":term:`stolen <steal>`". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of putting "steal(s)" in quotations. If the user is confused about the term, then they can just click it to go to the glossary. Otherwise, the user knows the term, so it shouldn't be in scare quotes.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
…python#144339) Ignore "math.integer" extension if "math" is in sys.stdlib_module_names.
pythonGH-141985) Co-authored-by: Blaise Pabon <blaise@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…GH-144279) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…44369) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…ythonGH-144154) Suggest the normalized name or the closest name to the normalized name. If the suggested name is not ASCII, include also its ASCII representation.
…ns` and `itertools.combinations_with_replacement` thread-safe (pythongh-144402)
…ythonGH-144437) * Add three new symbol kinds * Do not smuggle code object in _PUSH_FRAME operand * Fix small bug in predicate analysis
…on#144469) Move classmethod and staticmethod initialization from __init__() to __new__(). PyClassMethod_New() and PyStaticMethod_New() now copy attributes of the wrapped functions: __module__, __name__, __qualname__ and __doc__. Change static type initialization: initialize PyStaticMethod_Type and PyCFunction_Type earlier. Remove test_refleaks_in_classmethod___init__() and test_refleaks_in_staticmethod___init__() tests from test_descr since classmethod and staticmethod have no __init__() method anymore.
* Update to 2.7.4 * update expat license copyright year to match and a pedantic #define * include COPYING update in refresh.sh * Update checksum for copying --------- Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
Sorry for the noise, everyone :( New PR: 144502 |
📚 Documentation preview 📚: https://cpython-previews--144474.org.readthedocs.build/