def dictFromTokenList(paramlist):
    """Return a dictionary formed from the terms in paramlist.
    
    paramlist is a sequence of items in the form
    parametername, =, value.
    If there are duplicates, the last one wins."""
    
    ret = {}
    msg = "Ill-formed parameter list: keywords and values must have the form kw = value"
    
    if not len(paramlist) % 3 == 0:
        raise ValueError(msg)
    for i in range(0, len(paramlist), 3):
        if not paramlist[i+1] == "=":
            raise ValueError(msg)
        ret[paramlist[i]] = paramlist[i+2]
    return ret