Skip to content

gh-144473: Add "steal" term to glossary; clarify "stealing" on error#144474

Closed
encukou wants to merge 13 commits intopython:mainfrom
encukou:steal-doc
Closed

gh-144473: Add "steal" term to glossary; clarify "stealing" on error#144474
encukou wants to merge 13 commits intopython:mainfrom
encukou:steal-doc

Conversation

@encukou
Copy link
Member

@encukou encukou commented Feb 4, 2026

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.
Copy link
Member

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".

Copy link
Member Author

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?

Copy link
Member

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>`".
Copy link
Member

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.

encukou and others added 12 commits February 5, 2026 14:25
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>
@encukou
Copy link
Member Author

encukou commented Feb 5, 2026

Sorry for the noise, everyone :(

New PR: 144502

@encukou encukou closed this Feb 5, 2026
@encukou encukou deleted the steal-doc branch February 5, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news topic-C-API

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

9 participants