[Python-3000-checkins] r58079 - in python/branches/py3k/Doc: howto/curses.rst library/cgi.rst library/logging.rst library/smtplib.rst library/socket.rst

collin.winter python-3000-checkins at python.org
Mon Sep 10 02:49:58 CEST 2007


Author: collin.winter
Date: Mon Sep 10 02:49:57 2007
New Revision: 58079

Modified:
   python/branches/py3k/Doc/howto/curses.rst
   python/branches/py3k/Doc/library/cgi.rst
   python/branches/py3k/Doc/library/logging.rst
   python/branches/py3k/Doc/library/smtplib.rst
   python/branches/py3k/Doc/library/socket.rst
Log:
Change instances of 'while 1:' in the docs into 'while True:'.

Modified: python/branches/py3k/Doc/howto/curses.rst
==============================================================================
--- python/branches/py3k/Doc/howto/curses.rst	(original)
+++ python/branches/py3k/Doc/howto/curses.rst	Mon Sep 10 02:49:57 2007
@@ -377,7 +377,7 @@
 :const:`curses.KEY_HOME`, or :const:`curses.KEY_LEFT`.  Usually the main loop of
 your program will look something like this::
 
-   while 1:
+   while True:
        c = stdscr.getch()
        if c == ord('p'): PrintDocument()
        elif c == ord('q'): break  # Exit the while()

Modified: python/branches/py3k/Doc/library/cgi.rst
==============================================================================
--- python/branches/py3k/Doc/library/cgi.rst	(original)
+++ python/branches/py3k/Doc/library/cgi.rst	Mon Sep 10 02:49:57 2007
@@ -142,7 +142,7 @@
    if fileitem.file:
        # It's an uploaded file; count lines
        linecount = 0
-       while 1:
+       while True:
            line = fileitem.file.readline()
            if not line: break
            linecount = linecount + 1

Modified: python/branches/py3k/Doc/library/logging.rst
==============================================================================
--- python/branches/py3k/Doc/library/logging.rst	(original)
+++ python/branches/py3k/Doc/library/logging.rst	Mon Sep 10 02:49:57 2007
@@ -783,7 +783,7 @@
            followed by the LogRecord in pickle format. Logs the record
            according to whatever policy is configured locally.
            """
-           while 1:
+           while True:
                chunk = self.connection.recv(4)
                if len(chunk) < 4:
                    break

Modified: python/branches/py3k/Doc/library/smtplib.rst
==============================================================================
--- python/branches/py3k/Doc/library/smtplib.rst	(original)
+++ python/branches/py3k/Doc/library/smtplib.rst	Mon Sep 10 02:49:57 2007
@@ -322,7 +322,7 @@
    # Add the From: and To: headers at the start!
    msg = ("From: %s\r\nTo: %s\r\n\r\n"
           % (fromaddr, ", ".join(toaddrs)))
-   while 1:
+   while True:
        try:
            line = raw_input()
        except EOFError:

Modified: python/branches/py3k/Doc/library/socket.rst
==============================================================================
--- python/branches/py3k/Doc/library/socket.rst	(original)
+++ python/branches/py3k/Doc/library/socket.rst	Mon Sep 10 02:49:57 2007
@@ -734,7 +734,7 @@
    s.listen(1)
    conn, addr = s.accept()
    print('Connected by', addr)
-   while 1:
+   while True:
        data = conn.recv(1024)
        if not data: break
        conn.send(data)
@@ -788,7 +788,7 @@
        sys.exit(1)
    conn, addr = s.accept()
    print('Connected by', addr)
-   while 1:
+   while True:
        data = conn.recv(1024)
        if not data: break
        conn.send(data)


More information about the Python-3000-checkins mailing list