Skip to content

Commit a234342

Browse files
committed
Trac #32964: replace some uses of var() with SR.var().
This is unrelated to the main purpose of ticket 32964, but while I was editing this file, I noticed that several examples use var() to inject symbolic expressions into the current scope. This commit changes them to use the preferred form `x = SR.var('x')` whose side-effects are much easier to predict.
1 parent e713a4f commit a234342

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sage/functions/orthogonal_polys.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,7 @@ class Func_hermite(GinacFunction):
19111911
...
19121912
RuntimeError: hermite_eval: The index n must be a nonnegative integer
19131913
1914-
sage: _ = var('m x')
1914+
sage: m,x = SR.var('m,x')
19151915
sage: hermite(m, x).diff(m)
19161916
Traceback (most recent call last):
19171917
...
@@ -1962,7 +1962,7 @@ def __init__(self):
19621962
19631963
EXAMPLES::
19641964
1965-
sage: _ = var('n a b x')
1965+
sage: n,a,b,x = SR.var('n,a,b,x')
19661966
sage: loads(dumps(jacobi_P))
19671967
jacobi_P
19681968
sage: jacobi_P(n, a, b, x, hold=True)._sympy_()
@@ -1976,7 +1976,7 @@ def _eval_(self, n, a, b, x):
19761976
"""
19771977
EXAMPLES::
19781978
1979-
sage: _ = var('n a b x')
1979+
sage: n,a,b,x = SR.var('n,a,b,x')
19801980
sage: jacobi_P(1,n,n,n)
19811981
(n + 1)*n
19821982
sage: jacobi_P(2,n,n,n)
@@ -2080,7 +2080,7 @@ class Func_ultraspherical(GinacFunction):
20802080
sage: t = PolynomialRing(RationalField(),"t").gen()
20812081
sage: gegenbauer(3,2,t)
20822082
32*t^3 - 12*t
2083-
sage: _ = var('x')
2083+
sage: x = SR.var('x')
20842084
sage: n = ZZ.random_element(5, 5001)
20852085
sage: a = QQ.random_element().abs() + 5
20862086
sage: s = ( (n+1)*ultraspherical(n+1,a,x)
@@ -2093,7 +2093,7 @@ class Func_ultraspherical(GinacFunction):
20932093
sage: ultraspherical(5,9/10,RealField(100)(pi))
20942094
6949.4695419382702451843080687
20952095
2096-
sage: _ = var('a n')
2096+
sage: a,n = SR.var('a,n')
20972097
sage: gegenbauer(2,a,x)
20982098
2*(a + 1)*a*x^2 - a
20992099
sage: gegenbauer(3,a,x)

0 commit comments

Comments
 (0)