[Python-Dev] PEP 4000 to explicitly declare we won't be doing a Py3k style compatibility break again?

Terry Reedy tjreedy at udel.edu
Thu Aug 21 09:32:15 CEST 2014

On 8/20/2014 8:27 PM, Joseph Martinot-Lagarde wrote:

> The pain was even bigger because in addition to the change in underlying
> types, the names of the types were not compatible between the python
> versions. I often try to write compatible code between python2 and 3,
> and I can't use "str" because it has not the same meaning in both
> versions, I can not use "unicode" because it disappeared in python3,

And bridge library should have the equivalent of
if 'py3': unicode = str

> I can't use "byte" because it doesn't exist in python2.

2.7 (and 2.6?) already has
if 'py2': bytes = str
and I presume bridge libraries targeted before that was added include it 

Terry Jan Reedy

More information about the Python-Dev mailing list