(value)
return address_list, value
address_list = (address *("," address)) / obs-addr-list
        obs-addr-list = *([CFWS] ",") address *("," [address / CFWS])

    We depart from the formal grammar here by continuing to parse until the end
    of the input, assuming the input to be entirely composed of an
    address-list.  This is always true in email parsing, and allows us
    to skip invalid addresses to parse additional valid ones.
address_list = (address *("," address)) / obs-addr-list
        obs-addr-list = *([CFWS] ",") address *("," [address / CFWS])
address_list = ( address * ( address )) / obs - addr - list obs - addr - list = * ( [ CFWS ] ) address * ( [ address / CFWS ] )
def get_address_list(value):
    """ address_list = (address *("," address)) / obs-addr-list
        obs-addr-list = *([CFWS] ",") address *("," [address / CFWS])

    We depart from the formal grammar here by continuing to parse until the end
    of the input, assuming the input to be entirely composed of an
    address-list.  This is always true in email parsing, and allows us
    to skip invalid addresses to parse additional valid ones.

    """
    address_list = AddressList()
    while value:
        try:
            token, value = get_address(value)
            address_list.append(token)
        except errors.HeaderParseError as err:
            leader = None
            if value[0] in CFWS_LEADER:
                leader, value = get_cfws(value)
                if not value or value[0] == ',':
                    address_list.append(leader)
                    address_list.defects.append(errors.ObsoleteHeaderDefect(
                        "address-list entry with no content"))
                else:
                    token, value = get_invalid_mailbox(value, ',')
                    if leader is not None:
                        token[:0] = [leader]
                    address_list.append(Address([token]))
                    address_list.defects.append(errors.InvalidHeaderDefect(
                        "invalid address in address-list"))
            elif value[0] == ',':
                address_list.defects.append(errors.ObsoleteHeaderDefect(
                    "empty element in address-list"))
            else:
                token, value = get_invalid_mailbox(value, ',')
                if leader is not None:
                    token[:0] = [leader]
                address_list.append(Address([token]))
                address_list.defects.append(errors.InvalidHeaderDefect(
                    "invalid address in address-list"))
        if value and value[0] != ',':
            # Crap after address; treat it as an invalid mailbox.
            # The mailbox info will still be available.
            mailbox = address_list[-1][0]
            mailbox.token_type = 'invalid-mailbox'
            token, value = get_invalid_mailbox(value, ',')
            mailbox.extend(token)
            address_list.defects.append(errors.InvalidHeaderDefect(
                "invalid address in address-list"))
        if value:  # Must be a , at this point.
            address_list.append(ValueTerminal(',', 'list-separator'))
            value = value[1:]
    return address_list, value
def get_address_list ( value ) : address_list = AddressList ( ) while value : try : token , value = get_address ( value ) address_list . append ( token ) except errors . HeaderParseError as err : leader = None if value [ 0 ] in CFWS_LEADER : leader , value = get_cfws ( value ) if not value or value [ 0 ] == ',' : address_list . append ( leader ) address_list . defects . append ( errors . ObsoleteHeaderDefect ( "address-list entry with no content" ) ) else : token , value = get_invalid_mailbox ( value , ',' ) if leader is not None : token [ : 0 ] = [ leader ] address_list . append ( Address ( [ token ] ) ) address_list . defects . append ( errors . InvalidHeaderDefect ( "invalid address in address-list" ) ) elif value [ 0 ] == ',' : address_list . defects . append ( errors . ObsoleteHeaderDefect ( "empty element in address-list" ) ) else : token , value = get_invalid_mailbox ( value , ',' ) if leader is not None : token [ : 0 ] = [ leader ] address_list . append ( Address ( [ token ] ) ) address_list . defects . append ( errors . InvalidHeaderDefect ( "invalid address in address-list" ) ) if value and value [ 0 ] != ',' : # Crap after address; treat it as an invalid mailbox. # The mailbox info will still be available. mailbox = address_list [ - 1 ] [ 0 ] mailbox . token_type = 'invalid-mailbox' token , value = get_invalid_mailbox ( value , ',' ) mailbox . extend ( token ) address_list . defects . append ( errors . InvalidHeaderDefect ( "invalid address in address-list" ) ) if value : # Must be a , at this point. address_list . append ( ValueTerminal ( ',' , 'list-separator' ) ) value = value [ 1 : ] return address_list , value