Updates:
Cc: smi...@gmail.com
Comment #9 on issue 2386 by asmeurer: gosper(...) is missing tests and
docstring
http://code.google.com/p/sympy/issues/detail?id=2386
The problem is because factorial.diff doesn't work any more. But this is
actually a bug in Derivative.subs:
In [5]: factorial(x).diff(x)
Out[5]:
d
──(x!)
dx
In [6]: factorial(x).diff(x).subs(x, 0)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/Users/aaronmeurer/Documents/python/sympy/sympy/<ipython console> in
<module>()
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/core/basic.pyc in
subs(self, *args)
802 elif len(args) == 2:
803 old, new = args
--> 804 return self._subs_old_new(old, new)
805 else:
806 raise TypeError("subs accepts either 1 or 2 arguments")
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/core/cache.pyc in
wrapper(*args, **kw_args)
101 except KeyError:
102 pass
--> 103 func_cache_it_cache[k] = r = func(*args, **kw_args)
104 return r
105 return wrapper
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/core/basic.pyc in
_subs_old_new(self, old, new)
811 old = sympify(old)
812 new = sympify(new)
--> 813 return self._eval_subs(old, new)
814
815 def _eval_subs(self, old, new):
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/core/function.pyc in
_eval_subs(self, old, new)
697 if self==old:
698 return new
--> 699 return Derivative(*map(lambda x: x._eval_subs(old, new),
self.args))
700
701 def matches(self, expr, repl_dict={}, evaluate=False):
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/core/function.pyc in
__new__(cls, expr, *symbols, **assumptions)
615
616 if i == iwas: # didn't get an update because of bad
input
--> 617 raise ValueError('Derivative expects Symbol [,
Integer] args but got %s, %s' % (s, count))
618
619 symbol_count.append((s, count))
ValueError: Derivative expects Symbol [, Integer] args but got 0, 1
In [8]: Derivative(f(x), x).subs(x, 0)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/Users/aaronmeurer/Documents/python/sympy/sympy/<ipython console> in
<module>()
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/core/basic.pyc in
subs(self, *args)
802 elif len(args) == 2:
803 old, new = args
--> 804 return self._subs_old_new(old, new)
805 else:
806 raise TypeError("subs accepts either 1 or 2 arguments")
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/core/cache.pyc in
wrapper(*args, **kw_args)
101 except KeyError:
102 pass
--> 103 func_cache_it_cache[k] = r = func(*args, **kw_args)
104 return r
105 return wrapper
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/core/basic.pyc in
_subs_old_new(self, old, new)
811 old = sympify(old)
812 new = sympify(new)
--> 813 return self._eval_subs(old, new)
814
815 def _eval_subs(self, old, new):
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/core/function.pyc in
_eval_subs(self, old, new)
697 if self==old:
698 return new
--> 699 return Derivative(*map(lambda x: x._eval_subs(old, new),
self.args))
700
701 def matches(self, expr, repl_dict={}, evaluate=False):
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/core/function.pyc in
__new__(cls, expr, *symbols, **assumptions)
615
616 if i == iwas: # didn't get an update because of bad
input
--> 617 raise ValueError('Derivative expects Symbol [,
Integer] args but got %s, %s' % (s, count))
618
619 symbol_count.append((s, count))
ValueError: Derivative expects Symbol [, Integer] args but got 0, 1
And we also need to fix factorial.diff to work like gamma.diff:
In [7]: gamma(x).diff(x)
Out[7]: Γ(x)⋅polygamma(0, x)
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.