Changes between Version 14 and Version 15 of Python3


Ignore:
Timestamp:
2020-09-11T18:11:04Z (11 days ago)
Author:
itamarst
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Python3

    v14 v15  
    6464}}}
    6565
    66 === When things get complicated ===
    67 
    68 In practice, the methodology above is somewhat idealized: a sufficiently important module might have multiple test files, and might not be easily splittable.
    69 
    70 This is where the test ratchet comes in.
    71 The test ratchet ensures that once a specific test is marked as passing in Python 3, it can't stop passing on Python 3.
    72 As a result, progress in porting need not involve a module being fully ported in one PR, or all tests being made to pass.
    73 
    74 Thus, 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.
    7566This 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.
    7667
     
    9990Leaking Future objects (newints, new dicts, new bytes) in module API can break existing code on Python 2. So need to be careful not to do that. For that reason int isn't in the suggested `from builtins import ...` list above.
    10091
     92== When ports get harder due to spaghetti dependencies ==
     93
     94As the port progresses, the simple "port module + its test module" gets difficult, since everything ends up depending on everything else.
     95Here's on way to approach this:
     96
     971. Port _only_ the test module. This involves many fixes to lots of other modules, but they are not officially ported, they're just inched along just enough to make the tests pass. Since the test module is officially ported, regressions to the Python 3 port still are prevented.
     982. Then, port the corresponding module.
     99
    101100== Other notes ==
    102101
    103102If you just want to run the tests from the explicitly ported test modules, you can do `python -m allmydata.util._python3`.
     103