[PATCH] Fix issue 1920: SymTuple doesn't rebuild itself

2010-04-30 Thread Øyvind Jensen
SymTuple did not fulfill foo.func(*foo.args) == foo. This patch fixes that by storing the wrapped tuple as .args[0] instead of directly as .args Updated all SymTuple methods, added a test and fixed some whitespace. --- sympy/physics/secondquant.py| 35

Re: Fix for Issue 1920: Now SymTuple.func(*SymTuple.args) work as expected.

2010-04-30 Thread jegerjensen
Thanks for your comments. I created another patch, which by accident ended up in a new thread. Lets continue this discussion there. Øyvind -- You received this message because you are subscribed to the Google Groups sympy-patches group. To post to this group, send email to

Re: Fix issue 1920: SymTuple doesn't rebuild itself

2010-04-30 Thread jegerjensen
The above patch was my response to Ondrejs comment: Well, I am not sure that the change from: -assert st == SymTuple((1,2,3,4)) to: +assert st == SymTuple(1, 2, 3, 4) is a good idea. In fact I think it's a bad idea, as we migrated from Matrix(1,2, 3, 4) syntax to Matrix([1, 2, 3, 4]).

Re: Fix issue 1920: SymTuple doesn't rebuild itself

2010-04-30 Thread Ronan Lamy
Le vendredi 30 avril 2010 à 14:23 -0700, Ondrej Certik a écrit : On Fri, Apr 30, 2010 at 6:26 AM, jegerjensen jensen.oyv...@gmail.com wrote: Also, shouldn't this go into sympy.core? Ondrej That is probably a good idea. Where should we put the decorator _tuple_wrapper? Or should

Re: Fix issue 1920: SymTuple doesn't rebuild itself

2010-04-30 Thread Ondrej Certik
On Fri, Apr 30, 2010 at 3:04 PM, Ronan Lamy ronan.l...@gmail.com wrote: Le vendredi 30 avril 2010 à 14:23 -0700, Ondrej Certik a écrit : On Fri, Apr 30, 2010 at 6:26 AM, jegerjensen jensen.oyv...@gmail.com wrote: Also, shouldn't this go into sympy.core? Ondrej That is probably a

Re: Fix issue 1920: SymTuple doesn't rebuild itself

2010-04-30 Thread Ronan Lamy
Le vendredi 30 avril 2010 à 16:06 -0700, Ondrej Certik a écrit : On Fri, Apr 30, 2010 at 3:04 PM, Ronan Lamy ronan.l...@gmail.com wrote: Le vendredi 30 avril 2010 à 14:23 -0700, Ondrej Certik a écrit : On Fri, Apr 30, 2010 at 6:26 AM, jegerjensen jensen.oyv...@gmail.com wrote: Also,