A major source of inconsistency across the 2 platforms is how bytes is handled in 2.7 and 3.6. In 2.7, bytes is simply an alias for str. This causes several issues.
Many of the types defined in the library define the __bytes__ function for serialization, etc, which will not be called in 2.7, as bytes calls down to str.
There are a fair number of instances of performing integer math on bytes arrays, which fails because in 2.7, the bytes object is interpreted as str.
I've attempted to solve this issue with guidance from @john-g-g under the broader python 2 compat work, however, I am going to look at implementing the python-futures, which offers to create a unified bytes object across both platforms.
Doneness: Library passes 65/65 current tests in both Python 2.7 and 3.6
A major source of inconsistency across the 2 platforms is how
bytes
is handled in 2.7 and 3.6. In 2.7,bytes
is simply an alias forstr
. This causes several issues.Many of the types defined in the library define the
__bytes__
function for serialization, etc, which will not be called in 2.7, asbytes
calls down tostr
.There are a fair number of instances of performing integer math on bytes arrays, which fails because in 2.7, the
bytes
object is interpreted asstr
.I've attempted to solve this issue with guidance from @john-g-g under the broader
python 2 compat
work, however, I am going to look at implementing the python-futures, which offers to create a unifiedbytes
object across both platforms.Doneness: Library passes 65/65 current tests in both Python 2.7 and 3.6