def dict2list(thedict, parmnames, default=None):
    """
    Convert the values in thedict for the given list of parmnames to a list of values.
    """
    return [thedict.get(n, default) for n in parmnames]