Changes between Version 74 and Version 75 of Python3


Ignore:
Timestamp:
2021-02-15T18:19:21Z (3 years ago)
Author:
jaraco
Comment:

Update fourth step again, this time to delete all instances of from builtins import name

Legend:

Unmodified
Added
Removed
Modified
  • Python3

    v74 v75  
    121121This 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.
    122122
     123Then, delete any instances of `from builtins import <name>`.
     124
    123125Consider using this sed command to execute the above:
    124126
    125127{{{
    126 $ sed -ie '/from future import standard_library/d;/standard_library.install_aliases()/d;/from builtins import str/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/' src/allmydata/test/test_runner.py
     128$ 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/;/from builtins import .*/d' path/to/file.py
    127129}}}
    128130