MCPcopy Create free account
hub / github.com/EntilZha/PyFunctional / drop_while

Method drop_while

functional/pipeline.py:398–408  ·  view source on GitHub ↗

Drops elements in the sequence while func evaluates to True, then returns the rest. >>> seq([1, 2, 3, 4, 5, 1, 2]).drop_while(lambda x: x < 3) [3, 4, 5, 1, 2] :param func: truth returning function :return: elements including and after func evaluates to Fals

(self, func)

Source from the content-addressed store, hash-verified

396 return self._transform(transformations.CACHE_T, transformations.drop_right_t(n))
397
398 def drop_while(self, func):
399 """
400 Drops elements in the sequence while func evaluates to True, then returns the rest.
401
402 >>> seq([1, 2, 3, 4, 5, 1, 2]).drop_while(lambda x: x < 3)
403 [3, 4, 5, 1, 2]
404
405 :param func: truth returning function
406 :return: elements including and after func evaluates to False
407 """
408 return self._transform(transformations.drop_while_t(func))
409
410 def take(self, n):
411 """

Callers 1

test_drop_whileMethod · 0.80

Calls 1

_transformMethod · 0.95

Tested by 1

test_drop_whileMethod · 0.64