from typing import Union
from typing import List
from typing import Iterable
from typing import Any


def chunks(it: Union[List[int], str], chunk_size: int) -> Iterable[Any]:
    """Yields chunks of something slicable with length <= chunk_size

    :param it:
    :param chunk_size: size of the chunks
    :type chunk_size: int

    .. docstring::python

        >>> list(chunks([1, 2, 3, 4, 5, 6], 3))
        [[1, 2, 3], [4, 5, 6]]
        >>> list(chunks([1, 2, 3, 4, 5, 6], 2))
        [[1, 2], [3, 4], [5, 6]]
        >>> list(chunks('abcdefghijklmnopqrstuvwxyz', 2))
        ['ab', 'cd', 'ef', 'gh', 'ij', 'kl', 'mn', 'op', 'qr', 'st', 'uv', 'wx', 'yz']
        >>> list(chunks('abcdefghijklmnopqrstuvwxyz', 13))
        ['abcdefghijklm', 'nopqrstuvwxyz']

    """
    return (it[i : i + chunk_size] for i in range(0, len(it), chunk_size))