SymPy indeed reuses Python's built in parser, but it has some
extensions to the tokenizer to allow things like implicit
multiplication (in sympy.parsing.sympy_parser). These things are not
abandoned. You can use them via the parse_expr() function. See
https://docs.sympy.org/latest/modules/parsing.html#sympy.parsing.sympy_parser.parse_expr

Aaron Meurer

On Fri, Feb 28, 2020 at 3:15 AM David Bailey <[email protected]> wrote:
>
> Dear Group,
>
> I have been exploring some of the SymPy source files, and came across a 
> parser. This puzzled me because I have always thought that SymPy didn't need 
> its own parser because its syntax is consistent with Python, but then all the 
> operators are overloaded as required.
>
> I also discovered implicit multiplication in the code - so that xyz is parsed 
> as x*y*z, but (presumably) sin is not parsed as s*i*n. Is this accessible 
> somehow, or is it a relic of earlier ideas that have now been abandoned?
>
> David
>
> --
> 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/5a462c5c-3f9c-e4d2-c819-e5d9ef3899ef%40dbailey.co.uk.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2B971Njw7bZuhBPPnetssTkUk8nwZ38bUE%2BUrt8%2B1r-bA%40mail.gmail.com.

Reply via email to