def _py_expand_short(subsequence, sequence, max_l_dist):
    """Straightforward implementation of partial match expansion."""
    subseq_len = len(subsequence)
    if subseq_len == 0:
        return 0, 0
    scores = list(range(1, subseq_len + 1))
    min_score = subseq_len
    min_score_idx = -1
    for seq_index, char in enumerate(sequence):
        a = seq_index
        c = a + 1
        for subseq_index in range(subseq_len):
            b = scores[subseq_index]
            c = scores[subseq_index] = min(a + (char != subsequence[
                subseq_index]), b + 1, c + 1)
            a = b
        if c <= min_score:
            min_score = c
            min_score_idx = seq_index
        elif min(scores) >= min_score:
            break
    return (min_score, min_score_idx + 1) if min_score <= max_l_dist else (None
        , None)
