8000 gh-98712: Clarify "readonly bytes-like object" semantics in C arg-parsing docs by encukou · Pull Request #98710 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-98712: Clarify "readonly bytes-like object" semantics in C arg-parsing docs #98710

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

Merged
merged 2 commits into from
Dec 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix wording that still ended up confusing
  • Loading branch information
encukou committed Oct 27, 2022
commit c746f31b900a482f24fae9dc9d1a7c79379bad36
6 changes: 3 additions & 3 deletions Doc/c-api/arg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ There are three ways strings and buffers can be converted to C:

* .. _c-arg-borrowed-buffer:

Other formats take a read-only :term:`bytes-like object`, such as
:class:`bytes` or :class:`str`, and provide a ``const char *`` pointer to
Other formats take a :class:`str` or a read-only :term:`bytes-like object`,
such as :class:`bytes`, and provide a ``const char *`` pointer to
its buffer.
In this case the buffer is "borrowed": it is managed by the corresponding
Python object, and shares the lifetime of this object.
Expand All @@ -64,7 +64,7 @@ There are three ways strings and buffers can be converted to C:
but also some read-only objects such as :class:`memoryview` of
:class:`bytes`.

Besides this ``bf_releasebuffer`` requirement, the functions do not verify
Besides this ``bf_releasebuffer`` requirement, there is no check to verify
whether the input object is immutable (e.g. whether it would honor a request
for a writable buffer, or whether another thread can mutate the data).

Expand Down
0