diff options
author | Guido van Rossum <guido@python.org> | 2006-08-24 03:53:23 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-08-24 03:53:23 (GMT) |
commit | b053cd8f40dd19985b16f50661640dcefb69888f (patch) | |
tree | 88e1c2ce636a6df402a97c51ea9067a46735120a /Lib | |
parent | 01c77c66289f8e9c8d15b8da623fae4014ec2edb (diff) | |
download | cpython-b053cd8f40dd19985b16f50661640dcefb69888f.zip cpython-b053cd8f40dd19985b16f50661640dcefb69888f.tar.gz cpython-b053cd8f40dd19985b16f50661640dcefb69888f.tar.bz2 |
Killed the <> operator. You must now use !=.
Opportunistically also fixed one or two places where '<> None' should be
'is not None' and where 'type(x) <> y' should be 'not isinstance(x, y)'.
Diffstat (limited to 'Lib')
32 files changed, 67 insertions, 71 deletions
diff --git a/Lib/bsddb/dbtables.py b/Lib/bsddb/dbtables.py index 655fb96..7f862d7 100644 --- a/Lib/bsddb/dbtables.py +++ b/Lib/bsddb/dbtables.py @@ -453,7 +453,7 @@ class bsdTableDB : # error dataitem = None dataitem = mappings[column](dataitem) - if dataitem <> None: + if dataitem != None: self.db.put( _data_key(table, column, rowid), dataitem, txn=txn) diff --git a/Lib/bsddb/test/test_compat.py b/Lib/bsddb/test/test_compat.py index 841e01c..af9e128 100644 --- a/Lib/bsddb/test/test_compat.py +++ b/Lib/bsddb/test/test_compat.py @@ -120,7 +120,7 @@ class CompatibilityTestCase(unittest.TestCase): try: rec = f.next() except KeyError: - assert rec == f.last(), 'Error, last <> last!' + assert rec == f.last(), 'Error, last != last!' f.previous() break if verbose: diff --git a/Lib/bsddb/test/test_recno.py b/Lib/bsddb/test/test_recno.py index 170448e..e325aac 100644 --- a/Lib/bsddb/test/test_recno.py +++ b/Lib/bsddb/test/test_recno.py @@ -30,7 +30,7 @@ class SimpleRecnoTestCase(unittest.TestCase): try: os.remove(self.filename) except OSError, e: - if e.errno <> errno.EEXIST: raise + if e.errno != errno.EEXIST: raise def test01_basic(self): d = db.DB() diff --git a/Lib/bsddb/test/test_thread.py b/Lib/bsddb/test/test_thread.py index f187413..6942aa2 100644 --- a/Lib/bsddb/test/test_thread.py +++ b/Lib/bsddb/test/test_thread.py @@ -58,7 +58,7 @@ class BaseThreadedTestCase(unittest.TestCase): try: os.mkdir(homeDir) except OSError, e: - if e.errno <> errno.EEXIST: raise + if e.errno != errno.EEXIST: raise self.env = db.DBEnv() self.setEnvOpts() self.env.open(homeDir, self.envflags | db.DB_CREATE) diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py index 091d599..b564300 100644 --- a/Lib/compiler/transformer.py +++ b/Lib/compiler/transformer.py @@ -618,7 +618,7 @@ class Transformer: for i in range(2, len(nodelist), 2): nl = nodelist[i-1] - # comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '==' + # comp_op: '<' | '>' | '=' | '>=' | '<=' | '!=' | '==' # | 'in' | 'not' 'in' | 'is' | 'is' 'not' n = nl[1] if n[0] == token.NAME: @@ -1396,7 +1396,7 @@ _doc_nodes = [ symbol.power, ] -# comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '==' +# comp_op: '<' | '>' | '=' | '>=' | '<=' | '!=' | '==' # | 'in' | 'not' 'in' | 'is' | 'is' 'not' _cmp_types = { token.LESS : '<', diff --git a/Lib/email/base64mime.py b/Lib/email/base64mime.py index 0129d9d..0b29eb8 100644 --- a/Lib/email/base64mime.py +++ b/Lib/email/base64mime.py @@ -146,7 +146,7 @@ def encode(s, binary=True, maxlinelen=76, eol=NL): # BAW: should encode() inherit b2a_base64()'s dubious behavior in # adding a newline to the encoded string? enc = b2a_base64(s[i:i + max_unencoded]) - if enc.endswith(NL) and eol <> NL: + if enc.endswith(NL) and eol != NL: enc = enc[:-1] + eol encvec.append(enc) return EMPTYSTRING.join(encvec) diff --git a/Lib/email/charset.py b/Lib/email/charset.py index 8f218b2..882aa42 100644 --- a/Lib/email/charset.py +++ b/Lib/email/charset.py @@ -250,7 +250,7 @@ class Charset: Returns "base64" if self.body_encoding is BASE64. Returns "7bit" otherwise. """ - assert self.body_encoding <> SHORTEST + assert self.body_encoding != SHORTEST if self.body_encoding == QP: return 'quoted-printable' elif self.body_encoding == BASE64: @@ -260,7 +260,7 @@ class Charset: def convert(self, s): """Convert a string from the input_codec to the output_codec.""" - if self.input_codec <> self.output_codec: + if self.input_codec != self.output_codec: return unicode(s, self.input_codec).encode(self.output_codec) else: return s diff --git a/Lib/email/generator.py b/Lib/email/generator.py index 6e7a515..ed832a3 100644 --- a/Lib/email/generator.py +++ b/Lib/email/generator.py @@ -211,7 +211,7 @@ class Generator: # doesn't preserve newlines/continuations in headers. This is no big # deal in practice, but turns out to be inconvenient for the unittest # suite. - if msg.get_boundary() <> boundary: + if msg.get_boundary() != boundary: msg.set_boundary(boundary) # If there's a preamble, write it out, with a trailing CRLF if msg.preamble is not None: diff --git a/Lib/email/header.py b/Lib/email/header.py index 183c337..3de44f9 100644 --- a/Lib/email/header.py +++ b/Lib/email/header.py @@ -248,7 +248,7 @@ class Header: elif not isinstance(charset, Charset): charset = Charset(charset) # If the charset is our faux 8bit charset, leave the string unchanged - if charset <> '8bit': + if charset != '8bit': # We need to test that the string can be converted to unicode and # back to a byte string, given the input and output codecs of the # charset. @@ -454,7 +454,7 @@ def _split_ascii(s, firstlen, restlen, continuation_ws, splitchars): # If this part is longer than maxlen and we aren't already # splitting on whitespace, try to recursively split this line # on whitespace. - if partlen > maxlen and ch <> ' ': + if partlen > maxlen and ch != ' ': subl = _split_ascii(part, maxlen, restlen, continuation_ws, ' ') lines.extend(subl[:-1]) diff --git a/Lib/email/message.py b/Lib/email/message.py index 6110131..9d25cb0 100644 --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -252,7 +252,7 @@ class Message: charset=charset.get_output_charset()) else: self.set_param('charset', charset.get_output_charset()) - if str(charset) <> charset.get_output_charset(): + if str(charset) != charset.get_output_charset(): self._payload = charset.body_encode(self._payload) if 'Content-Transfer-Encoding' not in self: cte = charset.get_body_encoding() @@ -301,7 +301,7 @@ class Message: name = name.lower() newheaders = [] for k, v in self._headers: - if k.lower() <> name: + if k.lower() != name: newheaders.append((k, v)) self._headers = newheaders @@ -438,7 +438,7 @@ class Message: return self.get_default_type() ctype = paramre.split(value)[0].lower().strip() # RFC 2045, section 5.2 says if its invalid, use text/plain - if ctype.count('/') <> 1: + if ctype.count('/') != 1: return 'text/plain' return ctype @@ -601,7 +601,7 @@ class Message: ctype = append_param else: ctype = SEMISPACE.join([ctype, append_param]) - if ctype <> self.get(header): + if ctype != self.get(header): del self[header] self[header] = ctype @@ -617,13 +617,13 @@ class Message: return new_ctype = '' for p, v in self.get_params(header=header, unquote=requote): - if p.lower() <> param.lower(): + if p.lower() != param.lower(): if not new_ctype: new_ctype = _formatparam(p, v, requote) else: new_ctype = SEMISPACE.join([new_ctype, _formatparam(p, v, requote)]) - if new_ctype <> self.get(header): + if new_ctype != self.get(header): del self[header] self[header] = new_ctype diff --git a/Lib/email/quoprimime.py b/Lib/email/quoprimime.py index a5658dd..389b276 100644 --- a/Lib/email/quoprimime.py +++ b/Lib/email/quoprimime.py @@ -287,7 +287,7 @@ def decode(encoded, eol=NL): n = len(line) while i < n: c = line[i] - if c <> '=': + if c != '=': decoded += c i += 1 # Otherwise, c == "=". Are we at the end of the line? If so, add diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py index 13801dc..8127ef0 100644 --- a/Lib/email/test/test_email.py +++ b/Lib/email/test/test_email.py @@ -51,7 +51,7 @@ def openfile(filename, mode='r'): class TestEmailBase(unittest.TestCase): def ndiffAssertEqual(self, first, second): """Like failUnlessEqual except use ndiff for readable output.""" - if first <> second: + if first != second: sfirst = str(first) ssecond = str(second) diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines()) @@ -2726,7 +2726,7 @@ class TestCharset(unittest.TestCase): # Try a charset with None body encoding c = Charset('us-ascii') eq('hello world', c.body_encode('hello world')) - # Try the convert argument, where input codec <> output codec + # Try the convert argument, where input codec != output codec c = Charset('euc-jp') # With apologies to Tokio Kikuchi ;) try: diff --git a/Lib/email/test/test_email_renamed.py b/Lib/email/test/test_email_renamed.py index 30f39b9..ce685c5 100644 --- a/Lib/email/test/test_email_renamed.py +++ b/Lib/email/test/test_email_renamed.py @@ -52,7 +52,7 @@ def openfile(filename, mode='r'): class TestEmailBase(unittest.TestCase): def ndiffAssertEqual(self, first, second): """Like failUnlessEqual except use ndiff for readable output.""" - if first <> second: + if first != second: sfirst = str(first) ssecond = str(second) diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines()) @@ -2732,7 +2732,7 @@ class TestCharset(unittest.TestCase): # Try a charset with None body encoding c = Charset('us-ascii') eq('hello world', c.body_encode('hello world')) - # Try the convert argument, where input codec <> output codec + # Try the convert argument, where input codec != output codec c = Charset('euc-jp') # With apologies to Tokio Kikuchi ;) try: diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index d5681c8..953afe9 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -912,7 +912,8 @@ class Manager: """ #for c in ph.loggers: for c in ph.loggerMap.keys(): - if string.find(c.parent.name, alogger.name) <> 0: + # XXX Is the following correct? Shouldn't it be >= 0? + if string.find(c.parent.name, alogger.name) != 0: alogger.parent = c.parent c.parent = alogger diff --git a/Lib/plat-mac/FrameWork.py b/Lib/plat-mac/FrameWork.py index cda38e4..0bd6feb 100644 --- a/Lib/plat-mac/FrameWork.py +++ b/Lib/plat-mac/FrameWork.py @@ -602,7 +602,7 @@ class Menu: def dispatch(self, id, item, window, event): title, shortcut, callback, mtype = self.items[item-1] if callback: - if not self.bar.parent or type(callback) <> types.StringType: + if not self.bar.parent or not isinstance(callback, str): menuhandler = callback else: # callback is string @@ -748,7 +748,7 @@ class Window: self.parent = parent def open(self, bounds=(40, 40, 400, 400), resid=None): - if resid <> None: + if resid is not None: self.wid = GetNewWindow(resid, -1) else: self.wid = NewWindow(bounds, self.__class__.__name__, 1, @@ -826,7 +826,7 @@ class Window: # If we're not frontmost, select ourselves and wait for # the activate event. # - if MyFrontWindow() <> window: + if MyFrontWindow() != window: window.SelectWindow() return # We are. Handle the event. @@ -875,7 +875,7 @@ class ControlsWindow(Window): if DEBUG: print "control hit in", window, "on", control, "; pcode =", pcode def do_inContent(self, partcode, window, event): - if MyFrontWindow() <> window: + if MyFrontWindow() != window: window.SelectWindow() return (what, message, when, where, modifiers) = event diff --git a/Lib/plat-mac/buildtools.py b/Lib/plat-mac/buildtools.py index c83e218..7c5d0f4 100644 --- a/Lib/plat-mac/buildtools.py +++ b/Lib/plat-mac/buildtools.py @@ -192,7 +192,7 @@ def process_common(template, progress, code, rsrcname, destname, is_update, 'icl8', 'ics4', 'ics8', 'ICN#', 'ics#'] if not copy_codefragment: skiptypes.append('cfrg') -## skipowner = (ownertype <> None) +## skipowner = (ownertype != None) # Copy the resources from the template diff --git a/Lib/plat-mac/cfmfile.py b/Lib/plat-mac/cfmfile.py index fd1a3e8..df157fd 100644 --- a/Lib/plat-mac/cfmfile.py +++ b/Lib/plat-mac/cfmfile.py @@ -73,7 +73,7 @@ class CfrgResource: Res.CloseResFile(resref) Res.UseResFile(currentresref) self.parse(data) - if self.version <> 1: + if self.version != 1: raise error, "unknown 'cfrg' resource format" def parse(self, data): @@ -143,7 +143,7 @@ class FragmentDescriptor: return data def getfragment(self): - if self.where <> 1: + if self.where != 1: raise error, "can't read fragment, unsupported location" f = open(self.path, "rb") f.seek(self.offset) @@ -155,7 +155,7 @@ class FragmentDescriptor: return frag def copydata(self, outfile): - if self.where <> 1: + if self.where != 1: raise error, "can't read fragment, unsupported location" infile = open(self.path, "rb") if self.length == 0: diff --git a/Lib/plat-mac/gensuitemodule.py b/Lib/plat-mac/gensuitemodule.py index 983e0f9..53c0a52 100644 --- a/Lib/plat-mac/gensuitemodule.py +++ b/Lib/plat-mac/gensuitemodule.py @@ -169,7 +169,7 @@ def processfile_fromresource(fullname, output=None, basepkgname=None, aete = decode(data, verbose) aetelist.append((aete, res.GetResInfo())) finally: - if rf <> cur: + if rf != cur: CloseResFile(rf) UseResFile(cur) # switch back (needed for dialogs in Python) @@ -332,7 +332,7 @@ def getpstr(f, *args): def getalign(f): if f.tell() & 1: c = f.read(1) - ##if c <> '\0': + ##if c != '\0': ## print align:', repr(c) def getlist(f, description, getitem): @@ -779,7 +779,7 @@ class SuiteCompiler: if is_enum(a[2]): kname = a[1] ename = a[2][0] - if ename <> '****': + if ename != '****': fp.write(" aetools.enumsubst(_arguments, %r, _Enum_%s)\n" % (kname, identify(ename))) self.enumsneeded[ename] = 1 @@ -810,7 +810,7 @@ class SuiteCompiler: for a in arguments: if is_enum(a[2]): ename = a[2][0] - if ename <> '****': + if ename != '****': self.enumsneeded[ename] = 1 # diff --git a/Lib/plat-mac/macerrors.py b/Lib/plat-mac/macerrors.py index ce2a118..faa5244 100644 --- a/Lib/plat-mac/macerrors.py +++ b/Lib/plat-mac/macerrors.py @@ -1574,7 +1574,7 @@ smFHBlkDispErr = -311 #Error occurred during _sDisposePtr (Dispose of FHea smFHBlockRdErr = -310 #Error occurred during _sGetFHeader. smBLFieldBad = -309 #ByteLanes field was bad. smUnExBusErr = -308 #Unexpected BusError -smResrvErr = -307 #Fatal reserved error. Resreved field <> 0. +smResrvErr = -307 #Fatal reserved error. Resreved field != 0. smNosInfoArray = -306 #No sInfoArray. Memory Mgr error. smDisabledSlot = -305 #This slot is disabled (-305 use to be smLWTstBad) smNoDir = -304 #Directory offset is Nil diff --git a/Lib/test/output/test_class b/Lib/test/output/test_class index 7d8ab5e..f3dc490 100644 --- a/Lib/test/output/test_class +++ b/Lib/test/output/test_class @@ -55,12 +55,10 @@ __eq__: (1,) __lt__: (1,) __gt__: (1,) __ne__: (1,) -__ne__: (1,) __eq__: (1,) __gt__: (1,) __lt__: (1,) __ne__: (1,) -__ne__: (1,) __del__: () __getattr__: ('spam',) __setattr__: ('eggs', 'spam, spam, spam and ham') diff --git a/Lib/test/output/test_tokenize b/Lib/test/output/test_tokenize index b78a223..edd39bf 100644 --- a/Lib/test/output/test_tokenize +++ b/Lib/test/output/test_tokenize @@ -108,11 +108,11 @@ test_tokenize 37,0-37,1: NL '\n' 38,0-38,20: COMMENT '# Ordinary integers\n' 39,0-39,4: NUMBER '0xff' -39,5-39,7: OP '<>' +39,5-39,7: OP '!=' 39,8-39,11: NUMBER '255' 39,11-39,12: NEWLINE '\n' 40,0-40,4: NUMBER '0377' -40,5-40,7: OP '<>' +40,5-40,7: OP '!=' 40,8-40,11: NUMBER '255' 40,11-40,12: NEWLINE '\n' 41,0-41,10: NUMBER '2147483647' @@ -484,7 +484,7 @@ test_tokenize 149,2-149,3: OP ',' 149,4-149,5: NAME 'y' 149,5-149,6: OP ')' -149,7-149,9: OP '<>' +149,7-149,9: OP '!=' 149,10-149,11: OP '(' 149,11-149,12: OP '{' 149,12-149,15: STRING "'a'" @@ -513,7 +513,7 @@ test_tokenize 152,21-152,22: NUMBER '1' 152,23-152,25: OP '<=' 152,26-152,27: NUMBER '1' -152,28-152,30: OP '<>' +152,28-152,30: OP '!=' 152,31-152,32: NUMBER '1' 152,33-152,35: OP '!=' 152,36-152,37: NUMBER '1' diff --git a/Lib/test/test_bsddb3.py b/Lib/test/test_bsddb3.py index 8b0c50c..166ad03 100644 --- a/Lib/test/test_bsddb3.py +++ b/Lib/test/test_bsddb3.py @@ -8,7 +8,7 @@ from test.test_support import requires, verbose, run_suite, unlink # When running as a script instead of within the regrtest framework, skip the # requires test, since it's obvious we want to run them. -if __name__ <> '__main__': +if __name__ != '__main__': requires('bsddb') verbose = False diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py index 66f4265..795acd9 100644 --- a/Lib/test/test_class.py +++ b/Lib/test/test_class.py @@ -244,12 +244,10 @@ str(testme) testme == 1 testme < 1 testme > 1 -testme <> 1 testme != 1 1 == testme 1 < testme 1 > testme -1 <> testme 1 != testme # This test has to be last (duh.) diff --git a/Lib/test/test_funcattrs.py b/Lib/test/test_funcattrs.py index 7a083b7..ab33528 100644 --- a/Lib/test/test_funcattrs.py +++ b/Lib/test/test_funcattrs.py @@ -19,16 +19,16 @@ try: except AttributeError: pass else: raise TestFailed, 'expected AttributeError' -if b.__dict__ <> {}: +if b.__dict__ != {}: raise TestFailed, 'expected unassigned func.__dict__ to be {}' b.publish = 1 -if b.publish <> 1: +if b.publish != 1: raise TestFailed, 'function attribute not set to expected value' docstring = 'its docstring' b.__doc__ = docstring -if b.__doc__ <> docstring: +if b.__doc__ != docstring: raise TestFailed, 'problem with setting __doc__ attribute' if 'publish' not in dir(b): @@ -49,7 +49,7 @@ d = {'hello': 'world'} b.__dict__ = d if b.func_dict is not d: raise TestFailed, 'func.__dict__ assignment to dictionary failed' -if b.hello <> 'world': +if b.hello != 'world': raise TestFailed, 'attribute after func.__dict__ assignment failed' f1 = F() @@ -75,13 +75,13 @@ else: raise TestFailed, 'expected AttributeError or TypeError' # But setting it explicitly on the underlying function object is okay. F.a.im_func.publish = 1 -if F.a.publish <> 1: +if F.a.publish != 1: raise TestFailed, 'unbound method attribute not set to expected value' -if f1.a.publish <> 1: +if f1.a.publish != 1: raise TestFailed, 'bound method attribute access did not work' -if f2.a.publish <> 1: +if f2.a.publish != 1: raise TestFailed, 'bound method attribute access did not work' if 'publish' not in dir(F.a): @@ -117,7 +117,7 @@ else: raise TestFailed, 'expected TypeError or AttributeError' F.a.im_func.__dict__ = {'one': 11, 'two': 22, 'three': 33} -if f1.a.two <> 22: +if f1.a.two != 22: raise TestFailed, 'setting __dict__' from UserDict import UserDict @@ -128,7 +128,7 @@ try: except (AttributeError, TypeError): pass else: raise TestFailed -if f2.a.one <> f1.a.one <> F.a.one <> 11: +if f2.a.one != f1.a.one != F.a.one != 11: raise TestFailed # im_func may not be a Python method! @@ -136,7 +136,7 @@ import new F.id = new.instancemethod(id, None, F) eff = F() -if eff.id() <> id(eff): +if eff.id() != id(eff): raise TestFailed try: diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 458bfa2..0ce43dc 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -412,7 +412,7 @@ def test_break_continue_loop(extra_burning_oil = 1, count=0): continue except: raise - if count > 2 or big_hippo <> 1: + if count > 2 or big_hippo != 1: print "continue then break in try/except in loop broken!" test_break_continue_loop() @@ -586,12 +586,11 @@ if 1 and 1 or 1 and 1 and 1 or not 1 and 1: pass print 'comparison' ### comparison: expr (comp_op expr)* -### comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +### comp_op: '<'|'>'|'=='|'>='|'<='|'!='|'in'|'not' 'in'|'is'|'is' 'not' if 1: pass x = (1 == 1) if 1 == 1: pass if 1 != 1: pass -if 1 <> 1: pass if 1 < 1: pass if 1 > 1: pass if 1 <= 1: pass @@ -600,7 +599,7 @@ if 1 is 1: pass if 1 is not 1: pass if 1 in (): pass if 1 not in (): pass -if 1 < 1 > 1 == 1 >= 1 <= 1 <> 1 != 1 in 1 not in 1 is 1 is not 1: pass +if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass print 'binary mask ops' x = 1 & 1 diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 356b801..df37f73 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -285,7 +285,7 @@ class GeneralModuleTests(unittest.TestCase): orig = sys.getrefcount(__name__) socket.getnameinfo(__name__,0) except SystemError: - if sys.getrefcount(__name__) <> orig: + if sys.getrefcount(__name__) != orig: self.fail("socket.getnameinfo loses a reference") def testInterpreterCrash(self): diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py index b42f437..f33c30d 100755 --- a/Lib/test/test_wsgiref.py +++ b/Lib/test/test_wsgiref.py @@ -515,7 +515,7 @@ class HandlerTests(TestCase): "Content-Length: %d\r\n" "\r\n%s" % (h.error_status,len(h.error_body),h.error_body)) - self.failUnless(h.stderr.getvalue().find("AssertionError")<>-1) + self.failUnless("AssertionError" in h.stderr.getvalue()) def testErrorAfterOutput(self): MSG = "Some output has been sent" @@ -528,7 +528,7 @@ class HandlerTests(TestCase): self.assertEqual(h.stdout.getvalue(), "Status: 200 OK\r\n" "\r\n"+MSG) - self.failUnless(h.stderr.getvalue().find("AssertionError")<>-1) + self.failUnless("AssertionError" in h.stderr.getvalue()) def testHeaderFormats(self): diff --git a/Lib/test/tokenize_tests.txt b/Lib/test/tokenize_tests.txt index 4ef3bf1..59e51d7 100644 --- a/Lib/test/tokenize_tests.txt +++ b/Lib/test/tokenize_tests.txt @@ -36,8 +36,8 @@ x = 1 \ x = 0 # Ordinary integers -0xff <> 255 -0377 <> 255 +0xff != 255 +0377 != 255 2147483647 != 017777777777 -2147483647-1 != 020000000000 037777777777 != -1 @@ -146,10 +146,10 @@ if 0: def d22(a, b, c=1, d=2): pass def d01v(a=1, *restt, **restd): pass -(x, y) <> ({'a':1}, {'b':2}) +(x, y) != ({'a':1}, {'b':2}) # comparison -if 1 < 1 > 1 == 1 >= 1 <= 1 <> 1 != 1 in 1 not in 1 is 1 is not 1: pass +if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 != 1 in 1 not in 1 is 1 is not 1: pass # binary x = 1 & 1 diff --git a/Lib/tokenize.py b/Lib/tokenize.py index a9be4cf..27d566a 100644 --- a/Lib/tokenize.py +++ b/Lib/tokenize.py @@ -77,7 +77,7 @@ String = group(r"[uU]?[rR]?'[^\n'\\]*(?:\\.[^\n'\\]*)*'", # Because of leftmost-then-longest match semantics, be sure to put the # longest operators first (e.g., if = came before ==, == would get # recognized as two instances of =). -Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"<>", r"!=", +Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"!=", r"//=?", r"[+\-*/%&|^=<>]=?", r"~") diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index b9fdd5d..9fd1615 100644 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -627,7 +627,7 @@ def main(): for o, a in opts: if o == '-n': new_win = 1 elif o == '-t': new_win = 2 - if len(args) <> 1: + if len(args) != 1: print >>sys.stderr, usage sys.exit(1) diff --git a/Lib/wsgiref/headers.py b/Lib/wsgiref/headers.py index 934a645..0908f60 100644 --- a/Lib/wsgiref/headers.py +++ b/Lib/wsgiref/headers.py @@ -63,7 +63,7 @@ class Headers: Does *not* raise an exception if the header is missing. """ name = name.lower() - self._headers[:] = [kv for kv in self._headers if kv[0].lower()<>name] + self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] def __getitem__(self,name): """Get the first header value for 'name' diff --git a/Lib/wsgiref/util.py b/Lib/wsgiref/util.py index 17fdff6..450a32f 100644 --- a/Lib/wsgiref/util.py +++ b/Lib/wsgiref/util.py @@ -98,7 +98,7 @@ def shift_path_info(environ): return None path_parts = path_info.split('/') - path_parts[1:-1] = [p for p in path_parts[1:-1] if p and p<>'.'] + path_parts[1:-1] = [p for p in path_parts[1:-1] if p and p != '.'] name = path_parts[1] del path_parts[1] |