Take elements in the sequence until func evaluates to False, then return them. >>> seq([1, 2, 3, 4, 5, 1, 2]).take_while(lambda x: x < 3) [1, 2] :param func: truth returning function :return: elements taken until func evaluates to False
(self, func)
| 423 | return self._transform(transformations.take_t(n)) |
| 424 | |
| 425 | def take_while(self, func): |
| 426 | """ |
| 427 | Take elements in the sequence until func evaluates to False, then return them. |
| 428 | |
| 429 | >>> seq([1, 2, 3, 4, 5, 1, 2]).take_while(lambda x: x < 3) |
| 430 | [1, 2] |
| 431 | |
| 432 | :param func: truth returning function |
| 433 | :return: elements taken until func evaluates to False |
| 434 | """ |
| 435 | return self._transform(transformations.take_while_t(func)) |
| 436 | |
| 437 | def union(self, other): |
| 438 | """ |