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

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

Merged
merged 2 commits into from Jan 26, 2022

Conversation

sobolevn
Copy link
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
Member Author

@sobolevn sobolevn Jan 9, 2022

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.

Doc/faq/design.rst Outdated Show resolved Hide resolved
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Copy link

@sumeshir26 sumeshir26 left a comment

LGTM

@@ -186,15 +186,15 @@ The :mod:`abc` module also provides the following decorator:

class C(ABC):
@abstractmethod
def my_abstract_method(self, ...):
def my_abstract_method(self, arg1):
Copy link
Contributor

@kumaraditya303 kumaraditya303 Jan 10, 2022

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
Member Author

@sobolevn sobolevn Jan 10, 2022

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.

merwok
merwok approved these changes Jan 18, 2022
@corona10 corona10 merged commit b9d8980 into python:main Jan 26, 2022
12 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Jan 26, 2022

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

bedevere-bot commented Jan 26, 2022

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

bedevere-bot commented Jan 26, 2022

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.

None yet

10 participants