diff Lib/stringold.py @ 559:683edb0c4463 legacy-trunk

New == syntax
author Guido van Rossum <guido@python.org>
date Wed, 01 Jan 1992 19:35:13 +0000
parents 4e3073bb0e3e
children 37905fe1892a
line wrap: on
line diff
--- a/Lib/stringold.py	Wed Jan 01 19:34:47 1992 +0000
+++ b/Lib/stringold.py	Wed Jan 01 19:35:13 1992 +0000
@@ -56,7 +56,7 @@
 	i, n = 0, len(s)
 	while i < n:
 		while i < n and s[i] in whitespace: i = i+1
-		if i = n: break
+		if i == n: break
 		j = i
 		while j < n and s[j] not in whitespace: j = j+1
 		res.append(s[i:j])
@@ -71,7 +71,7 @@
 	nsep = len(sep)
 	i = j = 0
 	while j+nsep <= ns:
-		if s[j:j+nsep] = sep:
+		if s[j:j+nsep] == sep:
 			res.append(s[i:j])
 			i = j = j + nsep
 		else:
@@ -98,7 +98,7 @@
 def index(s, sub):
 	n = len(sub)
 	for i in range(len(s) + 1 - n):
-		if sub = s[i:i+n]: return i
+		if sub == s[i:i+n]: return i
 	raise index_error, (s, sub)
 
 # Convert string to integer
@@ -137,7 +137,7 @@
 # Decadent feature: the argument may be a string or a number
 # (Use of this is deprecated; it should be a string as with ljust c.s.)
 def zfill(x, width):
-	if type(x) = type(''): s = x
+	if type(x) == type(''): s = x
 	else: s = `x`
 	n = len(s)
 	if n >= width: return s