(fieldname, fieldvalue)
return list(reversed(sorted(result)))
Return a sorted HeaderElement list from a comma-separated header string.
Return a sorted HeaderElement list from a comma-separated header string.
Return a sorted HeaderElement list from a comma - separated header string .
def header_elements(fieldname, fieldvalue):
    """Return a sorted HeaderElement list from a comma-separated header string.
    """
    if not fieldvalue:
        return []

    result = []
    for element in RE_HEADER_SPLIT.split(fieldvalue):
        if fieldname.startswith('Accept') or fieldname == 'TE':
            hv = AcceptElement.from_str(element)
        else:
            hv = HeaderElement.from_str(element)
        result.append(hv)

    return list(reversed(sorted(result)))
def header_elements ( fieldname , fieldvalue ) : if not fieldvalue : return [ ] result = [ ] for element in RE_HEADER_SPLIT . split ( fieldvalue ) : if fieldname . startswith ( 'Accept' ) or fieldname == 'TE' : hv = AcceptElement . from_str ( element ) else : hv = HeaderElement . from_str ( element ) result . append ( hv ) return list ( reversed ( sorted ( result ) ) )