Skip to content

gh-118577: Clarify inspect signature bound arguments #119936

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 4 commits into from
Sep 12, 2024

Conversation

nineteendo
Copy link
Contributor

@nineteendo nineteendo commented Jun 2, 2024

@nineteendo nineteendo marked this pull request as ready for review June 2, 2024 06:48
@encukou
Copy link
Member

encukou commented Sep 5, 2024

I don't think this needs so many words. Would it work to add PEP-362's wording (either to args documentation, or to the end of the class docs after the “can be used to invoke functions” note)?

Arguments which could be passed as part of either *args or **kwargs will be included only in the BoundArguments.args attribute.

@nineteendo
Copy link
Contributor Author

You're right, how about adding this to the kwargs documentation? With optionally a reference to PEP-362

kwargs that can be passed positionally are included in :meth:`args`.

@encukou
Copy link
Member

encukou commented Sep 10, 2024

Sounds good! Except they're not kwargs any more.

Arguments that can be passed positionally are included in :meth:args instead.

The PEP is already linked a bit further down. But that should be for background infromation or reasoning behind the feature. Specification and usage notes should go in the docs.

@nineteendo
Copy link
Contributor Author

Done.

@encukou encukou merged commit 8e99495 into python:main Sep 12, 2024
25 checks passed
@encukou encukou added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Sep 12, 2024
@miss-islington-app
Copy link

Thanks @nineteendo for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @nineteendo for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 12, 2024
…alues in args (pythonGH-119936)

(cherry picked from commit 8e99495)

Co-authored-by: Nice Zombies <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Sep 12, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Sep 12, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 12, 2024
…alues in args (pythonGH-119936)

(cherry picked from commit 8e99495)

Co-authored-by: Nice Zombies <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Sep 12, 2024

GH-124005 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Sep 12, 2024
@nineteendo nineteendo deleted the clarify-inspect.signature-boundargs branch September 12, 2024 12:05
encukou pushed a commit that referenced this pull request Sep 12, 2024
…values in args (GH-119936) (GH-124004)

(cherry picked from commit 8e99495)

Co-authored-by: Nice Zombies <[email protected]>
Yhg1s pushed a commit that referenced this pull request Sep 24, 2024
…values in args (GH-119936) (#124005)

gh-118577: Clarify that inspect.BoundArguments prefers to put values in args (GH-119936)
(cherry picked from commit 8e99495)

Co-authored-by: Nice Zombies <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants