Repository: sympy/sympy

Issue:
Limits at complex infinity are sometimes interpreted as limits at oo or -oo
```
>>> var('z')
>>> limit(z**2/(z+1), z, zoo)
oo    # this is the limit at oo, not at zoo 
>>> limit(exp(z), z, zoo)
0      # this is the limit at -oo, not at zoo
```

The former behavior comes from ["all ok" branch](https://github.com/sympy/sympy/blob/master/sympy/series/limits.py#L193), which groups zoo with oo.
```
                    if z0 is S.NegativeInfinity:
                        inve = e.subs(z, -1/u)
                    else:    # both oo and zoo go here
                        inve = e.subs(z, 1/u)
```
The latter comes from [heuristics](https://github.com/sympy/sympy/blob/master/sympy/series/limits.py#L73), which groups zoo with -oo.  
```
    if abs(z0) is S.Infinity:
        rv = limit(e.subs(z, 1/z), z, S.Zero, "+" if z0 is S.Infinity else "-")
```

Possible solutions: 

1. Limit at zoo raises NotImplementedError
2. Limit at zoo is evaluated as a parametric limit, [as suggested here](https://github.com/sympy/sympy/issues/8341#issuecomment-371641653).

Discussion:

Patch:
diff --git a/sympy/series/limits.py b/sympy/series/limits.py
index 660714191a..f57882286e 100644
--- a/sympy/series/limits.py
+++ b/sympy/series/limits.py
@@ -163,6 +163,10 @@ def doit(self, **hints):
 
         e, z, z0, dir = self.args
 
+        if z0 is S.ComplexInfinity:
+            raise NotImplementedError("Limits at complex "
+                                    "infinity are not implemented")
+
         if hints.get('deep', True):
             e = e.doit(**hints)
             z = z.doit(**hints)


Test patch:
diff --git a/sympy/series/tests/test_limits.py b/sympy/series/tests/test_limits.py
index 34a9e91883..1ede3355de 100644
--- a/sympy/series/tests/test_limits.py
+++ b/sympy/series/tests/test_limits.py
@@ -4,7 +4,7 @@
     limit, exp, oo, log, sqrt, Limit, sin, floor, cos, ceiling,
     atan, gamma, Symbol, S, pi, Integral, Rational, I, EulerGamma,
     tan, cot, integrate, Sum, sign, Function, subfactorial, symbols,
-    binomial, simplify, frac, Float, sec)
+    binomial, simplify, frac, Float, sec, zoo)
 
 from sympy.calculus.util import AccumBounds
 from sympy.core.add import Add
@@ -510,10 +510,12 @@ def test_issue_10610():
 def test_issue_6599():
     assert limit((n + cos(n))/n, n, oo) == 1
 
+
 def test_issue_12555():
     assert limit((3**x + 2* x**10) / (x**10 + exp(x)), x, -oo) == 2
     assert limit((3**x + 2* x**10) / (x**10 + exp(x)), x, oo) == oo
 
+
 def test_issue_12564():
     assert limit(x**2 + x*sin(x) + cos(x), x, -oo) == oo
     assert limit(x**2 + x*sin(x) + cos(x), x, oo) == oo
@@ -522,5 +524,11 @@ def test_issue_12564():
     assert limit(((x + cos(x))**2).expand(), x, -oo) == oo
     assert limit(((x + sin(x))**2).expand(), x, -oo) == oo
 
+
+def test_issue_14456():
+    raises(NotImplementedError, lambda: Limit(exp(x), x, zoo).doit())
+    raises(NotImplementedError, lambda: Limit(x**2/(x+1), x, zoo).doit())
+
+
 def test_issue_14411():
     assert limit(3*sec(4*pi*x - x/3), x, 3*pi/(24*pi - 2)) == -oo