I am writing cross-compatible Python 2 and 3 code with some help from this cheatsheet . I noticed that there are different packages and modules for this: a package future(for example, future.utilsetc.), a package, sixand a built-in module __future__.
future
future.utils
six
__future__
Are there any differences that should be considered when using these packages? Should I mix and match them, or can I write fully cross-compatible code written by only one of them?
In terms of compatibility with python 2-3:
__future__ - python, python, (vs ). , unicode_literals python2.7, python3.0.
unicode_literals
python2.7
python3.0
six - / python2 python3, backport ( forward-port). python >=2.4.
python2
python3
>=2.4
future - , python>=2.6,>=3.3 .
python>=2.6,>=3.3
, , future six, python.
Source: https://habr.com/ru/post/1669148/More articles:Problems with RecyclerView: EditText loses focus - androidAdding a new Viewcontroller view as a subtask - iosAPI routing error. Several actions were found that match the query with various API paths - c #Google Smart Lock for Facebook Login - androidConvert date string with timezone to era - pythonundefined symbol: OPENSSL_sk_num - python-2.7Why could not the const & template parameter be output? - c ++Angular JS only runs one controller when I used multiple controllers on the same page - javascriptSphinx: The server sent an encoding unknown to the client. Please inform the developers - phpload file name with special characters using libcurl - c ++All Articles