-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-38218: Corrected syntax for return annotation #16265
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
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the catch.
Doc/tutorial/errors.rst
Outdated
@@ -400,7 +400,7 @@ If a :keyword:`finally` clause is present, the :keyword:`finally` clause will ex | |||
|
|||
For example:: | |||
|
|||
>>> def bool_return(): -> bool: | |||
>>> def bool_return() -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this function should use a return annotation. No other code or examples (except related to the typing module) use annotations. I think it was intended as
def bool_return(): # -> bool
Or maybe -> bool:
should be removed at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, happy to make that adjustment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seconding the
Or maybe -> bool: should be removed at all.
suggestion.
Signed-off-by: Jason Plurad <pluradj@us.ibm.com>
ffd57e4
to
076a963
Compare
I've submitted the CLA just now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this is an example of non-recommended code.
Thanks @pluradj for the PR, and @matrixise for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
Signed-off-by: Jason Plurad <pluradj@us.ibm.com> (cherry picked from commit 9ab6038) Co-authored-by: Jason Plurad <pluradj@us.ibm.com>
GH-16272 is a backport of this pull request to the 3.8 branch. |
GH-16273 is a backport of this pull request to the 3.7 branch. |
Signed-off-by: Jason Plurad <pluradj@us.ibm.com> (cherry picked from commit 9ab6038) Co-authored-by: Jason Plurad <pluradj@us.ibm.com>
Thank you for your PR, because it's a type-documentation PR, I merge it into master, 3.8 and 3.7. |
Thanks @pluradj for the PR, and @matrixise for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Thanks @pluradj for the PR, and @matrixise for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Signed-off-by: Jason Plurad <pluradj@us.ibm.com> (cherry picked from commit 9ab6038) Co-authored-by: Jason Plurad <pluradj@us.ibm.com>
GH-16274 is a backport of this pull request to the 3.8 branch. |
GH-16275 is a backport of this pull request to the 3.7 branch. |
Signed-off-by: Jason Plurad <pluradj@us.ibm.com> (cherry picked from commit 9ab6038) Co-authored-by: Jason Plurad <pluradj@us.ibm.com>
Signed-off-by: Jason Plurad pluradj@us.ibm.com
https://bugs.python.org/issue38218