On 31 Mar, 21:50, Vinzent Steinberg <vinzent.steinb...@googlemail.com>
wrote:
> I'm not sure whether as_dummy() is really useful.

I think of it as akin to the way you would use prime in hand writing,
like using x' as an integration variable for a function of x.

>
> Shouldn't just passing the assumptions work? I'm -1 on special-casing
> is_commutative.

Yeah, it looks unnecessary, perhaps it should rather be fixed
somewhere else?  I don't
know why it is not passed along with the assumptions.

Øyvind
>
> Vinzent
>
> 2010/3/31, Øyvind Jensen <jensen.oyv...@gmail.com>:
>
> > Added a test.
> > ---
> >  sympy/core/symbol.py            |    2 +-
> >  sympy/core/tests/test_symbol.py |   12 ++++++++++++
> >  2 files changed, 13 insertions(+), 1 deletions(-)
>
> > diff --git a/sympy/core/symbol.py b/sympy/core/symbol.py
> > index 8f5db2a..e405fbb 100644
> > --- a/sympy/core/symbol.py
> > +++ b/sympy/core/symbol.py
> > @@ -64,7 +64,7 @@ def _hashable_content(self):
> >          return (self.is_commutative, self.name)
>
> >      def as_dummy(self):
> > -        return Dummy(self.name, **self.assumptions0)
> > +        return Dummy(self.name, self.is_commutative, **self.assumptions0)
>
> >      def __call__(self, *args):
> >          return Function(self.name, nargs=len(args))(*args,
> > **self.assumptions0)
> > diff --git a/sympy/core/tests/test_symbol.py
> > b/sympy/core/tests/test_symbol.py
> > index ffa0f8e..5fb82ff 100644
> > --- a/sympy/core/tests/test_symbol.py
> > +++ b/sympy/core/tests/test_symbol.py
> > @@ -18,6 +18,18 @@ def test_Symbol():
> >      assert Symbol("x") == Symbol("x")
> >      assert Symbol("x", dummy=True) != Symbol("x", dummy=True)
>
> > +def test_as_dummy_nondummy():
> > +    x = Symbol('x')
> > +    x1 = x.as_dummy()
> > +    assert x1 != x
> > +    assert x1 != x.as_dummy()
> > +    # assert x == x1.as_nondummy()
> > +
> > +    x = Symbol('x', commutative = False)
> > +    x1 = x.as_dummy()
> > +    assert x1 != x
> > +    assert x1.is_commutative == False
> > +    # assert x == x1.as_nondummy()
>
> >  def test_lt_gt():
> >      x, y = Symbol('x'), Symbol('y')
> > --
> > 1.6.5
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "sympy-patches" group.
> > To post to this group, send email to sympy-patc...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > sympy-patches+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/sympy-patches?hl=en.
>
>

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

Reply via email to