-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-136355: Deprecate -b
and -bb
CLI flags in 3.15
#136363
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
base: main
Are you sure you want to change the base?
Conversation
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.
This should be added to pending-removal-in-3.17.rst
?
Also, -bb
is not documented and must be unliked/escaped (I don't know what to call: !
) to stop errors.
@@ -254,6 +254,16 @@ Miscellaneous options | |||
.. versionchanged:: 3.5 | |||
Affects also comparisons of :class:`bytes` with :class:`int`. | |||
|
|||
.. deprecated-removed:: 3.15 3.17 | |||
|
|||
Deprecate :option:`-b` and :option:`-bb` |
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.
Deprecate :option:`-b` and :option:`-bb` | |
Deprecate :option:`-b` and :option:`!-bb` |
@@ -256,6 +256,7 @@ static const char usage_help[] = "\ | |||
Options (and corresponding environment variables):\n\ | |||
-b : issue warnings about converting bytes/bytearray to str and comparing\n\ | |||
bytes/bytearray with str or bytes with int. (-bb: issue errors)\n\ | |||
deprecated since 3.15 and will be removed in 3.17\n\ |
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.
deprecated since 3.15 and will be removed in 3.17\n\ | |
deprecated since 3.15 and will be removed in 3.17.\n\ |
if (!config->bytes_warning) { | ||
fprintf(stderr, | ||
"-b option is deprecated since Python 3.15 " | ||
"and will be removed in Python 3.17\n"); |
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 would prefer to move this code at the end of pyinit_core() (before done:
label). Example:
if (_Py_GetConfig()->bytes_warning) {
fprintf(stderr,
"-b option is deprecated since Python 3.15 "
"and will be removed in Python 3.17\n");
}
So it deprecates indirectly the PyConfig.bytes_warning
member.
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.
Apart from the wording changes, this LGTM.
In 3.17 no :exc:`BytesWarning` won't be raised for these cases. | ||
If you want to check for the same things in the future, | ||
use any type-checker of your choice. | ||
|
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.
Same suggestion as above.
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.
You must have forgotten to add the other suggestion, only one (this) appears for me.
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.
Hmm, Github's UI is a nightmare. Added it again.
When you're done making the requested changes, leave the comment: |
In 3.17 no :exc:`BytesWarning` won't be raised for these cases. | ||
If you want to check for the same things in the future, | ||
use any type-checker of your choice. | ||
|
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.
Suggested improved wording:
and schedule them for removal in Python 3.17.
They were mainly meant as transition helpers for Python2 -> Python3 era.
Starting with 3.17, the :exc:`BytesWarning` will be dropped for these cases.
If you want to check for the same things in the future,
please use a type-checker of your choice.
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 suggest slightly simpler;
and schedule them for removal in Python 3.17.
These were primarily helpers for the Python2 -> Python3 transition.
Starting with 3.17, no :exc:`BytesWarning` will be raised for these cases.
If you want to check for the same things in the future, use a type-checker.
They were mainly a transition helpers for Python2 -> Python3 era. | ||
In 3.17 no :exc:`BytesWarning` won't be raised for these cases. | ||
If you want to check for the same things in the future, | ||
use any type-checker of your choice. |
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.
Based on MAL and Stan's good suggestions:
They were mainly a transition helpers for Python2 -> Python3 era. | |
In 3.17 no :exc:`BytesWarning` won't be raised for these cases. | |
If you want to check for the same things in the future, | |
use any type-checker of your choice. | |
These were primarily helpers for the Python 2 -> 3 transition. | |
Starting with Python 3.17, no :exc:`BytesWarning` will be raised | |
for these cases; use a type checker instead. |
They were mainly a transition helpers for Python2 -> Python3 era. | ||
In 3.17 no :exc:`BytesWarning` won't be raised for these cases. | ||
If you want to check for the same things in the future, | ||
use any type-checker of your choice. |
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.
They were mainly a transition helpers for Python2 -> Python3 era. | |
In 3.17 no :exc:`BytesWarning` won't be raised for these cases. | |
If you want to check for the same things in the future, | |
use any type-checker of your choice. | |
These were primarily helpers for the Python 2 -> 3 transition. | |
Starting with Python 3.17, no :exc:`BytesWarning` will be raised | |
for these cases; use a type checker instead. |
-b
and-bb
CLI flags #136355📚 Documentation preview 📚: https://cpython-previews--136363.org.readthedocs.build/