-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
gh-121277: Raise nice error on next
as second argument to deprecated-removed
#124623
Conversation
…recated-removed
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 left a suggestion in case you want to be more explicit, but otherwise your version works too.
if version_removed == 'next': | ||
raise ValueError( | ||
'deprecated-removed:: second argument cannot be `next`') |
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.
if version_removed == 'next': | |
raise ValueError( | |
'deprecated-removed:: second argument cannot be `next`') | |
if version_removed == 'next': | |
raise ValueError( | |
'deprecated-removed:: second argument should be the version in which ' | |
'the API will be removed, and cannot be `next`') |
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.
Thanks for the suggestion! But I do think it's too long, and I hope anyone who adds deprecated-removed::
already knows what the args are. If they need this error to find that out, something's very wrong :)
…recated-removed (pythonGH-124623) (cherry-picked from e349f73)
…124718) * gh-121277: Allow `.. versionadded:: next` in docs (GH-121278) Make `versionchanged:: next`` expand to current (unreleased) version. When a new CPython release is cut, the release manager will replace all such occurences of "next" with the just-released version. (See the issue for release-tools and devguide PRs.) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> (cherry picked from commit 7d24ea9) * gh-121277: Raise nice error on `next` as second argument to deprecated-removed (GH-124623) (cherry-picked from e349f73)
…nGH-121278) (pythonGH-124718) * pythongh-121277: Allow `.. versionadded:: next` in docs (pythonGH-121278) Make `versionchanged:: next`` expand to current (unreleased) version. When a new CPython release is cut, the release manager will replace all such occurences of "next" with the just-released version. (See the issue for release-tools and devguide PRs.) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> (cherry picked from commit 7d24ea9) * pythongh-121277: Raise nice error on `next` as second argument to deprecated-removed (pythonGH-124623) (cherry-picked from e349f73) (cherry picked from commit dba992b) Co-authored-by: Petr Viktorin <encukou@gmail.com>
…H-125980) Make `versionchanged:: next`` expand to current (unreleased) version. When a new CPython release is cut, the release manager will replace all such occurences of "next" with the just-released version. (See the issue for release-tools and devguide PRs.) (cherry picked from commit 7d24ea9) Also backports a minor fix-up: gh-121277: Raise nice error on `next` as second argument to deprecated-removed (GH-124623) (cherry-picked from commit e349f73) Co-authored-by: Petr Viktorin <encukou@gmail.com>
Using
next
as the second argument doesn't make sense, but users should get a nicer message thanValueError: invalid literal for int()
-- especially since Sphinx hides the traceback by default... versionadded:: next
in docs #121277📚 Documentation preview 📚: https://cpython-previews--124623.org.readthedocs.build/