Changes between Version 10 and Version 11 of Python3


Ignore:
Timestamp:
2020-07-22T14:26:50Z (4 years ago)
Author:
itamarst
Comment:

Known issues.

Legend:

Unmodified
Added
Removed
Modified
  • Python3

    v10 v11  
    8484**Fifth**, add a note to the module docstring saying it was ported to Python 3.
    8585
    86 === Other notes ===
     86== Known issues with `future` ==
     87
     88The `from builtins import <every builtin ever>` thing gives a decent Python 3 layer for Python 2. For example it'll automatically create `__nonzero__` to wrap a `__bool__`.
     89
     90But there are caveats.
     91
     92One of them is the `bytes` objects:
     93
     941. `builtins.bytes.translate` are `builtins.bytes.maketrans` buggy on PyPy. One way to fix this is with a `if PY2: translate = string.translate else: translate = bytes.translate`.
     952. The behavior with `b"%s" % some_bytes_object` works fine if both objects are Future `builtins.bytes`, or both objects are native Python 2 strings/bytes, but not if you combine them. This has caused bugs. One way to fix this is by exposing only native byte strings for now, see e.g. `allmydata.util.base32`.
     96
     97== Other notes ==
    8798
    8899If you just want to run the tests from the explicitly ported test modules, you can do `python -m allmydata.util._python3`.