Sorry, something went wrong.
Codecov ReportMerging #24 into master will increase coverage by <.01%. @@ Coverage Diff @@
## master #24 +/- ##
==========================================
+ Coverage 82.37% 82.37% +<.01%
==========================================
Files 1427 1427
Lines 350948 351009 +61
==========================================
+ Hits 289088 289144 +56
- Misses 61860 61865 +5
Continue to review full report at Codecov. Legend - Click here to learn more |
Sorry, something went wrong.
|
@benjaminp: Are you the right person to ping about lib2to3 PRs? |
Sorry, something went wrong.
| | | ||
| power< | ||
| 'map' trailer< '(' [arglist=any] ')' > | ||
| 'map' args=trailer< '(' [any] ')' > |
There was a problem hiding this comment.
What's the reason for this change?
Sorry, something went wrong.
There was a problem hiding this comment.
What's the reason for this change?
On line 100 (below), I need to clone the argument list:
If I leave the above line unchanged, then I could have written this, instead:
...but there's a problem with that: It doesn't clone the ( and ) tokens -- it creates them from scratch. As a result, one of the tests fails, due to an unpreserved prefix before the ) token:
Hence, I think it's best to capture and clone the whole trailer. But if I'm missing something, please let me know.
Sorry, something went wrong.
There was a problem hiding this comment.
Okay, thanks for the explanation.
Sorry, something went wrong.
The 2to3 tool will automatically wrap calls to map, zip, and filter with list():
...but the tool misses some cases, if the call is followed by a "trailer" such as [0]:
This PR augments the lib2to3 "fixers" for map, zip, and filter to correctly handle such cases.
http://bugs.python.org/issue28837