Module tenlib.util.misc

A few utility functions.

Functions

def repr_attrs(obj, attrs)

Returns a string representation of the object, with its name and selected attributes.

def niter(data: Iterable, n: int) ‑> Iterator[tuple]

Yields n items for an iterable, then the next n items, etc.

>>> for part in niter(range(10), 3)
...  print(part)
(0, 1, 2)
(3, 4, 5)
(6, 7, 8)
(9, )