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

Improve some C API documentation #108768

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented 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.

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

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@vstinner
Copy link
Member

vstinner commented Sep 1, 2023

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)

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

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 bug and security fixes labels Sep 1, 2023
@vstinner
Copy link
Member

vstinner commented Sep 1, 2023

Some of these changes could be backported.

The backport should not mention functions added to Python 3.13.

Maybe don't use automated backport?

Copy link
Contributor

@willingc willingc left a comment

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.

Doc/c-api/mapping.rst Show resolved Hide resolved
@serhiy-storchaka serhiy-storchaka merged commit 6f97eee into python:main Sep 1, 2023
19 checks passed
@miss-islington
Copy link
Contributor

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

@miss-islington
Copy link
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
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

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 bug and 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

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