Changes between Version 3 and Version 4 of Python3


Ignore:
Timestamp:
2020-07-08T15:20:15Z (5 weeks ago)
Author:
itamarst
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Python3

    v3 v4  
    28285. Fix any problems caught by the tests.
    29296. Add both M and T to `allmydata/util/_python3.py`.
    30 7. Submit for code review.
    31 8. TODO: Not yet possible, but once the ratchet infrastructure is in place, update the should-be-passing-on-Python-3 tests list to include the tests in T plus any other newly passing tests, so that future development doesn't regress Python 3 support.
     307. TODO: Not yet possible, but once the ratchet infrastructure is in place, update the should-be-passing-on-Python-3 tests list to include the tests in T plus any other newly passing tests, so that future development doesn't regress Python 3 support.
     318. Submit for code review.
     329. Check coverage report. If there are uncovered lines, see if you can add tests, or at least file a separate ticket for adding coverage.
    3233
    3334=== Porting a specific Python file ===
     
    4647}}}
    4748
     49=== When things get complicated ===
     50
     51In practice, the methodology above is somewhat idealized: a sufficiently important module might have multiple test files, and might not be easily splittable.
     52
     53This is where the test ratchet comes in.
     54The test ratchet ensures that once a specific test is marked as passing in Python 3, it can't stop passing on Python 3.
     55As a result, progress in porting need not involve a module being fully ported in one PR, or all tests being made to pass.
     56
     57Thus, complex modules can be ported over multiple PRs by just increasing the list of passing tests in each PR, and then only marking the module as fully ported in the final PR.
    4858This 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.
    4959