X Tutup
Skip to content

bpo-43698: do not use ... as argument name in docs#30502

Merged
corona10 merged 2 commits intopython:mainfrom
sobolevn:issue-43698
Jan 26, 2022
Merged

bpo-43698: do not use ... as argument name in docs#30502
corona10 merged 2 commits intopython:mainfrom
sobolevn:issue-43698

Conversation

@sobolevn
Copy link
Copy Markdown
Member

@sobolevn sobolevn commented Jan 9, 2022

Some people might think that ... is allowed as an argument name (or might think that it is some kind of special syntax like * or /). I believe that using valid syntax in our examples is better.

So, now all examples with ... are refactored to use regular names. Now it will be easier to copy-paste examples for our users.

https://bugs.python.org/issue43698

CC @corona10 as my mentor.

@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label Jan 9, 2022
def visit_a(self, ...):
...
...
class MyVisitor:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This case is special. There was no class context defined. I've added it as well.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Copy link
Copy Markdown

@sumeshir26 sumeshir26 left a comment

Choose a reason for hiding this comment

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

LGTM

class C(ABC):
@abstractmethod
def my_abstract_method(self, ...):
def my_abstract_method(self, arg1):
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.

Suggested change
def my_abstract_method(self, arg1):
def my_abstract_method(self, arg):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've used explicitly different names to highlight that they are different.

@corona10 corona10 merged commit b9d8980 into python:main Jan 26, 2022
@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @sobolevn for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@bedevere-bot
Copy link
Copy Markdown

GH-30917 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 26, 2022
(cherry picked from commit b9d8980)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-bot
Copy link
Copy Markdown

GH-30918 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 26, 2022
(cherry picked from commit b9d8980)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington added a commit that referenced this pull request Jan 26, 2022
(cherry picked from commit b9d8980)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington added a commit that referenced this pull request Jan 26, 2022
(cherry picked from commit b9d8980)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
(cherry picked from commit b9d8980)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
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.

10 participants

X Tutup