def _pretty_list(value: list, key_length: int) -> str:
    """Pretty prints a list. Automatically warps lines if line length of 88 is exceeded (-> black compatibility)."""
    htchar = ' '
    indent = 4
    nlch = '\n' + htchar * indent
    items = [repr(item) for item in value]
    if (len(', '.join(items)) + key_length + 9) > 88:
        return '[%s]' % (
            nlch
            + htchar * indent
            + (',' + nlch + htchar * indent).join(items)
            + ','
            + nlch
        )
    return '[%s]' % (', '.join(items))