There's no way to change the Python operator precedence, but you can modify the string parsing in parse_expr() by passing in a transformer for the tokenizer.
Aaron Meurer On Mon, Aug 12, 2024 at 12:38 PM Paul Royik <distantjob...@gmail.com> wrote: > > Hello. > > I'm trying to parse the ">>" symbol as implies operator. > > I've managed to parse p>>q>>r as Implies(Implies(p,q), r) using sympy > functions as a base (possibly, there is a built-in solution that I'm not > aware of), but it appeares that Implies is a right-associative operator. > > Are there some functions in Sympy that allow me to parse p>>q>>r as > Implies(p, Implies(q,r))? > > Thank you. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/38551028-8785-4ecb-a407-e58b7ea4b037n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6K9iMhD-WmaaRUyK98-LPtuC_Q4nKA7EXBos9sns3NtUg%40mail.gmail.com.