Skip to content

Commit 4010e4c

Browse files
committed
Use the parser to sympify strings
Also use _sympify internally which doesn't parse strings to avoid statements like sympify(1) + "a" getting accepted.
1 parent 76fb7a9 commit 4010e4c

File tree

3 files changed

+199
-175
lines changed

3 files changed

+199
-175
lines changed

symengine/lib/symengine.pxd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,3 +770,6 @@ IF HAVE_SYMENGINE_MPFR:
770770
IF HAVE_SYMENGINE_MPC:
771771
cdef extern from "<symengine/eval_mpc.h>" namespace "SymEngine":
772772
void eval_mpc(mpc_t result, const Basic &b, mpfr_rnd_t rnd) nogil except +
773+
774+
cdef extern from "<symengine/parser.h>" namespace "SymEngine":
775+
RCP[const Basic] parse(const string &n) nogil except +

0 commit comments

Comments
 (0)