diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2022-08-27 15:10:50 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2022-08-27 15:56:07 +0300 |
commit | 704a2cac1eb8d00c074bac051f0d7dc9fa8f14c5 (patch) | |
tree | 0daa758ed249ba3c3dab60e0e43832c738b9777e /src/snakeoil/iterables.py | |
parent | test: remove TestCase (diff) | |
download | snakeoil-704a2cac1eb8d00c074bac051f0d7dc9fa8f14c5.tar.gz snakeoil-704a2cac1eb8d00c074bac051f0d7dc9fa8f14c5.tar.bz2 snakeoil-704a2cac1eb8d00c074bac051f0d7dc9fa8f14c5.zip |
docs: cleanup and fix warnings
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'src/snakeoil/iterables.py')
-rw-r--r-- | src/snakeoil/iterables.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/snakeoil/iterables.py b/src/snakeoil/iterables.py index 8ed92f44..787af672 100644 --- a/src/snakeoil/iterables.py +++ b/src/snakeoil/iterables.py @@ -13,11 +13,9 @@ def partition(iterable, predicate=bool): Taking care that the predicate is called only once for each element. - Args: - iterable: target iterable to split into two - predicate: filtering function used to split the iterable - Returns: - A tuple of iterators, the first containing items that don't match the + :param iterable: target iterable to split into two + :param predicate: filtering function used to split the iterable + :return: A tuple of iterators, the first containing items that don't match the filter and the second the matched items. """ a, b = itertools.tee((predicate(x), x) for x in iterable) @@ -28,7 +26,7 @@ def partition(iterable, predicate=bool): class expandable_chain: """ chained iterables, with the ability to add new iterables to the chain - as long as the instance hasn't raised StopIteration already. This is + as long as the instance hasn't raised ``StopIteration`` already. This is fairly useful for implementing queues of things that must be processed. >>> from snakeoil.iterables import expandable_chain |