Repository: sympy/sympy

Issue:
Interval(-oo, oo) contains oo
Related : #9706 

```python
In [ ]: foo = Interval(-oo, oo)

In [ ]: foo.contains(-oo)
Out[ ]: True

In [ ]: foo.contains(oo)
Out[ ]: True

```

Ping @asmeurer 

Discussion:

Patch:
diff --git a/sympy/sets/sets.py b/sympy/sets/sets.py
index ac7a486dba..aecf54fe36 100644
--- a/sympy/sets/sets.py
+++ b/sympy/sets/sets.py
@@ -964,9 +964,10 @@ def _boundary(self):
         return FiniteSet(self.start, self.end)
 
     def _contains(self, other):
-        if other.is_real is False:
+        if other.is_real is False or other is S.NegativeInfinity or other is S.Infinity:
             return false
 
+
         if self.start is S.NegativeInfinity and self.end is S.Infinity:
             if not other.is_real is None:
                 return other.is_real


Test patch:
diff --git a/sympy/interactive/tests/test_ipythonprinting.py b/sympy/interactive/tests/test_ipythonprinting.py
index 211e6cd417..9cb6e1f9db 100644
--- a/sympy/interactive/tests/test_ipythonprinting.py
+++ b/sympy/interactive/tests/test_ipythonprinting.py
@@ -64,8 +64,7 @@ def test_print_builtin_option():
     else:
         text = app.user_ns['a'][0]['text/plain']
         raises(KeyError, lambda: app.user_ns['a'][0]['text/latex'])
-    # Note : Unicode of Python2 is equivalent to str in Python3. In Python 3 we have one
-    # text type: str which holds Unicode data and two byte types bytes and bytearray.
+    # Note : In Python 3 the text is unicode, but in 2 it is a string.
     # XXX: How can we make this ignore the terminal width? This test fails if
     # the terminal is too narrow.
     assert text in ("{pi: 3.14, n_i: 3}",
@@ -101,8 +100,7 @@ def test_print_builtin_option():
     else:
         text = app.user_ns['a'][0]['text/plain']
         raises(KeyError, lambda: app.user_ns['a'][0]['text/latex'])
-    # Note : Unicode of Python2 is equivalent to str in Python3. In Python 3 we have one
-    # text type: str which holds Unicode data and two byte types bytes and bytearray.
+    # Note : In Python 3 the text is unicode, but in 2 it is a string.
     # Python 3.3.3 + IPython 0.13.2 gives: '{n_i: 3, pi: 3.14}'
     # Python 3.3.3 + IPython 1.1.0 gives: '{n_i: 3, pi: 3.14}'
     # Python 2.7.5 + IPython 1.1.0 gives: '{pi: 3.14, n_i: 3}'
diff --git a/sympy/sets/tests/test_contains.py b/sympy/sets/tests/test_contains.py
index c48e04f052..ab1c06c26c 100644
--- a/sympy/sets/tests/test_contains.py
+++ b/sympy/sets/tests/test_contains.py
@@ -1,4 +1,4 @@
-from sympy import Symbol, Contains, S, Interval, FiniteSet
+from sympy import Symbol, Contains, S, Interval, FiniteSet, oo
 
 
 def test_contains_basic():
@@ -15,3 +15,8 @@ def test_issue_6194():
     assert Contains(x, FiniteSet(0)) != S.false
     assert Contains(x, Interval(1, 1)) != S.false
     assert Contains(x, S.Integers) != S.false
+
+
+def test_issue_10326():
+    assert Contains(oo, Interval(-oo, oo)) == False
+    assert Contains(-oo, Interval(-oo, oo)) == False