ok so I had to switch back to simpify since of the tokenize approach with
parse_expr too different.
"x" also started working without a local_dict defined ?
I think "2x" cannot be turned into an expression <- if you have an answer
for that ?!
The overall approach seems create the expression first and then use it's
subs method if required.
cheers!
On Tuesday, 6 January 2026 at 14:52:25 UTC Little Grey Men wrote:
> no problem i think what i asking like :
> input_str="2x"
> transformations = ... implicit_mult ...
> expr = parse_expr (input_str, local_dict={"x":x},
> transformations=transformations).subs("x", 4.0)
>
> I think above is the approx replacement i looking for.
> cheers
> Daniel.
>
>
>
> On Tuesday, 6 January 2026 at 14:24:39 UTC Oscar wrote:
>
>> On Tue, 6 Jan 2026 at 14:15, Little Grey Men <[email protected]> wrote:
>> >
>> > OK I am able to see working the version with parse_expr with a
>> local_dict
>> > the previous sympify syntax used which failed with "x" was slightly
>> more complex in that it also used a dict(subs).
>> >
>> > Should i be able to call parse_expr with the local_dict to declare x
>> AND the dict(subs) to evaluate.
>> > In such a case if it were valid, it would make sense the evaluate flag
>> would be set to True.
>> >
>> > Does any of the above make sense ?
>>
>> It is too imprecise to understand. Show the actual code and explain
>> very clearly what happens when you run the code and what it is that
>> you want to happen.
>>
>> --
>> Oscar
>>
>
--
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 visit
https://groups.google.com/d/msgid/sympy/52de58d9-e876-4333-bf9e-2fe37c7c24e0n%40googlegroups.com.