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

Method drop_right

functional/pipeline.py:386–396  ·  view source on GitHub ↗

Drops the last n elements of the sequence. >>> seq([1, 2, 3, 4, 5]).drop_right(2) [1, 2, 3] :param n: number of elements to drop :return: sequence with last n elements dropped

(self, n)

Source from the content-addressed store, hash-verified

384 return self._transform(transformations.drop_t(n))
385
386 def drop_right(self, n):
387 """
388 Drops the last n elements of the sequence.
389
390 >>> seq([1, 2, 3, 4, 5]).drop_right(2)
391 [1, 2, 3]
392
393 :param n: number of elements to drop
394 :return: sequence with last n elements dropped
395 """
396 return self._transform(transformations.CACHE_T, transformations.drop_right_t(n))
397
398 def drop_while(self, func):
399 """

Callers 1

test_drop_rightMethod · 0.80

Calls 1

_transformMethod · 0.95

Tested by 1

test_drop_rightMethod · 0.64