Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sobolevn wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromsobolevn:issue-136355

Conversation

sobolevn
Copy link
Member

@sobolevnsobolevn commentedJul 7, 2025
edited by github-actionsbot
Loading

Copy link
Member

@StanFromIrelandStanFromIreland left a 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 topending-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`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
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\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
deprecatedsince3.15andwillberemovedin3.17\n\
deprecatedsince3.15andwillberemovedin3.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");
Copy link
Member

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() (beforedone: 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 thePyConfig.bytes_warning member.

sobolevn reacted with thumbs up emoji
Copy link
Member

@malemburgmalemburg left a 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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Same suggestion as above.

Copy link
Member

@StanFromIrelandStanFromIrelandJul 7, 2025
edited
Loading

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.

Copy link
Member

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.

StanFromIreland reacted with thumbs up emoji
@bedevere-app
Copy link

When you're done making the requested changes, leave the comment:I have made the requested changes; please review again.

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.

Copy link
Member

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.

Copy link
Member

@StanFromIrelandStanFromIrelandJul 7, 2025
edited by hugovk
Loading

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.

Comment on lines +261 to +264
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.
Copy link
Member

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:

Suggested change
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.

Comment on lines +214 to +217
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnervstinner left review comments

@hugovkhugovkhugovk left review comments

@malemburgmalemburgmalemburg requested changes

@StanFromIrelandStanFromIrelandStanFromIreland left review comments

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@sobolevn@vstinner@hugovk@malemburg@StanFromIreland

[8]ページ先頭

©2009-2025 Movatter.jp