-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
warnings.warn(...)
arguments include '\*', which is wrong - 3.12
#114811
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
Thank you for the report! Yep, this shows up at https://docs.python.org/3/library/warnings.html#warnings.warn but not https://docs.python.org/3.11/library/warnings.html#warnings.warn Looking at the code: Lines 297 to 298 in 3e06cce
You're right, this should just be This means the arguments to the right of the asterisk are keyword-only. I guess the original author added the slash in an attempt to escape it, but it's actually not needed here. Would you like to make a PR to fix it? The file to fix is https://github.com/python/cpython/blob/main/Doc/library/warnings.rst |
Regression in 3.12. (cherry picked from commit ff8939e) Co-authored-by: Pradyot Ranjan <[email protected]>
…4837) Regression in 3.12. (cherry picked from commit ff8939e) Co-authored-by: Pradyot Ranjan <[email protected]>
Thanks for catching and patching the error. |
Documentation
Looking at the online python docs at https://docs.python.org/3.11/library/warnings.html#warnings.warn. The function call is listed on the site like this:
As far as I know (my apologies if I am very wrong),
\*
isn't a valid argument, and it should just be*
.Best guess is that since the actual code (here) has a linebreak in the arguments, that linebreak got formatted for the docs as a
\*
.I saw this all come up in this stackoverflow question where other people thought it all through, i'm just posting the issue.
This seems to be new in 3.12
Linked PRs
The text was updated successfully, but these errors were encountered: