>>>> * you can't use the solution without knowing the variables. This makes
>>>> it very cumbersome to use a function like the following:
>>>> def solve_stuff(...):
>>>>   x, y, z = [Dummy() for _ in range(3)]
>>>>   f = Lambda(...)
>>>>   return solve(f(x, y, z), (x, y, z))
>>>> * you can't cache solve results in any useful way, because solve(x-1) !=
>>>> solve(y-1)
>>>> * putting the variables in the dict lets temporary symbols escape the
>>>> scope they were created in - this is exactly the kind of situation that
>>>> prevents Vinzent's local assumptions hack from making new-style
>>>> assumptions a viable alternative to the old ones.
>>>
>>> I don't understand how they escape the scope.
>>>
>> Consider the solve_stuff example above: the dummy variables are the keys
>> of the returned dicts and become therefore visible outside the function.

I still don't get this. The variables exist in the same scope you
called solve() (inside solve_stuff()). It just escaped because you
returned the results from solve, instead of using something like
    return [ s.values() for s in solve(f(x, y, z), (x, y, z)) ]

> Also, since whatever we do would break compatibility, why don't we just leave 
> it as it currently is until we can implement a nice solution class.

I think there's no problem breaking compatibility now, because the
results are inconsistent the way they are (remember the thread "using
results from solve":
http://groups.google.com/group/sympy/browse_thread/thread/396d5ece3b7f1397/baae002aca1b0f0e)

The way it is now requires anyone trying to use solve() to
special-case single and multiple solutions, and makes it harder for
newcomers to get what's happening. It's also harder to fix other bugs
in solve() because it's not clear what the output should be. I think
any other outcome of this decision will be better than the status quo.

Renato

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

Reply via email to