[Python-3000-checkins] r51639 - in python/branches/p3yk: 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
neal.norwitz
python-3000-checkins at python.org
Tue Aug 29 06:39:16 CEST 2006
Author: neal.norwitz
Date: Tue Aug 29 06:39:12 2006
New Revision: 51639
Modified:
python/branches/p3yk/Demo/rpc/nfsclient.py
python/branches/p3yk/Demo/rpc/xdr.py
python/branches/p3yk/Demo/scripts/lpwatch.py
python/branches/p3yk/Demo/scripts/primes.py
python/branches/p3yk/Demo/scripts/update.py
python/branches/p3yk/Demo/sockets/gopher.py
python/branches/p3yk/Demo/tkinter/guido/ShellWindow.py
python/branches/p3yk/Doc/lib/email-unpack.py
python/branches/p3yk/Doc/lib/libstdtypes.tex
python/branches/p3yk/Doc/lib/libstdwin.tex
python/branches/p3yk/Doc/ref/ref2.tex
python/branches/p3yk/Doc/ref/ref3.tex
python/branches/p3yk/Doc/ref/ref5.tex
python/branches/p3yk/Misc/cheatsheet
python/branches/p3yk/Misc/python-mode.el
python/branches/p3yk/Objects/object.c
Log:
Get rid of most of the remaining uses of <>. There's still Tools/* thogh.
Modified: python/branches/p3yk/Demo/rpc/nfsclient.py
==============================================================================
--- python/branches/p3yk/Demo/rpc/nfsclient.py (original)
+++ python/branches/p3yk/Demo/rpc/nfsclient.py Tue Aug 29 06:39:12 2006
@@ -163,7 +163,7 @@
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
Modified: python/branches/p3yk/Demo/rpc/xdr.py
==============================================================================
--- python/branches/p3yk/Demo/rpc/xdr.py (original)
+++ python/branches/p3yk/Demo/rpc/xdr.py Tue Aug 29 06:39:12 2006
@@ -78,7 +78,7 @@
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 @@
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)
Modified: python/branches/p3yk/Demo/scripts/lpwatch.py
==============================================================================
--- python/branches/p3yk/Demo/scripts/lpwatch.py (original)
+++ python/branches/p3yk/Demo/scripts/lpwatch.py Tue Aug 29 06:39:12 2006
@@ -74,7 +74,7 @@
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 @@
#
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],)
Modified: python/branches/p3yk/Demo/scripts/primes.py
==============================================================================
--- python/branches/p3yk/Demo/scripts/primes.py (original)
+++ python/branches/p3yk/Demo/scripts/primes.py Tue Aug 29 06:39:12 2006
@@ -18,7 +18,7 @@
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
Modified: python/branches/p3yk/Demo/scripts/update.py
==============================================================================
--- python/branches/p3yk/Demo/scripts/update.py (original)
+++ python/branches/p3yk/Demo/scripts/update.py Tue Aug 29 06:39:12 2006
@@ -83,7 +83,7 @@
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:])
Modified: python/branches/p3yk/Demo/sockets/gopher.py
==============================================================================
--- python/branches/p3yk/Demo/sockets/gopher.py (original)
+++ python/branches/p3yk/Demo/sockets/gopher.py Tue Aug 29 06:39:12 2006
@@ -246,7 +246,7 @@
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:
Modified: python/branches/p3yk/Demo/tkinter/guido/ShellWindow.py
==============================================================================
--- python/branches/p3yk/Demo/tkinter/guido/ShellWindow.py (original)
+++ python/branches/p3yk/Demo/tkinter/guido/ShellWindow.py Tue Aug 29 06:39:12 2006
@@ -115,11 +115,11 @@
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:
Modified: python/branches/p3yk/Doc/lib/email-unpack.py
==============================================================================
--- python/branches/p3yk/Doc/lib/email-unpack.py (original)
+++ python/branches/p3yk/Doc/lib/email-unpack.py Tue Aug 29 06:39:12 2006
@@ -37,7 +37,7 @@
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)
Modified: python/branches/p3yk/Doc/lib/libstdtypes.tex
==============================================================================
--- python/branches/p3yk/Doc/lib/libstdtypes.tex (original)
+++ python/branches/p3yk/Doc/lib/libstdtypes.tex Tue Aug 29 06:39:12 2006
@@ -126,8 +126,7 @@
\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 @@
\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).
Modified: python/branches/p3yk/Doc/lib/libstdwin.tex
==============================================================================
--- python/branches/p3yk/Doc/lib/libstdwin.tex (original)
+++ python/branches/p3yk/Doc/lib/libstdwin.tex Tue Aug 29 06:39:12 2006
@@ -123,8 +123,8 @@
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:
Modified: python/branches/p3yk/Doc/ref/ref2.tex
==============================================================================
--- python/branches/p3yk/Doc/ref/ref2.tex (original)
+++ python/branches/p3yk/Doc/ref/ref2.tex Tue Aug 29 06:39:12 2006
@@ -689,13 +689,9 @@
\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}}
Modified: python/branches/p3yk/Doc/ref/ref3.tex
==============================================================================
--- python/branches/p3yk/Doc/ref/ref3.tex (original)
+++ python/branches/p3yk/Doc/ref/ref3.tex Tue Aug 29 06:39:12 2006
@@ -1243,8 +1243,7 @@
\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
Modified: python/branches/p3yk/Doc/ref/ref5.tex
==============================================================================
--- python/branches/p3yk/Doc/ref/ref5.tex (original)
+++ python/branches/p3yk/Doc/ref/ref5.tex Tue Aug 29 06:39:12 2006
@@ -832,7 +832,7 @@
\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 @@
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 @@
\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}
Modified: python/branches/p3yk/Misc/cheatsheet
==============================================================================
--- python/branches/p3yk/Misc/cheatsheet (original)
+++ python/branches/p3yk/Misc/cheatsheet Tue Aug 29 06:39:12 2006
@@ -215,7 +215,6 @@
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 @@
> 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 @@
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',
Modified: python/branches/p3yk/Misc/python-mode.el
==============================================================================
--- python/branches/p3yk/Misc/python-mode.el (original)
+++ python/branches/p3yk/Misc/python-mode.el Tue Aug 29 06:39:12 2006
@@ -690,8 +690,6 @@
;; 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)
Modified: python/branches/p3yk/Objects/object.c
==============================================================================
--- python/branches/p3yk/Objects/object.c (original)
+++ python/branches/p3yk/Objects/object.c Tue Aug 29 06:39:12 2006
@@ -591,7 +591,7 @@
/* 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;
More information about the Python-3000-checkins
mailing list