Changes between Version 72 and Version 73 of Python3
- Timestamp:
- 2021-02-15T17:32:03Z (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Python3
v72 v73 99 99 **Second**, run `futurize --write --both-stages --all-imports path/to/file.py`. 100 100 101 **Third**, fix the imports ( TODO this can probably be automated).101 **Third**, fix the imports (automation below). 102 102 103 103 Delete this bit: … … 119 119 120 120 This adds builtins that match Python 3's semantics. The `#noqa: F401` keeps flake8/pyflakes from complaining about unused imports. We do unused imports so that people changing code later don't have to manually check if `map()` is old style or new style. 121 122 Consider using this sed command to execute the above: 123 124 {{{ 125 $ sed -ie '/from future import standard_library/d;/standard_library.install_aliases()/d;s/from builtins import \*/from future.utils import PY2\\nif PY2:\\n from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401/' path/to/file.py 126 }}} 121 127 122 128 **Fourth**, manually review the code. Futureize is nice, but it very definitely doesn't catch everything, or it makes wrong decisions.