summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_operator.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-12-12 23:11:42 (GMT)
committerFred Drake <fdrake@acm.org>2000-12-12 23:11:42 (GMT)
commit132dce22469f476f399d1bbc6d1cc2f7ba0110cc (patch)
tree4b0988e41b3b7d25d10c2a24fb18b07ff376f66d /Lib/test/test_operator.py
parent63596aeb33c2837d7802449c8906349c9ea1998e (diff)
downloadcpython-132dce22469f476f399d1bbc6d1cc2f7ba0110cc.zip
cpython-132dce22469f476f399d1bbc6d1cc2f7ba0110cc.tar.gz
cpython-132dce22469f476f399d1bbc6d1cc2f7ba0110cc.tar.bz2
Update the code to better reflect recommended style:
Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
Diffstat (limited to 'Lib/test/test_operator.py')
-rw-r--r--Lib/test/test_operator.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py
index 8d3864c..b75c5ba 100644
--- a/Lib/test/test_operator.py
+++ b/Lib/test/test_operator.py
@@ -9,7 +9,7 @@ def test(name, input, output, *args):
val = apply(f, params)
except:
val = sys.exc_type
- if val <> output:
+ if val != output:
print '%s%s = %s: %s expected' % (f.__name__, params, `val`, `output`)
test('abs', -1, 1)
@@ -21,12 +21,12 @@ test('countOf', [1, 2, 1, 3, 1, 4], 1, 3)
a = [4, 3, 2, 1]
test('delitem', a, None, 1)
-if a <> [4, 2, 1]:
+if a != [4, 2, 1]:
print 'delitem() failed'
a = range(10)
test('delslice', a, None, 2, 8)
-if a <> [0, 1, 8, 9]:
+if a != [0, 1, 8, 9]:
print 'delslice() failed'
a = range(10)
@@ -59,12 +59,12 @@ test('sequenceIncludes', range(4), 1, 2)
test('sequenceIncludes', range(4), 0, 5)
test('setitem', a, None, 0, 2)
-if a <> [2, 1, 2]:
+if a != [2, 1, 2]:
print 'setitem() failed'
a = range(4)
test('setslice', a, None, 1, 3, [2, 1])
-if a <> [0, 2, 1, 3]:
+if a != [0, 2, 1, 3]:
print 'setslice() failed:', a
test('sub', 5, 2, 3)