Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
95526654
Commit
95526654
authored
Mar 06, 2000
by
Greg Ward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrote 'newer_pairwise(): more natural (and incompatible) interface,
simpler implementation.
parent
32c4a8a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
Lib/distutils/util.py
Lib/distutils/util.py
+13
-12
No files found.
Lib/distutils/util.py
View file @
95526654
...
...
@@ -100,22 +100,23 @@ def newer (source, target):
def
newer_pairwise
(
sources
,
targets
):
"""Walk two filename lists in parallel, testing if each
'target' is
up-to-date relative to its corresponding 'source'. If so, both
are deleted from their respective lists. Return a list of tuples
containing the deleted (source,target) pairs
."""
"""Walk two filename lists in parallel, testing if each
source is newer
than its corresponding target. Return a pair of lists (sources,
targets) where source is newer than target, according to the
semantics of 'newer()'
."""
if
len
(
sources
)
!=
len
(
targets
):
raise
ValueError
,
"'sources' and 'targets' must be same length"
goners
=
[]
for
i
in
range
(
len
(
sources
)
-
1
,
-
1
,
-
1
):
if
not
newer
(
sources
[
i
],
targets
[
i
]):
goners
.
append
((
sources
[
i
],
targets
[
i
]))
del
sources
[
i
]
del
targets
[
i
]
goners
.
reverse
()
return
goners
# build a pair of lists (sources, targets) where source is newer
n_sources
=
[]
n_targets
=
[]
for
i
in
range
(
len
(
sources
)):
if
newer
(
sources
[
i
],
targets
[
i
]):
n_sources
.
append
(
sources
[
i
])
n_targets
.
append
(
targets
[
i
])
return
(
n_sources
,
n_targets
)
# newer_pairwise ()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment