diff -r 2b7b203e3909 Lib/test/test_typing.py --- a/Lib/test/test_typing.py Wed Jan 11 20:18:03 2017 +0200 +++ b/Lib/test/test_typing.py Wed Jan 11 14:55:39 2017 -0800 @@ -217,6 +217,9 @@ self.assertNotEqual(u2, Any) self.assertNotEqual(u3, Any) + def test_union_compare_other(self): + self.assertNotEqual(Union, object) + def test_union_object(self): u = Union[object] self.assertEqual(u, object) diff -r 2b7b203e3909 Lib/typing.py --- a/Lib/typing.py Wed Jan 11 20:18:03 2017 +0200 +++ b/Lib/typing.py Wed Jan 11 14:55:39 2017 -0800 @@ -757,7 +757,7 @@ def __eq__(self, other): if not isinstance(other, _Union): - return self._subs_tree() == other + return self._subs_tree() is not self and self._subs_tree() == other return self.__tree_hash__ == other.__tree_hash__ def __hash__(self):