1 Apr 2008 11:41
Re: sympify of 'lambda' and 'E'
I've just found out that it's not 'E' that's causing the problem, it's
'S'.
sympify('S') #works
sympify('S*X') #doesn't work
Cheers
Colin
On Mar 31, 5:29 pm, Colin Gillespie <c.gilles...@...> wrote:
> Dear All,
>
> I suspect that sympify is getting confused by python's builtin lambda
> and E
>
> So are the following examples bugs? If not, should the documentation
> be updated with a warning?
>
> >>> sympify('S*lambda')
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/pythonModules/lib/python2.4/site-packages/sympy-0.5.13_hg-
> py2.4.egg/sympy/core/sympify.py", line 127, in sympify
> raise SympifyError(a, exc)
> sympy.core.sympify.SympifyError: Sympify of expression 'S*lambda'
> failed, because of exception being raised:
> SyntaxError: unexpected EOF while parsing (line 1)
(Continue reading)
, which creates unique copies of itself so that
the following is possible:
f = _ + _ -> would behave as f = x + y (given x and y are Symbols),
a bit like it is used in many functional languages (and not like 2 *
_ )
It should also be possible to then substitute each symbol with a value
or with another symbol individually.
How could something like that be implemented?
cheers!
atir
RSS Feed