“Safe” mode – from Py2 to modern Py2 or Py3 to more-compatible Py3
Split the fixers into two categories: safe and bold
Safe is highly unlikely to break existing Py2 or Py3 support. The
output of this still requires future
imports. Examples:
- Compatible metaclass syntax on Py3
- Explicit inheritance from object on Py3
Bold might make assumptions about which strings on Py2 should be unicode strings and which should be bytestrings.
Windows support
future.standard_library
module. (See the uprefix module for how
to do this.)Experimental: - Add:
from future import bytes_literals
from future import new_metaclass_syntax
from future import new_style_classes
[Done] Maybe:
from future.builtins import str
should import a custom str is a Py3 str-like object which inherits from unicode and removes the decode() method and has any other Py3-like behaviours (possibly stricter casting?)