Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3bd844e

Browse files
committed
Get rid of most of the remaining uses of <>. There's still Tools/* thogh.
1 parent c4996ba commit 3bd844e

16 files changed

Lines changed: 23 additions & 49 deletions

File tree

Demo/rpc/nfsclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def Listdir(self, dir):
163163
ra = (dir, 0, 2000)
164164
while 1:
165165
(status, rest) = self.Readdir(ra)
166-
if status <> NFS_OK:
166+
if status != NFS_OK:
167167
break
168168
entries, eof = rest
169169
last_cookie = None

Demo/rpc/xdr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def pack_list(self, list, pack_item):
7878
self.pack_uint(0)
7979

8080
def pack_farray(self, n, list, pack_item):
81-
if len(list) <> n:
81+
if len(list) != n:
8282
raise ValueError, 'wrong array size'
8383
for item in list:
8484
pack_item(item)
@@ -183,7 +183,7 @@ def unpack_list(self, unpack_item):
183183
while 1:
184184
x = self.unpack_uint()
185185
if x == 0: break
186-
if x <> 1:
186+
if x != 1:
187187
raise RuntimeError, '0 or 1 expected, got %r' % (x, )
188188
item = unpack_item()
189189
list.append(item)

Demo/scripts/lpwatch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def makestatus(name, thisuser):
7474
ubytes = ubytes + bytes
7575
users[user] = ujobs, ubytes
7676
else:
77-
if fields and fields[0] <> 'Rank':
77+
if fields and fields[0] != 'Rank':
7878
line = string.strip(line)
7979
if line == 'no entries':
8080
line = name + ': idle'
@@ -84,7 +84,7 @@ def makestatus(name, thisuser):
8484
#
8585
if totaljobs:
8686
line = '%d K' % ((totalbytes+1023)/1024)
87-
if totaljobs <> len(users):
87+
if totaljobs != len(users):
8888
line = line + ' (%d jobs)' % totaljobs
8989
if len(users) == 1:
9090
line = line + ' for %s' % (users.keys()[0],)

Demo/scripts/primes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def primes(min, max):
1818
while i <= max:
1919
for p in primes:
2020
if i%p == 0 or p*p > i: break
21-
if i%p <> 0:
21+
if i%p != 0:
2222
primes.append(i)
2323
if i >= min: print i
2424
i = i+2

Demo/scripts/update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def main():
8383
print 'Funny line:', line,
8484
continue
8585
filename, lineno = prog.group(1, 2)
86-
if not curfile or filename <> curfile.filename:
86+
if not curfile or filename != curfile.filename:
8787
if curfile: curfile.finish()
8888
curfile = FileObj(filename)
8989
curfile.process(lineno, line[n:])

Demo/sockets/gopher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def browse_search(selector, host, port):
246246
def browse_telnet(selector, host, port):
247247
if selector:
248248
print 'Log in as', repr(selector)
249-
if type(port) <> type(''):
249+
if type(port) != type(''):
250250
port = repr(port)
251251
sts = os.system('set -x; exec telnet ' + host + ' ' + port)
252252
if sts:

Demo/tkinter/guido/ShellWindow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ def spawn(prog, args):
115115
os.close(i)
116116
except os.error:
117117
pass
118-
if os.dup(p2cread) <> 0:
118+
if os.dup(p2cread) != 0:
119119
sys.stderr.write('popen2: bad read dup\n')
120-
if os.dup(c2pwrite) <> 1:
120+
if os.dup(c2pwrite) != 1:
121121
sys.stderr.write('popen2: bad write dup\n')
122-
if os.dup(c2pwrite) <> 2:
122+
if os.dup(c2pwrite) != 2:
123123
sys.stderr.write('popen2: bad write dup\n')
124124
for i in range(3, MAXFD):
125125
try:

Doc/lib/email-unpack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def main():
3737
os.mkdir(opts.directory)
3838
except OSError, e:
3939
# Ignore directory exists error
40-
if e.errno <> errno.EEXIST:
40+
if e.errno != errno.EEXIST:
4141
raise
4242

4343
fp = open(msgfile)

Doc/lib/libstdtypes.tex

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ \section{Comparisons \label{comparisons}}
126126
\lineiii{>}{strictly greater than}{}
127127
\lineiii{>=}{greater than or equal}{}
128128
\lineiii{==}{equal}{}
129-
\lineiii{!=}{not equal}{(1)}
130-
\lineiii{<>}{not equal}{(1)}
129+
\lineiii{!=}{not equal}
131130
\lineiii{is}{object identity}{}
132131
\lineiii{is not}{negated object identity}{}
133132
\end{tableiii}
@@ -136,17 +135,6 @@ \section{Comparisons \label{comparisons}}
136135
\opindex{is}
137136
\opindex{is not}
138137

139-
\noindent
140-
Notes:
141-
142-
\begin{description}
143-
144-
\item[(1)]
145-
\code{<>} and \code{!=} are alternate spellings for the same operator.
146-
\code{!=} is the preferred spelling; \code{<>} is obsolescent.
147-
148-
\end{description}
149-
150138
Objects of different types, except different numeric types and different string types, never
151139
compare equal; such objects are ordered consistently but arbitrarily
152140
(so that sorting a heterogeneous array yields a consistent result).

Doc/lib/libstdwin.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ \subsection{Functions Defined in Module \module{stdwin}}
123123
Hint: the following code tests whether you are on a machine that
124124
supports more than two colors:
125125
\begin{verbatim}
126-
if stdwin.fetchcolor('black') <> \
127-
stdwin.fetchcolor('red') <> \
126+
if stdwin.fetchcolor('black') != \
127+
stdwin.fetchcolor('red') != \
128128
stdwin.fetchcolor('white'):
129129
print 'color machine'
130130
else:

0 commit comments

Comments
 (0)