MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / newer_pairwise

Function newer_pairwise

tools/python-3.11.9-amd64/Lib/distutils/dep_util.py:32–49  ·  view source on GitHub ↗

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()'.

(sources, targets)

Source from the content-addressed store, hash-verified

30
31
32def newer_pairwise (sources, targets):
33 """Walk two filename lists in parallel, testing if each source is newer
34 than its corresponding target. Return a pair of lists (sources,
35 targets) where source is newer than target, according to the semantics
36 of 'newer()'.
37 """
38 if len(sources) != len(targets):
39 raise ValueError("'sources' and 'targets' must be same length")
40
41 # build a pair of lists (sources, targets) where source is newer
42 n_sources = []
43 n_targets = []
44 for i in range(len(sources)):
45 if newer(sources[i], targets[i]):
46 n_sources.append(sources[i])
47 n_targets.append(targets[i])
48
49 return (n_sources, n_targets)
50
51# newer_pairwise ()
52

Callers 1

test_newer_pairwiseMethod · 0.90

Calls 2

newerFunction · 0.70
appendMethod · 0.45

Tested by 1

test_newer_pairwiseMethod · 0.72