[PATCH 1/2] Fix for Symbol.as_dummy() loosing commutative property

2010-03-31 Thread Øyvind Jensen
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/sy

[PATCH 2/2] Added method Dummy.as_nondummy()

2010-03-31 Thread Øyvind Jensen
In situations where it is natural to generate dummy symbols with Symbol.as_dummy(), the reverse process may also be useful. Uncommented two tests for this. --- sympy/core/symbol.py| 11 +++ sympy/core/tests/test_symbol.py |4 ++-- 2 files changed, 13 insertions(+), 2 del

Re: Added method Dummy.as_nondummy()

2010-03-31 Thread jegerjensen
I also put these patches on github/fix_dummy cheers! Øyvind On 31 Mar, 12:56, Øyvind Jensen wrote: > In situations where it is natural to generate dummy symbols with > Symbol.as_dummy(), the reverse process may also be useful. > > Uncommented two tests for this. > --- >  sympy/core/symbol.py    

Re: [PATCH 1/2] Fix for Symbol.as_dummy() loosing commutative property

2010-03-31 Thread Vinzent Steinberg
I'm not sure whether as_dummy() is really useful. Shouldn't just passing the assumptions work? I'm -1 on special-casing is_commutative. Vinzent 2010/3/31, Øyvind Jensen : > Added a test. > --- > sympy/core/symbol.py|2 +- > sympy/core/tests/test_symbol.py | 12 >

Re: Fix for Symbol.as_dummy() loosing commutative property

2010-03-31 Thread jegerjensen
On 31 Mar, 21:50, Vinzent Steinberg 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-

Re: Fix for Symbol.as_dummy() loosing commutative property

2010-03-31 Thread Vinzent Steinberg
2010/3/31 jegerjensen : > > > On 31 Mar, 21:50, Vinzent Steinberg > 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. Yeah, but I think it is cleaner

Re: Fix for Symbol.as_dummy() loosing commutative property

2010-03-31 Thread Aaron S. Meurer
On Mar 31, 2010, at 2:38 PM, Vinzent Steinberg wrote: > 2010/3/31 jegerjensen : >> >> >> On 31 Mar, 21:50, Vinzent Steinberg >> 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 integ

Re: Fix for Symbol.as_dummy() loosing commutative property

2010-03-31 Thread Vinzent Steinberg
2010/3/31 Aaron S. Meurer : > Commutativity is treated differently than other assumptions in the core > because it needs to know about it for auto-simplification.  See for example > the source for Mul.flatten(). > > Maybe this is related too: > > In [6]: x = Symbol('x', commutative=False) > > In

Re: Fix for Symbol.as_dummy() loosing commutative property

2010-03-31 Thread Aaron S. Meurer
On Mar 31, 2010, at 3:15 PM, Vinzent Steinberg wrote: > 2010/3/31 Aaron S. Meurer : >> Commutativity is treated differently than other assumptions in the core >> because it needs to know about it for auto-simplification. See for example >> the source for Mul.flatten(). >> >> Maybe this is rel