Skip to content

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

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

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.

@sobolevn sobolevn added skip news needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Jan 9, 2022
Co-authored-by: Alex Waygood <[email protected]>
Copy link

@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

@@ -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

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

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

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 <[email protected]>
@bedevere-bot
Copy link

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

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Jan 26, 2022
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 <[email protected]>
miss-islington added a commit that referenced this pull request Jan 26, 2022
(cherry picked from commit b9d8980)

Co-authored-by: Nikita Sobolev <[email protected]>
miss-islington added a commit that referenced this pull request Jan 26, 2022
(cherry picked from commit b9d8980)

Co-authored-by: Nikita Sobolev <[email protected]>
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 <[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.

10 participants