On Jun 2, 4:43 pm, jegerjensen <[email protected]> wrote:
> > -48 + 4*y + 12*x
>
> > The problem is, though "in" thinks x (and y are in the equation)...
>
> > >>> x in line
>
> > True
>
> > the local variables that I created above are not actually in there:
>
> > >>> x in line.atoms(), y in line.atoms()
>
> > (False, False)
>
> The inconsistency looks like a bug, doesn't it?

Perhaps this is because __contains__ uses == to compare things and I'm
guessing the x in set(foo) uses "is" (like any(x is fi for fi in
foo)). .has() must use "is", too (see 3rd example below)

>>> Symbol('x') == Symbol('x', real=1)
True
>>> Symbol('x') is Symbol('x', real=1)
False
>>> Symbol('x', real=1).has(Symbol('x'))
False

I'll open this as an issue.

-- 
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.

Reply via email to