MCPcopy Index your code
hub / github.com/python/cpython / _split_list

Function _split_list

Lib/pydoc.py:242–257  ·  view source on GitHub ↗

Split sequence s via predicate, and return pair ([true], [false]). The return value is a 2-tuple of lists, ([x for x in s if predicate(x)], [x for x in s if not predicate(x)])

(s, predicate)

Source from the content-addressed store, hash-verified

240 return methods
241
242def _split_list(s, predicate):
243 """Split sequence s via predicate, and return pair ([true], [false]).
244
245 The return value is a 2-tuple of lists,
246 ([x for x in s if predicate(x)],
247 [x for x in s if not predicate(x)])
248 """
249
250 yes = []
251 no = []
252 for x in s:
253 if predicate(x):
254 yes.append(x)
255 else:
256 no.append(x)
257 return yes, no
258
259_future_feature_names = set(__future__.all_feature_names)
260

Callers 8

spillMethod · 0.85
spilldescriptorsMethod · 0.85
spilldataMethod · 0.85
docclassMethod · 0.85
spillMethod · 0.85
spilldescriptorsMethod · 0.85
spilldataMethod · 0.85
docclassMethod · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…