WITH utils
Project description
With Utils
Utils that we've used a lot at WITH.
iter
Iteration-related utils
n_grams
Provides a way to create n_grams from an iterator
from with_utils.iter import n_grams
assert list(n_grams([1, 2, 3, 4], 2)) == [(1, 2), (2, 3), (3, 4)]
return_list
Transforms an iterator into a function that returns a list.
from with_utils.iter import return_list
@return_list
def foo():
yield 1
yield 2
yield 3
assert foo() == [1, 2, 3]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
with-utils-0.2.1.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for with_utils-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bc14a9372549bda997178cf2ac7dc3879189b562281e0498cdd428cc7966db0 |
|
MD5 | f19a531129c771cf99074009e34c1958 |
|
BLAKE2b-256 | 3096fc98f757fa22e8076e5f92e2554ffb8a5b0f19ab8cfeaa46ad0aabef541d |