[Python-checkins] r84343 - peps/trunk/pep-0333.txt

florent.xicluna python-checkins at python.org
Sat Aug 28 20:08:15 CEST 2010


Author: florent.xicluna
Date: Sat Aug 28 20:08:15 2010
New Revision: 84343

Log:
Use new-style classes in examples.  Fix typos.

Modified:
   peps/trunk/pep-0333.txt

Modified: peps/trunk/pep-0333.txt
==============================================================================
--- peps/trunk/pep-0333.txt	(original)
+++ peps/trunk/pep-0333.txt	Sat Aug 28 20:08:15 2010
@@ -172,7 +172,7 @@
         return ['Hello world!\n']
 
 
-    class AppClass:
+    class AppClass(object):
         """Produce the same output, but using a class
 
         (Note: 'AppClass' is the "application" here, so calling it
@@ -321,7 +321,7 @@
 
     from piglatin import piglatin
 
-    class LatinIter:
+    class LatinIter(object):
 
         """Transform iterated output to piglatin, if it's okay to do so
 
@@ -345,7 +345,7 @@
             else:
                 return self._next()
 
-    class Latinator:
+    class Latinator(object):
 
         # by default, don't transform output
         transform = False
@@ -360,7 +360,7 @@
             def start_latin(status, response_headers, exc_info=None):
 
                 # Reset ok flag, in case this is a repeat call
-                transform_ok[:] = []
+                del transform_ok[:]
 
                 for name, value in response_headers:
                     if name.lower() == 'content-type' and value == 'text/plain':
@@ -368,7 +368,7 @@
                         # Strip content-length if present, else it'll be wrong
                         response_headers = [(name, value)
                             for name, value in response_headers
-                                if name.lower() <> 'content-length'
+                                if name.lower() != 'content-length'
                         ]
                         break
 
@@ -1305,7 +1305,7 @@
 
 * You may not return a file object and expect it to work as an iterable,
   since before Python 2.2, files were not iterable.  (In general, you
-  shouldn't do this anyway, because it will peform quite poorly most
+  shouldn't do this anyway, because it will perform quite poorly most
   of the time!)  Use ``wsgi.file_wrapper`` or an application-specific
   file wrapper class.  (See `Optional Platform-Specific File Handling`_
   for more on ``wsgi.file_wrapper``, and an example class you can use
@@ -1371,7 +1371,7 @@
 
 Apart from the handling of ``close()``, the semantics of returning a
 file wrapper from the application should be the same as if the
-application had returned ``iter(filelike.read, '')``.  In other words,
+application had returned ``iter(filelike, '')``.  In other words,
 transmission should begin at the current position within the "file"
 at the time that transmission begins, and continue until the end is
 reached.
@@ -1390,7 +1390,7 @@
 are portable across platforms.  Here's a simple platform-agnostic
 file wrapper class, suitable for old (pre 2.2) and new Pythons alike::
 
-    class FileWrapper:
+    class FileWrapper(object):
 
         def __init__(self, filelike, blksize=8192):
             self.filelike = filelike
@@ -1581,7 +1581,7 @@
   streams.
 
 * Optional extensions are being discussed for pausing iteration of an
-  application's ouptut until input is available or until a callback
+  application's output until input is available or until a callback
   occurs.
 
 * Add a section about synchronous vs. asynchronous apps and servers,


More information about the Python-checkins mailing list