add section on Python 2 compatibility
This commit is contained in:
parent
38d958603b
commit
881b096a56
14
pep-0461.txt
14
pep-0461.txt
|
@ -159,6 +159,20 @@ Unsupported codes
|
|||
``%r`` (which calls ``__repr__`` and returns a ``str``) is not supported.
|
||||
|
||||
|
||||
Compatibility with Python 2
|
||||
===========================
|
||||
|
||||
As noted above, ``%s`` is being included solely to help ease migration from,
|
||||
and/or have a single code base with, Python 2. This is important as there
|
||||
are modules both in the wild and behind closed doors that currently use the
|
||||
Python 2 ``str`` type as a ``bytes`` container, and hence are using ``%s``
|
||||
as a bytes interpolator.
|
||||
|
||||
However, ``%b`` should be used in new, Python 3 only code, so ``%s`` will
|
||||
immediately be deprecated, but not removed until the next major Python
|
||||
release.
|
||||
|
||||
|
||||
Proposed variations
|
||||
===================
|
||||
|
||||
|
|
Loading…
Reference in New Issue