-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Use syntactically correct examples on abc package page #87864
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
Comments
There are code snippets on the package's page (https://docs.python.org/3.10/library/abc.html) like this: class C(ABC):
@classmethod
@abstractmethod
def my_abstract_classmethod(cls, ...):
... Here, the author probably wanted to demonstrate that the method may have any other arguments in addition to def my_abstract_classmethod(cls, ...):
^
SyntaxError: invalid syntax Additionally it uses the same Ellipsis as in the method's body (that is supposed to indicate a stub), which is confusing. I think that all code samples must be syntactically correct, so that if a reader copypastes them into their code editor they would work right away. I suggest to remove ellipsis in the argument lists everywhere on the page and replace them with one of the following:
|
Thank you, I fully agree that this can be improved. Please, take a look at #30502 |
(misclick, sorry) @slateny yes, good catch. I will send a PR. |
…ythonGH-103312) (cherry picked from commit 50b4b15) Co-authored-by: Nikita Sobolev <[email protected]>
(cherry picked from commit 50b4b15) Co-authored-by: Nikita Sobolev <[email protected]>
Fixed! Please, open new issues for any leftovers :) |
...
as argument name in docs #30502...
as argument name in docs (GH-30502) #30917...
as argument name in docs (GH-30502) #30918Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: