atoms searches for instances of a class.  So when given an instance,
it apparently just uses the class of that instance:

In [23]: sin(y).atoms(sin(x))
Out[23]: set([sin(y)])

In [24]: (2**x).atoms(x**2)
Out[24]:
   ⎛⎡ x⎤⎞
set⎝⎣2 ⎦⎠

Since it's unclear what it should do with an instance, this could be
considered an acceptable output (assuming it is documented).
Otherwise, I'd say it should raise an error in this case.

Aaron Meurer

On Thu, Jun 7, 2012 at 9:16 AM, Chris Smith <smi...@gmail.com> wrote:
> On Thu, Jun 7, 2012 at 6:37 PM, krastanov.ste...@gmail.com
> <krastanov.ste...@gmail.com> wrote:
>> In [22]: f(y).atoms(f(x))
>> Out[22]: set([f(y)])
>
> I would say no since f(x) != f(y); I would expect f(y).atoms(f) to
> return f(y), however (and it does).
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to sympy@googlegroups.com.
> To unsubscribe from this group, send email to 
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to