Re: [sympy] Re: Behaviour of symbols with and without assumptions in sympify

2020-02-15 Thread ludi
On Saturday, 15 February 2020 00:55:20 UTC+1, Aaron Meurer wrote: > > ... > The best recommendation is in general to avoid sympify, unless you are > processing arbitrary strings > Thanks for the reply, but as I am processing user-input I think there is no way around sympify. -- You

[sympy] Re: Behaviour of symbols with and without assumptions in sympify

2020-02-14 Thread ludi
Thanks a lot I read about locals and individual dictionaries, but I didn't realize that it would affect "already defined" Symbols. It is a little bit confusing that 'a' and 'a' can be not the same thing. But now everything works as expected, thanks again. -- You received this message because

[sympy] Behaviour of symbols with and without assumptions in sympify

2020-02-14 Thread ludi
Hi If I do a=Symbol('a', real=True) b=Symbol('b') and do solve(a**2-1,a) I get [−1, 1] solve(b**2-1,b) [−1, 1] as expected. solve(a**2+1,a) I get [ ] solve(b**2+1,b) [−i, i] again, ok. But solve(sympify("a**2+1"),a) [] *solve(sympify("a**2-1"),a)* *[]* solve(sympify("b**2-1"),b) [−1, 1]