MCPcopy Index your code
hub / github.com/RustPython/RustPython / _split_list

Function _split_list

Lib/pydoc.py:307–322  ·  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

305 return methods
306
307def _split_list(s, predicate):
308 """Split sequence s via predicate, and return pair ([true], [false]).
309
310 The return value is a 2-tuple of lists,
311 ([x for x in s if predicate(x)],
312 [x for x in s if not predicate(x)])
313 """
314
315 yes = []
316 no = []
317 for x in s:
318 if predicate(x):
319 yes.append(x)
320 else:
321 no.append(x)
322 return yes, no
323
324_future_feature_names = set(__future__.all_feature_names)
325

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 2

predicateFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected