Skip to content

Commit b053cd8

Browse files
committed
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)'.
1 parent 01c77c6 commit b053cd8

36 files changed

+171
-178
lines changed

Grammar/Grammar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ or_test: and_test ('or' and_test)*
9090
and_test: not_test ('and' not_test)*
9191
not_test: 'not' not_test | comparison
9292
comparison: expr (comp_op expr)*
93-
comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not'
93+
comp_op: '<'|'>'|'=='|'>='|'<='|'!='|'in'|'not' 'in'|'is'|'is' 'not'
9494
expr: xor_expr ('|' xor_expr)*
9595
xor_expr: and_expr ('^' and_expr)*
9696
and_expr: shift_expr ('&' shift_expr)*

Lib/bsddb/dbtables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def Modify(self, table, conditions={}, mappings={}):
453453
# error
454454
dataitem = None
455455
dataitem = mappings[column](dataitem)
456-
if dataitem <> None:
456+
if dataitem != None:
457457
self.db.put(
458458
_data_key(table, column, rowid),
459459
dataitem, txn=txn)

Lib/bsddb/test/test_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def do_bthash_test(self, factory, what):
120120
try:
121121
rec = f.next()
122122
except KeyError:
123-
assert rec == f.last(), 'Error, last <> last!'
123+
assert rec == f.last(), 'Error, last != last!'
124124
f.previous()
125125
break
126126
if verbose:

Lib/bsddb/test/test_recno.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def tearDown(self):
3030
try:
3131
os.remove(self.filename)
3232
except OSError, e:
33-
if e.errno <> errno.EEXIST: raise
33+
if e.errno != errno.EEXIST: raise
3434

3535
def test01_basic(self):
3636
d = db.DB()

Lib/bsddb/test/test_thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def setUp(self):
5858
try:
5959
os.mkdir(homeDir)
6060
except OSError, e:
61-
if e.errno <> errno.EEXIST: raise
61+
if e.errno != errno.EEXIST: raise
6262
self.env = db.DBEnv()
6363
self.setEnvOpts()
6464
self.env.open(homeDir, self.envflags | db.DB_CREATE)

Lib/compiler/transformer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ def comparison(self, nodelist):
618618
for i in range(2, len(nodelist), 2):
619619
nl = nodelist[i-1]
620620

621-
# comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '=='
621+
# comp_op: '<' | '>' | '=' | '>=' | '<=' | '!=' | '=='
622622
# | 'in' | 'not' 'in' | 'is' | 'is' 'not'
623623
n = nl[1]
624624
if n[0] == token.NAME:
@@ -1396,7 +1396,7 @@ def get_docstring(self, node, n=None):
13961396
symbol.power,
13971397
]
13981398

1399-
# comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '=='
1399+
# comp_op: '<' | '>' | '=' | '>=' | '<=' | '!=' | '=='
14001400
# | 'in' | 'not' 'in' | 'is' | 'is' 'not'
14011401
_cmp_types = {
14021402
token.LESS : '<',

Lib/email/base64mime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def encode(s, binary=True, maxlinelen=76, eol=NL):
146146
# BAW: should encode() inherit b2a_base64()'s dubious behavior in
147147
# adding a newline to the encoded string?
148148
enc = b2a_base64(s[i:i + max_unencoded])
149-
if enc.endswith(NL) and eol <> NL:
149+
if enc.endswith(NL) and eol != NL:
150150
enc = enc[:-1] + eol
151151
encvec.append(enc)
152152
return EMPTYSTRING.join(encvec)

Lib/email/charset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def get_body_encoding(self):
250250
Returns "base64" if self.body_encoding is BASE64.
251251
Returns "7bit" otherwise.
252252
"""
253-
assert self.body_encoding <> SHORTEST
253+
assert self.body_encoding != SHORTEST
254254
if self.body_encoding == QP:
255255
return 'quoted-printable'
256256
elif self.body_encoding == BASE64:
@@ -260,7 +260,7 @@ def get_body_encoding(self):
260260

261261
def convert(self, s):
262262
"""Convert a string from the input_codec to the output_codec."""
263-
if self.input_codec <> self.output_codec:
263+
if self.input_codec != self.output_codec:
264264
return unicode(s, self.input_codec).encode(self.output_codec)
265265
else:
266266
return s

Lib/email/generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def _handle_multipart(self, msg):
211211
# doesn't preserve newlines/continuations in headers. This is no big
212212
# deal in practice, but turns out to be inconvenient for the unittest
213213
# suite.
214-
if msg.get_boundary() <> boundary:
214+
if msg.get_boundary() != boundary:
215215
msg.set_boundary(boundary)
216216
# If there's a preamble, write it out, with a trailing CRLF
217217
if msg.preamble is not None:

Lib/email/header.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def append(self, s, charset=None, errors='strict'):
248248
elif not isinstance(charset, Charset):
249249
charset = Charset(charset)
250250
# If the charset is our faux 8bit charset, leave the string unchanged
251-
if charset <> '8bit':
251+
if charset != '8bit':
252252
# We need to test that the string can be converted to unicode and
253253
# back to a byte string, given the input and output codecs of the
254254
# charset.
@@ -454,7 +454,7 @@ def _split_ascii(s, firstlen, restlen, continuation_ws, splitchars):
454454
# If this part is longer than maxlen and we aren't already
455455
# splitting on whitespace, try to recursively split this line
456456
# on whitespace.
457-
if partlen > maxlen and ch <> ' ':
457+
if partlen > maxlen and ch != ' ':
458458
subl = _split_ascii(part, maxlen, restlen,
459459
continuation_ws, ' ')
460460
lines.extend(subl[:-1])

0 commit comments

Comments
 (0)