Repository: sympy/sympy

Issue:
expand_func(besselj(oo, x)) -> RecursionError
```
from sympy import *
from sympy.abc import x
expand_func(besselj(oo, x))
...
 line 86, in _eval_expand_func
    if (nu - 1).is_extended_positive:
...
RecursionError: maximum recursion depth exceeded in comparison
```

Discussion:

Patch:
diff --git a/sympy/functions/special/bessel.py b/sympy/functions/special/bessel.py
index c57b2dadb7..0a145d768f 100644
--- a/sympy/functions/special/bessel.py
+++ b/sympy/functions/special/bessel.py
@@ -82,11 +82,11 @@ def _eval_is_meromorphic(self, x, a):
 
     def _eval_expand_func(self, **hints):
         nu, z, f = self.order, self.argument, self.__class__
-        if nu.is_extended_real:
-            if (nu - 1).is_extended_positive:
+        if nu.is_real:
+            if (nu - 1).is_positive:
                 return (-self._a*self._b*f(nu - 2, z)._eval_expand_func() +
                         2*self._a*(nu - 1)*f(nu - 1, z)._eval_expand_func()/z)
-            elif (nu + 1).is_extended_negative:
+            elif (nu + 1).is_negative:
                 return (2*self._b*(nu + 1)*f(nu + 1, z)._eval_expand_func()/z -
                         self._a*self._b*f(nu + 2, z)._eval_expand_func())
         return self


Test patch:
diff --git a/sympy/functions/special/tests/test_bessel.py b/sympy/functions/special/tests/test_bessel.py
index 267d8f12c1..1ce62c8242 100644
--- a/sympy/functions/special/tests/test_bessel.py
+++ b/sympy/functions/special/tests/test_bessel.py
@@ -218,6 +218,10 @@ def test_expand():
     for besselx in [bessely, besselk]:
         assert besselx(i, r).is_extended_real is None
 
+    for besselx in [besselj, bessely, besseli, besselk]:
+        assert expand_func(besselx(oo, x)) == besselx(oo, x, evaluate=False)
+        assert expand_func(besselx(-oo, x)) == besselx(-oo, x, evaluate=False)
+
 
 @slow
 def test_slow_expand():