diff options
author | Fred Drake <fdrake@acm.org> | 2000-12-12 23:11:42 +0000 |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-12-12 23:11:42 +0000 |
commit | 815a523a0c039f5522f3003ef9e13c987be2a8b2 (patch) | |
tree | 6fcc3b1f22fd414e5568ffab828d677419b26040 /Lib/test/test_operator.py | |
parent | 614fabb63b74a8f85bc6cce9236cc347140bdf94 (diff) | |
download | cpython-815a523a0c039f5522f3003ef9e13c987be2a8b2.tar.gz |
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.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py index 8d3864c50d..b75c5ba78f 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) |