Updates:
Labels: EasyToFix
Comment #2 on issue 1581 by [email protected]: subs(dict()) sometimes breaks
http://code.google.com/p/sympy/issues/detail?id=1581
When you use dict(...) it turns the keys into strings. When subs gets a
dictionary it sympifies strings. S('N') returns the sympy function N, not a
symbol. So the fix would be, perhaps, to make subs turn strings into
symbols rather than passing them to sympify...or some variation of that.
N=3
(1+x).subs(dict(N=3))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sympy\core\basic.py", line 775, in subs
return self._subs_dict(sequence)
File "sympy\core\basic.py", line 849, in _subs_dict
sequence = sympify(sequence)
File "sympy\core\sympify.py", line 139, in sympify
rational=rational) for x in a.iteritems()])
File "sympy\core\sympify.py", line 128, in sympify
rational=rational) for x in a])
File "sympy\core\containers.py", line 32, in __new__
args = [ sympify(arg) for arg in args ]
File "sympy\core\sympify.py", line 162, in sympify
raise SympifyError('could not parse %r' % a)
sympy.core.sympify.SympifyError: SympifyError: "could not parse u'<function
N at
0x0205C5B0>'"
dict(N=3)
{'N': 3}
S('N')
<function N at 0x0205C5B0>
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.