> How to process the output of solve in code? Is it really the only way
> to check whether it is a list or a dict? Is there a way to force the
> use of dict? If not, what do you think about adding such a flag?

If you always give a list of Expr and the symbols you want you e.g.
solve(list(eqs), list(syms)) you will get
- a single dictionary if it's linear
- a list of tuples if it's non-linear
- None if there is no solution
- an error if no subset of symbols gave a solution

perhaps something like this would work...

def canonical_solve(eqs, syms):
    assert iterable(eqs) and is_sequence(syms)
    syms = list(syms)
    syms.append(Dummy()) # force dict output
    return solve(eqs, *syms) or {}

/c

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to