Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-47054: Call params parameters not arguments in SyntaxErrors.#32014

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
gpshead wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromgpshead:parameters-not-arguments-bpo47054

Conversation

gpshead
Copy link
Member

@gpsheadgpshead commentedMar 20, 2022
edited by bedevere-bot
Loading

A couple of SyntaxErrors were potentionally confusing in their wording
due to the use of the term arguments when what it was referring are
pedantically parameters as the errors happen at definition time.

We unfortunately use the terms loosely in various parts of Python.

https://stackoverflow.com/questions/156767/whats-the-difference-between-an-argument-and-a-parameter#:~:text=A%20parameter%20is%20the%20variable,function%20when%20it%20is%20called.

https://bugs.python.org/issue47054

A couple of SyntaxErrors were potentionally confusing in their wordingdue to the use of the term arguments when what it was referring arepedantically parameters as the errors happen at definition time.We unfortunately use the terms loosely in various parts of Python.https://stackoverflow.com/questions/156767/whats-the-difference-between-an-argument-and-a-parameter#:~:text=A%20parameter%20is%20the%20variable,function%20when%20it%20is%20called.
@gpshead
Copy link
MemberAuthor

Wording questions to ponder: Are they "default parameters" or "keyword parameters" potentially with a "non-" prefix, or are they "parameters with a default" and "parameters without a default" or "naked parameters" or "lone parameters"?

@gpshead
Copy link
MemberAuthor

I'll update the golden value error message tests once we've agreed upon wording.

@Bluenix2
Copy link
Contributor

The most verbose and explicit definition would be: "a parameter with a default argument". Afterall, it is a parameter that has a default argument that gets passed if there is no argument. You could shorten this to "a parameter with a default" (optionally including "value" at the end). Technically you could also say "defaulted parameter" (reads better) - because if no argument is passed the parameter is defaulted with a default argument - which would be even shorter.

I do think "a keyword parameter" in the current changes might even be more confusing with a keyword-only parameter than the original saying of calling a parameter an argument though.

kevinalh reacted with thumbs up emoji

@Bluenix2
Copy link
Contributor

Bluenix2 commentedMar 21, 2022
edited
Loading

Going off of my previous comment about a "defaulted parameter"; why not use "required parameter" for a parameter that lacks a default argument?

Now not only will this PR be more technically accurate, it'll also make the error easier to read:

- SyntaxError: non-default argument follows default argument+ SyntaxError: required parameter follows defaulted parameter

...alternatively (since there is still repetition)...

- SyntaxError: non-default argument follows default argument+ SyntaxError: required parameter follows parameter with a default value

I found myself tripping over the repetition of the previous error message and this should make it easy to tell the exact issue with the parameters. In the latter codeblock "value" could be replaced by "argument", either way it removes all repetition.

@gpsheadgpshead added the staleStale PR or inactive for long period of time. labelMay 25, 2023
@gpsheadgpshead requested a review fromCAM-GerlachMay 25, 2023 22:04
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

@CAM-GerlachCAM-GerlachAwaiting requested review from CAM-Gerlach

Assignees
No one assigned
Labels
awaiting core reviewstaleStale PR or inactive for long period of time.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@gpshead@Bluenix2@the-knights-who-say-ni@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp