On Wed, Nov 9, 2011 at 8:35 AM, Aaron Meurer <[email protected]> wrote: > 2011/11/8 Ondřej Čertík <[email protected]>: >> On Tue, Nov 8, 2011 at 4:15 PM, Roberto Colistete Jr. >> <[email protected]> wrote: >>> Hi, >>> >>> On SymPy 0.6.7 the 'diff' function works on lists. But on SymPy >>> 0.7.1 it doesn't, for example : >>> >>> In [1]: diff([cos(t), sin(t), exp(t), t) >>> --------------------------------------------------------------------------- >>> AttributeError Traceback (most recent call >>> last) >>> /home/roberto/<ipython-input-6-14d9fa9d6a32> in <module>() >>> ----> 1 diff([cos(t),sin(t),t],t) >>> >>> /usr/local/lib/python2.6/dist-packages/sympy/core/function.pyc in >>> diff(f, *symbols, **kwargs) >>> 1104 """ >>> 1105 kwargs.setdefault('evaluate', True) >>> -> 1106 return Derivative(f, *symbols, **kwargs) >>> 1107 >>> 1108 def expand(e, deep=True, modulus=None, power_base=True, >>> power_exp=True, \ >>> >>> /usr/local/lib/python2.6/dist-packages/sympy/core/function.pyc in >>> __new__(cls, expr, *symbols, **assumptions) >>> 672 if evaluate: >>> 673 if set(sc[0] for sc in symbol_count >>> --> 674 ).difference(expr.free_symbols): >>> 675 return S.Zero >>> 676 >>> >>> AttributeError: 'list' object has no attribute 'free_symbols' >> >> >> ^^^ I was getting this "no attribute 'free_symbols'" error couple >> times when I was trying to integrate something (I think). The error is >> not informative and the code should be refactored to produce a >> readable error message showing what is wrong and why. >> >> The above error message looks like a bug in sympy. >> >> Ondrej > > If you got this by using regular SymPy input, then it is definitely a > bug. The problem here was that the input was not SymPy input, so any > function that assumes that it is would fail (and also, currently > sympify() does nothing to lists).
The problem was that I was passing some incorrect arguments. So the user API should say: this argument is incorrect, or can't be converted to a sympy argument, rather than some "no attribute" error. It took me couple minutes to figure out that the problem is actually on my side, that I am passing there some incorrect arguments. Ondrej -- You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en.
