From 88963fe9a93cf1945fca9e148181ba7bf2180435 Mon Sep 17 00:00:00 2001 From: Kirill Smelkov Date: Sat, 26 Jul 2008 12:15:13 +0400 Subject: [PATCH] "Fix" docstring where output depends on internal ordering. This just postpones problem, but make docstring tests pass on x86. I think what we really need is to make StrPrinter sort items for lists, tuples and dicts before printing. Signed-off-by: Kirill Smelkov --- sympy/functions/combinatorial/factorials.py | 2 +- sympy/integrals/risch.py | 2 +- sympy/polynomials/base.py | 2 +- sympy/printing/mathml.py | 6 +++--- sympy/solvers/solvers.py | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sympy/functions/combinatorial/factorials.py b/sympy/functions/combinatorial/factorials.py index 48883ba..3a11e1e 100644 --- a/sympy/functions/combinatorial/factorials.py +++ b/sympy/functions/combinatorial/factorials.py @@ -329,7 +329,7 @@ class Binomial(Function): -5/128 >>> binomial(n, 3) - n*(-1 + n)*(-2 + n)/6 + n*(1 - n)*(2 - n)/6 """ diff --git a/sympy/integrals/risch.py b/sympy/integrals/risch.py index 52006e1..5c03980 100644 --- a/sympy/integrals/risch.py +++ b/sympy/integrals/risch.py @@ -28,7 +28,7 @@ def components(f, x): >>> x, y = symbols('xy') >>> components(sin(x)*cos(x)**2, x) - set([x, sin(x), cos(x)]) + set([cos(x), x, sin(x)]) """ result = set() diff --git a/sympy/polynomials/base.py b/sympy/polynomials/base.py index eb6e2a4..673b823 100644 --- a/sympy/polynomials/base.py +++ b/sympy/polynomials/base.py @@ -83,7 +83,7 @@ class Polynomial(Basic): >>> print f 1 + x >>> print srepr(f) - Polynomial(Add(Symbol('x'), One(1)), ((One(1), One(1)), (One(1), Zero(0))), [Symbol('x')], 'grevlex') + Polynomial(Add(One(1), Symbol('x')), ((One(1), One(1)), (One(1), Zero(0))), [Symbol('x')], 'grevlex') >>> g = Polynomial(y**2 - x*y) >>> s = f + g >>> s.var == [x, y] diff --git a/sympy/printing/mathml.py b/sympy/printing/mathml.py index 9f45684..c0b80ab 100644 --- a/sympy/printing/mathml.py +++ b/sympy/printing/mathml.py @@ -143,12 +143,12 @@ def print_mathml(expr): >>> print_mathml(x+1) #doctest: +NORMALIZE_WHITESPACE - - x - 1 + + x + """ print mathml(expr) diff --git a/sympy/solvers/solvers.py b/sympy/solvers/solvers.py index d968535..938a083 100644 --- a/sympy/solvers/solvers.py +++ b/sympy/solvers/solvers.py @@ -54,7 +54,7 @@ def solve(f, *symbols, **flags): Solve a polynomial equation: >>> solve(x**4-1, x) - [I, 1, -1, -I] + [1, -1, -I, I] Solve a linear system: @@ -270,10 +270,10 @@ def solve_undetermined_coeffs(equ, coeffs, sym, **flags): >>> a, b, c, x = symbols('a', 'b', 'c', 'x') >>> solve_undetermined_coeffs(Eq(2*a*x + a+b, x), [a, b], x) - {b: -1/2, a: 1/2} + {a: 1/2, b: -1/2} >>> solve_undetermined_coeffs(Eq(a*c*x + a+b, x), [a, b], x) - {b: -1/c, a: 1/c} + {a: 1/c, b: -1/c} """ if isinstance(equ, Equality): -- 2.11.4.GIT