Skip to content

Improve some C API documentation - #108768

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:docs-c-api-string-arg
Sep 1, 2023
Merged

serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:docs-c-api-string-arg

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Sep 1, 2023 •

Copy link
Copy Markdown
Member
  • Express functions which take argument as a C string in terms of functions which take Python object.
  • Use "note" directive for PyMapping_HasKey() and PyMapping_HasKeyString() notes.

📚 Documentation preview 📚: https://cpython-previews--108768.org.readthedocs.build/

* Express functions which take argument as a C string in terms of
  functions which take Python object.
* Use "note" directive for PyMapping_HasKey() and
  PyMapping_HasKeyString() notes.

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@vstinner

vstinner commented Sep 1, 2023

Copy link
Copy Markdown
Member

It would be nice to have a macro which can be defined to opt-out from functions known to silently ignore exceptions: capi-workgroup/problems#54 (comment)

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these changes could be backported.

@serhiy-storchaka serhiy-storchaka added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Sep 1, 2023
@vstinner

vstinner commented Sep 1, 2023

Copy link
Copy Markdown
Member

Some of these changes could be backported.

The backport should not mention functions added to Python 3.13.

Maybe don't use automated backport?

@willingc willingc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @serhiy-storchaka. Much clearer documentation now of silent errors.

Comment thread Doc/c-api/mapping.rst
@serhiy-storchaka
serhiy-storchaka merged commit 6f97eee into python:main Sep 1, 2023
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 6f97eeec222f81bd7ae836c149872a40b079e2a6 3.12

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 6f97eeec222f81bd7ae836c149872a40b079e2a6 3.11

@serhiy-storchaka
serhiy-storchaka deleted the docs-c-api-string-arg branch September 1, 2023 19:21
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Sep 1, 2023
* Express functions which take argument as a C string in terms of
  functions which take Python object.
* Use "note" directive for PyMapping_HasKey() and
  PyMapping_HasKeyString() notes..
(cherry picked from commit 6f97eee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-108785 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Sep 1, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Sep 1, 2023
* Express functions which take argument as a C string in terms of
  functions which take Python object.
* Use "note" directive for PyMapping_HasKey() and
  PyMapping_HasKeyString() notes.

(cherry picked from commit 6f97eee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Sep 1, 2023
* Express functions which take argument as a C string in terms of
  functions which take Python object.
* Use "note" directive for PyMapping_HasKey() and
  PyMapping_HasKeyString() notes.

(cherry picked from commit 6f97eee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-108786 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Sep 1, 2023
serhiy-storchaka added a commit that referenced this pull request Sep 2, 2023
* Express functions which take argument as a C string in terms of
  functions which take Python object.
* Use "note" directive for PyMapping_HasKey() and
  PyMapping_HasKeyString() notes.

(cherry picked from commit 6f97eee)
Yhg1s pushed a commit that referenced this pull request Sep 2, 2023
* Express functions which take argument as a C string in terms of
  functions which take Python object.
* Use "note" directive for PyMapping_HasKey() and
  PyMapping_HasKeyString() notes..
(cherry picked from commit 6f97eee)
@serhiy-storchaka serhiy-storchaka removed their assignment Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants