def _expand_escapes(characters):
    """Return a generator which yields byte-sized character
    values from the sequence *characters*, replacing escape
    sequences.

    """
    ESCAPE_SEQUENCES = {'*0': '\x00', '*e': '\x04', '*(': '{', '*)': '}',
        '*t': '\t', '**': '*', "*'": "'", '*"': '"', '*n': '\n'}
    for ch in characters:
        if len(ch) == 1:
            yield ord(ch)
        else:
            try:
                yield ord(ESCAPE_SEQUENCES[ch])
            except KeyError:
                raise ValueError('Unknown escape sequence: {}'.format(ch))
