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

Typo in docstring for override decorator from typing module. #112152

Closed
Qua27 opened this issue Nov 16, 2023 · 3 comments · Fixed by #112158
Closed

Typo in docstring for override decorator from typing module. #112152

Qua27 opened this issue Nov 16, 2023 · 3 comments · Fixed by #112158
Labels
docs Documentation in the Doc dir topic-typing

Comments

@Qua27
Copy link
Contributor

Qua27 commented Nov 16, 2023

typing module documentation

Typo description

A typo in docstring for override decorator. Under Usage:: we see the following code.

class Base:
    def method(self) -> None: ...
        pass

class Child(Base):
    @override
    def method(self) -> None:
        super().method()

Both ... and pass are used in Base's class method. Since ... has already been used, pass statement does not relate to the method at all, causing IndentationError.

Suggested solution: remove ...

class Base:
    def method(self) -> None:
        pass

class Child(Base):
    @override
    def method(self) -> None:
        super().method()

def method(self) -> None: ...

Linked PRs

@Qua27 Qua27 added the docs Documentation in the Doc dir label Nov 16, 2023
@sobolevn
Copy link
Member

@Qua27 please, send a PR with the fix :)

@Qua27
Copy link
Contributor Author

Qua27 commented Nov 16, 2023

@sobolevn, I'm excited to make my first contribution here, and I appreciate your understanding as I navigate through the process. If there's anything specific I should keep in mind or if you have any feedback, please feel free to let me know. Thanks for welcoming newcomers like me!

@sobolevn
Copy link
Member

Thank you for your report and williness to fix the problem :)

Nothing important for this specific issue that I can think about.
For future contributions, you can read the devguide: https://devguide.python.org

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 16, 2023
…2158)

(cherry picked from commit 12c7e9d)

Co-authored-by: Qua27 <92877777+Qua27@users.noreply.github.com>
AlexWaygood pushed a commit that referenced this issue Nov 16, 2023
…#112162)

GH-112152: Fix typo in `typing.override` docstring (GH-112158)
(cherry picked from commit 12c7e9d)

Co-authored-by: Qua27 <92877777+Qua27@users.noreply.github.com>
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
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 topic-typing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants