Comment #32 on issue 1823 by [email protected]: integral.atoms(Symbol)
should introspect
http://code.google.com/p/sympy/issues/detail?id=1823
I feel pretty strongly that we should make the symbols method do what
free_symbols is doing and drop the free_symbols method before it even gets
added. There are very few cases where one uses atoms(Symbol) where truly
the atoms are being sought; it is actually free symbols that are being
checked for, e.g.:
# no symbols provided -- let's compute full anti-derivative
syms = function.atoms(Symbol)
If someone gave `Integral(Sum(x, (x, 1, n))` they shouldn't get an integral
over x and n.
If someone wanted to separate the variables they wouldn't want the
numerical integral grouped with x in the following:
h[3] >>> separatevars(Integral(x, (x, 1, 2))*x*y, [x, y], dict=1)
{'coeff': 1, x: x*Integral(x, (x, 1, 2)), y: y}
^
|_should be with 'coeff'
All these troubles could be avoided by just using dummy variables for the
variables of integration and summation. The only time that they would need
to be accessed would be with the transform method and the printing
routines; transform could look for the pertinent dummy by matching name, so
`Integral(_x, (_x, 1, 2)).transform(x, 2*x)` would know to look for _x (and
thus succeed) rather than x (and fail). When printing the Integral I assume
people would rather see `x` than `_x` so that's why the printing methods
would need to be modified. I think sympy would be a lot more robust if we
just hid those symbols as dummies which are actually bound_symbols. Neither
the free_symbols nor symbols method would be needed and subs would not need
any special behavior.
Perhaps something like Pure would be better for this; if this didn't derive
from Symbol, that would be best since then atoms(Symbol) wouldn't include
such variables. But I'm not sure if that is possible.
--
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.