Comment #11 on issue 1923 by nicolas.pourcelot: count_ops doesn't return a
count (by default)
http://code.google.com/p/sympy/issues/detail?id=1923
Maybe something like this could be used in sympy/core/function.py:
def count_ops(self, visual=False):
# one for f() and the rest for the args
if visual:
symbol = Symbol(self.func.__name__.upper())
return symbol + C.Add(*[ t.count_ops(visual) for t in self.args
])
else:
return 1 + C.Add(*[ t.count_ops(visual) for t in self.args ])
to have
(sin(x) + log(x+1)).count_ops()
LOG + 2*ADD + SIN
instead of current
(sin(x) + log(x+1)).count_ops()
2 + 2*ADD
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-iss...@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.