def eqn_list_to_dict(eqn_list, reverse=None):
    """Convert a list of Sympy Relational objects to a dictionary.

    Most commonly, this will be for converting things like:

    [y == a*x + b, z == c*x + d]

    to a Python dictionary object with keys corresponding to the left hand side
    of the relational objects and values corresponding to the right hand side
    of the relational objects:

    {y: a*x+b, z: c*x + d}

    Optional argument 'reverse' swaps the keys for the values, i.e:

    {a*x + b: y, c*x +d: z}

    Remember that dictionaries are *NOT* ordered, so if the list you pass
    requires a special ordering, it will *NOT* be preseved by converting it to
    a dictionary.

    """
    eqn_dict = {}
    for eqn in eqn_list:
        if reverse:
            eqn_dict[eqn.rhs] = eqn.lhs
        else:
            eqn_dict[eqn.lhs] = eqn.rhs

    return eqn_dict