Repository: sympy/sympy

Issue:
An absolute value of an interval issues a deprecation warning
If we don't wish to support an absolute value of an interval, we should raise a `ValueError`. If we wish to support it (as a pointwise function on the interval), we don't need to issue the warning. However, the current situation is weird:
```python
>>> Abs(Interval(2, 3))
```
issues
```
sympy/functions/elementary/complexes.py:492: SymPyDeprecationWarning: 

is_real has been deprecated since SymPy 0.7.6. Use is_subset(Reals)
instead. See https://github.com/sympy/sympy/issues/6212 for more info.

  if arg.is_real is False and arg.is_imaginary is False:
```

As the warning suggests, this is probably related to #6212.

Discussion:

Patch:
diff --git a/sympy/functions/combinatorial/factorials.py b/sympy/functions/combinatorial/factorials.py
index dadf12d5c0..280238d9df 100644
--- a/sympy/functions/combinatorial/factorials.py
+++ b/sympy/functions/combinatorial/factorials.py
@@ -173,8 +173,8 @@ def _eval_is_positive(self):
             return True
 
     def _eval_is_real(self):
-        x = self.args[0]
-        if x.is_nonnegative or x.is_noninteger:
+        if ((self.args[0].is_negative and self.args[0].is_noninteger) or
+           self.args[0].is_nonnegative):
             return True
 
 
diff --git a/sympy/functions/elementary/complexes.py b/sympy/functions/elementary/complexes.py
index bf1cd9c2b6..1a3e152b61 100644
--- a/sympy/functions/elementary/complexes.py
+++ b/sympy/functions/elementary/complexes.py
@@ -439,6 +439,8 @@ def eval(cls, arg):
             obj = arg._eval_Abs()
             if obj is not None:
                 return obj
+        if not isinstance(arg, C.Expr):
+            raise TypeError("Bad argument type for Abs(): %s" % type(arg))
         # handle what we can
         arg = signsimp(arg, evaluate=False)
         if arg.is_Mul:


Test patch:
diff --git a/sympy/functions/combinatorial/tests/test_comb_factorials.py b/sympy/functions/combinatorial/tests/test_comb_factorials.py
index 355d89770a..d00a55776e 100644
--- a/sympy/functions/combinatorial/tests/test_comb_factorials.py
+++ b/sympy/functions/combinatorial/tests/test_comb_factorials.py
@@ -88,9 +88,8 @@ def test_factorial():
     n = Symbol('n', integer=True)
     k = Symbol('k', integer=True, nonnegative=True)
     r = Symbol('r', integer=False)
-    s = Symbol('s', integer=False, negative=True)
+    s = Symbol('s', integer = False, negative = True)
     t = Symbol('t', nonnegative=True)
-    u = Symbol('u', noninteger=True)
 
     assert factorial(-2) == zoo
     assert factorial(0) == 1
@@ -111,7 +110,6 @@ def test_factorial():
     assert factorial(r).is_real is None
     assert factorial(s).is_real is True
     assert factorial(t).is_real is True
-    assert factorial(u).is_real is True
 
     assert factorial(oo) == oo
 
diff --git a/sympy/functions/elementary/tests/test_complexes.py b/sympy/functions/elementary/tests/test_complexes.py
index d9af2b0739..dde0640604 100644
--- a/sympy/functions/elementary/tests/test_complexes.py
+++ b/sympy/functions/elementary/tests/test_complexes.py
@@ -1,9 +1,9 @@
 from sympy import (
     Abs, adjoint, arg, atan2, conjugate, cos, DiracDelta, E, exp, expand,
-    Expr, Function, Heaviside, I, im, log, nan, oo, pi, Rational, re, S,
+    Expr, Function, Heaviside, I, im, log, nan, oo, pi, Rational, re, S, C,
     sign, sin, sqrt, Symbol, symbols, transpose, zoo, exp_polar, Piecewise
 )
-from sympy.utilities.pytest import XFAIL
+from sympy.utilities.pytest import XFAIL, raises
 
 from sympy.utilities.randtest import comp
 
@@ -308,6 +308,8 @@ def test_sign_issue_3068():
 
 
 def test_Abs():
+    raises(TypeError, lambda: Abs(C.Interval(2, 3)))  # issue 8717
+
     x, y = symbols('x,y')
     assert sign(sign(x)) == sign(x)
     assert sign(x*y).func is sign