I have opened https://github.com/sagemath/sage/issues/35572 to deal with this
On Wed, Apr 26, 2023 at 10:27 AM dimpase <dimp...@gmail.com> wrote: > > On Tue, Apr 25, 2023 at 11:08:02PM -0700, 'Nasser M. Abbasi' via sage-devel > wrote: > > I read integrals from a file. They all are stored as strings. > > > > Then use SR('expression') inside sagemath to convert them to sagemath > > symbolic expression before calling integrate. > > > > Some give parsing error. > > > > Is using SR('expression') not the correct way to convert string to a > > symbolic expression? > > > > I am using 9.8 on Linux. Here is an example > > > > >sage > > │ SageMath version 9.8, Release Date: 2023-02-11 │ > > │ Using Python 3.11.1. Type "help()" for help. │ > > > > sage: hypergeometric((3/2,), (5/2, 3), -1/4*3^2) > > hypergeometric((3/2,), (5/2, 3), -9/4) > > > > You see, there is no error. But now if put the expression inside string and > > use SR, it gives error: > > IMHO Sage gives no promise that the way an SR expression printed is > always readable back as a string. > Note that > > SR('hypergeometric([3/2,], [5/2, 3], -1/4*3^2)') > > works just fine. > > > > > > > > sage: SR('hypergeometric((3/2,), (5/2, 3), -1/4*3^2)') > > --------------------------------------------------------------------------- > > SyntaxError Traceback (most recent call last) > > File ~/TMP/sage-9.8/src/sage/symbolic/expression.pyx:13706, in > > [...] > > SyntaxError: Mismatched parentheses > > > > During handling of the above exception, another exception occurred: > > > > [...] > > > > > > > > Is this a bug or Am I doing something wrong? This happens on very few > > cases, not all the time. The above is an example where SR gives an error. > > What are other examples which give errors like this? > > Perhaps hypergeomertic() should come with a special __repr__() function > to show the 1st two arguments as lists rather than in its internal > representation as tuples. (Or should it be _repr_() ? ) > > > Dima > > > > > > Thanks > > --Nasser > > > > -- > > You received this message because you are subscribed to the Google Groups > > "sage-devel" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to sage-devel+unsubscr...@googlegroups.com. > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/sage-devel/eeec7521-c567-4870-8442-e3eed439b32dn%40googlegroups.com. > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq0Z-9-Vjo_V8aLTOK25rgEfJ47y%2BtDtU%2BNQPvCHnvOMRA%40mail.gmail.com.