Default: ``0``.
+ .. deprecated-removed:: 3.15 3.17
+
+ The :option:`-b` and :option:`!-bb` options will become no-op in 3.17.
+ :c:member:`~PyConfig.bytes_warning` member will be removed in 3.17.
+
.. c:member:: int warn_default_encoding
If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io.TextIOWrapper`
.. versionchanged:: 3.5
Affects also comparisons of :class:`bytes` with :class:`int`.
+ .. deprecated:: 3.15
+
+ Deprecate :option:`-b` and :option:`!-bb` command line options
+ and schedule them to become no-op in Python 3.17.
+ 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.
+
+
.. option:: -B
If given, Python won't try to write ``.pyc`` files on the
Deprecated
==========
+CLI
+---
+
+* Deprecate :option:`-b` and :option:`!-bb` command line options
+ and schedule them to become no-op in Python 3.17.
+ 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.
+
+ (Contributed by Nikita Sobolev in :gh:`136355`.)
+
hashlib
-------
:c:func:`_Py_c_abs` are :term:`soft deprecated`.
(Contributed by Sergey B Kirpichev in :gh:`128813`.)
+* :c:member:`~PyConfig.bytes_warning` is deprecated
+ since 3.15 and will be removed in 3.17.
+ (Contributed by Nikita Sobolev in :gh:`136355`.)
+
.. Add C API deprecations above alphabetically, not here at the end.
--- /dev/null
+Deprecate :c:member:`PyConfig.bytes_warning` field and schedule its removal
+in 3.17.
--- /dev/null
+Deprecate :option:`-b` and :option:`!-bb` command line options
+and schedule them to become no-op in Python 3.17.
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 become no-op in 3.17.\n\
-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x\n\
-c cmd : program passed in as string (terminates option list)\n\
-d : turn on parser debugging output (for experts only, only works on\n\