summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/is_isnot_literal.py
blob: 1626fa949f0943d3583b9f0c4858c78cdcc5d71a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# test "is" and "is not" with literal arguments
# these raise a SyntaxWarning in CPython because the results are
# implementation dependent; see https://bugs.python.org/issue34850

print(1 is 1)
print(1 is 2)
print(1 is not 1)
print(1 is not 2)

print("a" is "a")
print("a" is "b")
print("a" is not "a")
print("a" is not "b")