]> granicus.if.org Git - python/commitdiff
Get rid of most of the remaining uses of <>. There's still Tools/* thogh.
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 29 Aug 2006 04:39:12 +0000 (04:39 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 29 Aug 2006 04:39:12 +0000 (04:39 +0000)
16 files changed:
Demo/rpc/nfsclient.py
Demo/rpc/xdr.py
Demo/scripts/lpwatch.py
Demo/scripts/primes.py
Demo/scripts/update.py
Demo/sockets/gopher.py
Demo/tkinter/guido/ShellWindow.py
Doc/lib/email-unpack.py
Doc/lib/libstdtypes.tex
Doc/lib/libstdwin.tex
Doc/ref/ref2.tex
Doc/ref/ref3.tex
Doc/ref/ref5.tex
Misc/cheatsheet
Misc/python-mode.el
Objects/object.c

index c4387b4a02be414ab955ed5f06a87ce222214570..8e5a199c6d2a838ac745f65661029d2f61e77779 100644 (file)
@@ -163,7 +163,7 @@ class NFSClient(UDPClient):
         ra = (dir, 0, 2000)
         while 1:
             (status, rest) = self.Readdir(ra)
-            if status <> NFS_OK:
+            if status != NFS_OK:
                 break
             entries, eof = rest
             last_cookie = None
index df5cbafd05541d6d868f4cb764b54fb7927769be..e03b352db12bf50f05b1ce05064fe1a94889ea2e 100644 (file)
@@ -78,7 +78,7 @@ class Packer:
         self.pack_uint(0)
 
     def pack_farray(self, n, list, pack_item):
-        if len(list) <> n:
+        if len(list) != n:
             raise ValueError, 'wrong array size'
         for item in list:
             pack_item(item)
@@ -183,7 +183,7 @@ class Unpacker:
         while 1:
             x = self.unpack_uint()
             if x == 0: break
-            if x <> 1:
+            if x != 1:
                 raise RuntimeError, '0 or 1 expected, got %r' % (x, )
             item = unpack_item()
             list.append(item)
index 8887dee7d3b08e65ac170ebbdc1a91175af48605..c3dcb34691404677078cae2800a442c7845efaf6 100755 (executable)
@@ -74,7 +74,7 @@ def makestatus(name, thisuser):
             ubytes = ubytes + bytes
             users[user] = ujobs, ubytes
         else:
-            if fields and fields[0] <> 'Rank':
+            if fields and fields[0] != 'Rank':
                 line = string.strip(line)
                 if line == 'no entries':
                     line = name + ': idle'
@@ -84,7 +84,7 @@ def makestatus(name, thisuser):
     #
     if totaljobs:
         line = '%d K' % ((totalbytes+1023)/1024)
-        if totaljobs <> len(users):
+        if totaljobs != len(users):
             line = line + ' (%d jobs)' % totaljobs
         if len(users) == 1:
             line = line + ' for %s' % (users.keys()[0],)
index 5935a3c84a82d83a2789cdf1c2ff40d3a2c7a5d1..8762fe28f7f59e443ad9d8bc99a71b524f28e910 100755 (executable)
@@ -18,7 +18,7 @@ def primes(min, max):
     while i <= max:
         for p in primes:
             if i%p == 0 or p*p > i: break
-        if i%p <> 0:
+        if i%p != 0:
             primes.append(i)
             if i >= min: print i
         i = i+2
index c9360260e37a53a233506ecf78a45c839a24fdae..eac1a2280e896c706a738577e077101de2f1bea5 100755 (executable)
@@ -83,7 +83,7 @@ def main():
             print 'Funny line:', line,
             continue
         filename, lineno = prog.group(1, 2)
-        if not curfile or filename <> curfile.filename:
+        if not curfile or filename != curfile.filename:
             if curfile: curfile.finish()
             curfile = FileObj(filename)
         curfile.process(lineno, line[n:])
index 2488c8129a1043e75e26e2374955c45fc451592b..2c46da621b6197e92a74ca512757c63d4bb5281b 100755 (executable)
@@ -246,7 +246,7 @@ def browse_search(selector, host, port):
 def browse_telnet(selector, host, port):
     if selector:
         print 'Log in as', repr(selector)
-    if type(port) <> type(''):
+    if type(port) != type(''):
         port = repr(port)
     sts = os.system('set -x; exec telnet ' + host + ' ' + port)
     if sts:
index 6cdce0b4ef93273f21fd69c842ad1d6d218cae8c..104e06d167df6854af6e9d76781e3554fc74171f 100755 (executable)
@@ -115,11 +115,11 @@ def spawn(prog, args):
                 os.close(i)
             except os.error:
                 pass
-        if os.dup(p2cread) <> 0:
+        if os.dup(p2cread) != 0:
             sys.stderr.write('popen2: bad read dup\n')
-        if os.dup(c2pwrite) <> 1:
+        if os.dup(c2pwrite) != 1:
             sys.stderr.write('popen2: bad write dup\n')
-        if os.dup(c2pwrite) <> 2:
+        if os.dup(c2pwrite) != 2:
             sys.stderr.write('popen2: bad write dup\n')
         for i in range(3, MAXFD):
             try:
index fc05d99109d26222873f084c0143e5dd75310969..fb03e58e9eeb273df0de9994e2d87806baa96d4a 100644 (file)
@@ -37,7 +37,7 @@ Usage: %prog [options] msgfile
         os.mkdir(opts.directory)
     except OSError, e:
         # Ignore directory exists error
-        if e.errno <> errno.EEXIST:
+        if e.errno != errno.EEXIST:
             raise
 
     fp = open(msgfile)
index 95b06f8c7cc3e8671bb545bd4d27aec87af5c81e..e1993aa36df9405cabb5cd994f25c97a29bd25cf 100644 (file)
@@ -126,8 +126,7 @@ This table summarizes the comparison operations:
   \lineiii{>}{strictly greater than}{}
   \lineiii{>=}{greater than or equal}{}
   \lineiii{==}{equal}{}
-  \lineiii{!=}{not equal}{(1)}
-  \lineiii{<>}{not equal}{(1)}
+  \lineiii{!=}{not equal}
   \lineiii{is}{object identity}{}
   \lineiii{is not}{negated object identity}{}
 \end{tableiii}
@@ -136,17 +135,6 @@ This table summarizes the comparison operations:
 \opindex{is}
 \opindex{is not}
 
-\noindent
-Notes:
-
-\begin{description}
-
-\item[(1)]
-\code{<>} and \code{!=} are alternate spellings for the same operator.
-\code{!=} is the preferred spelling; \code{<>} is obsolescent.
-
-\end{description}
-
 Objects of different types, except different numeric types and different string types, never
 compare equal; such objects are ordered consistently but arbitrarily
 (so that sorting a heterogeneous array yields a consistent result).
index 84aad2f48e1fd835570a3ca3a289fd132e7fda22..f2278e583bfbf22339e360dc5ad884c7e19f858a 100644 (file)
@@ -123,8 +123,8 @@ Return the default foreground color for unknown color names.
 Hint: the following code tests whether you are on a machine that
 supports more than two colors:
 \begin{verbatim}
-if stdwin.fetchcolor('black') <> \
-          stdwin.fetchcolor('red') <> \
+if stdwin.fetchcolor('black') != \
+          stdwin.fetchcolor('red') != \
           stdwin.fetchcolor('white'):
     print 'color machine'
 else:
index bad4609fb324d1b220fc93fcee669d79a6a636db..f82d9ce1cf22bb258e040e2eab60105c71bd5504 100644 (file)
@@ -689,13 +689,9 @@ The following tokens are operators:
 \begin{verbatim}
 +       -       *       **      /       //      %
 <<      >>      &       |       ^       ~
-<       >       <=      >=      ==      !=      <>
+<       >       <=      >=      ==      !=
 \end{verbatim}
 
-The comparison operators \code{<>} and \code{!=} are alternate
-spellings of the same operator.  \code{!=} is the preferred spelling;
-\code{<>} is obsolescent.
-
 
 \section{Delimiters\label{delimiters}}
 
index f53dbe36ee4bc125e3c55c3aab7f48901d1030e8..362d7697595478631b88cae8d4ad922eefc5c66c 100644 (file)
@@ -1243,8 +1243,7 @@ follows:
 \code{\var{x}<\var{y}} calls \code{\var{x}.__lt__(\var{y})},
 \code{\var{x}<=\var{y}} calls \code{\var{x}.__le__(\var{y})},
 \code{\var{x}==\var{y}} calls \code{\var{x}.__eq__(\var{y})},
-\code{\var{x}!=\var{y}} and \code{\var{x}<>\var{y}} call
-\code{\var{x}.__ne__(\var{y})},
+\code{\var{x}!=\var{y}} calls \code{\var{x}.__ne__(\var{y})},
 \code{\var{x}>\var{y}} calls \code{\var{x}.__gt__(\var{y})}, and
 \code{\var{x}>=\var{y}} calls \code{\var{x}.__ge__(\var{y})}.
 These methods can return any value, but if the comparison operator is
index 52bb57f68537e6ecf1e8e8b62b79e0e683c81087..34a827cfcc2b4d35880654f93b2ca877f127186c 100644 (file)
@@ -832,7 +832,7 @@ interpretation that is conventional in mathematics:
   \production{comparison}
              {\token{or_expr} ( \token{comp_operator} \token{or_expr} )*}
   \production{comp_operator}
-             {"<" | ">" | "==" | ">=" | "<=" | "<>" | "!="}
+             {"<" | ">" | "==" | ">=" | "<=" | "!="}
   \productioncont{| "is" ["not"] | ["not"] "in"}
 \end{productionlist}
 
@@ -854,11 +854,6 @@ Note that \var{a opa b opb c} doesn't imply any kind of comparison
 between \var{a} and \var{c}, so that, e.g., \code{x < y > z} is
 perfectly legal (though perhaps not pretty).
 
-The forms \code{<>} and \code{!=} are equivalent; for consistency with
-C, \code{!=} is preferred; where \code{!=} is mentioned below
-\code{<>} is also accepted.  The \code{<>} spelling is considered
-obsolescent.
-
 The operators \code{<}, \code{>}, \code{==}, \code{>=}, \code{<=}, and
 \code{!=} compare
 the values of two objects.  The objects need not have the same type.
@@ -1111,7 +1106,7 @@ have the same precedence and chain from left to right --- see section
     \lineii{\keyword{in}, \keyword{not} \keyword{in}}{Membership tests}
     \lineii{\keyword{is}, \keyword{is not}}{Identity tests}
     \lineii{\code{<}, \code{<=}, \code{>}, \code{>=},
-            \code{<>}, \code{!=}, \code{==}}
+            \code{!=}, \code{==}}
           {Comparisons}
   \hline
     \lineii{\code{|}}                          {Bitwise OR}
index bab109a8ab43e001c9d9fc828f2042ed7772e1fe..de5586964f4f96d2b23ab939b270333d930a7cd5 100644 (file)
@@ -215,7 +215,6 @@ Highest             Operator                             Comment
         x^y                               Bitwise exclusive or
         x|y                               Bitwise or
         x<y  x<=y  x>y  x>=y  x==y x!=y   Comparison,
-        x<>y                              identity,
         x is y   x is not y               membership
         x in s   x not in s
         not x                             boolean negation
@@ -241,7 +240,7 @@ Comparison         Meaning          Notes
 >          strictly greater than
 >=         greater than or equal to
 ==         equal to
-!= or <>   not equal to
+!=         not equal to
 is         object identity           (2)
 is not     negated object identity   (2)
 
@@ -1009,9 +1008,8 @@ reload(module)      after fixing it. If module was syntacticallycorrect but had
                     an error in initialization, mustimport it one more time
                     before calling reload().
                     Returns a string containing a printable and if possible
-repr(object)        evaluable representation of an object. <=> `object`
-                    (usingbackquotes). Class redefinissable (__repr__). See
-                    also str()
+repr(object)        evaluable representation of an object. 
+                    Class redefinable (__repr__). See also str().
 round(x, n=0)       Returns the floating point value x rounded to n digitsafter
                     the decimal point.
 setattr(object,     This is the counterpart of getattr().setattr(o, 'foobar',
index 5f50da8add538fe30139cef954abd9690c49ad5d..e70a613da845e7b42741c71fac0b9fec655d8ac4 100644 (file)
@@ -690,8 +690,6 @@ prospect as debugging continues.")
   ;; Both single quote and double quote are string delimiters
   (modify-syntax-entry ?\' "\"" py-mode-syntax-table)
   (modify-syntax-entry ?\" "\"" py-mode-syntax-table)
-  ;; backquote is open and close paren
-  (modify-syntax-entry ?\` "$"  py-mode-syntax-table)
   ;; comment delimiters
   (modify-syntax-entry ?\# "<"  py-mode-syntax-table)
   (modify-syntax-entry ?\n ">"  py-mode-syntax-table)
index 9bcf08b39b068bee5b6dea7d7249a00644de5255..4fee2f02feb1e1abee7686183786ee126a050869 100644 (file)
@@ -591,7 +591,7 @@ do_compare(PyObject *v, PyObject *w)
 
        /* Give up */
        PyErr_Format(PyExc_TypeError,
-                    "unorderable types: '%.100s' <> '%.100s'",
+                    "unorderable types: '%.100s' != '%.100s'",
                     v->ob_type->tp_name,
                     w->ob_type->tp_name);
        return -1;