def width_aware_slice(s, start, end, replacement_char=u' '):
    divides = [wcwidth.wcswidth(s, i) for i in range(len(s)+1)]

    new_chunk_chars = []
    for char, char_start, char_end in zip(s, divides[:-1], divides[1:]):
        if char_start >= start and end <= char_end:
            new_chunk_chars.append(char)
        else:
            new_chunk_chars.extend(replacement_char * interval_overlap(char_start, char_end, start, end))

    return ''.join(new_chunk_chars)
dataset/ETHPy150Open thomasballinger/curtsies/curtsies/formatstring.py/width_aware_slice/swapped operands of `<=`