Debian Codegraph @

pypy/objspace/std/test/apptest_contains.py

raw symbols SCIP
1 class _ALWAYS_EQ:
2 """
3 Object that is equal to anything.
4 """
5 def __eq__(self, other):
6 return True
7 def __ne__(self, other):
8 return False
9
10 ALWAYS_EQ = _ALWAYS_EQ()
11
12 class _NEVER_EQ:
13 """
14 Object that is not equal to anything.
15 """
16 def __eq__(self, other):
17 return False
18 def __ne__(self, other):
19 return True
20
21 NEVER_EQ = _NEVER_EQ()
22
23
24 def test_contains_list():
25 assert not ALWAYS_EQ in [NEVER_EQ,]
26
27 def test_contains_tuple():
28 assert not ALWAYS_EQ in (NEVER_EQ,)