def _parse_num_with_flag(num_with_flag: str):
    """ 
    Parse a number, followed optionally by a single-character, non-digit flag,
    into its constituent parts
    """
    num = float('nan')
    flag = ''
    if str.isdigit(num_with_flag[-1]):
        num = float(num_with_flag)
    else:
        flag = num_with_flag[-1]
        num = float(num_with_flag[:-1])
    return num, flag
