Comment #9 on issue 1434 by ondrej.certik: substitution doesn't work for sqrt() http://code.google.com/p/sympy/issues/detail?id=1434
Fabian, you are doing so many changes at once. Just apply this patch: diff --git a/sympy/core/numbers.py b/sympy/core/numbers.py index e9061e1..bcbbc93 100644 --- a/sympy/core/numbers.py +++ b/sympy/core/numbers.py @@ -999,6 +999,8 @@ class Integer(Rational): if base.is_positive: return result elif exp.q == 2: + return result + print "exp", exp return result * S.ImaginaryUnit else: return result * ((-1)**exp) (you can remove the print statement and the "return result * S.ImaginaryUnit", becuse it never gets run) That way it will work, I tested it, all tests pass. Write lots of tests for it, see the ones in Luke's patch. Only after that, you can refactor the code in any way you like (and at this stage you will *not* change any tests). So the patch is -1. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy-issues" group. To post to this group, send email to sympy-issues@googlegroups.com To unsubscribe from this group, send email to sympy-issues+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sympy-issues?hl=en -~----------~----~----~----~------~----~------~--~---