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

phillip.eby python-checkins at python.org
Thu Sep 16 22:00:17 CEST 2010


Author: phillip.eby
Date: Thu Sep 16 22:00:17 2010
New Revision: 84854

Log:
Fix semantic breakage for Python 2.1 (yes, WSGI supports Python 2.1, 
which doesn't have an 'object' type), and the description using 
iter(filelike.read, '') was intentional; changing it broke the
spec.  (I.e., running that portion of the spec would raise TypeError)


Modified:
   peps/trunk/pep-0333.txt

Modified: peps/trunk/pep-0333.txt
==============================================================================
--- peps/trunk/pep-0333.txt	(original)
+++ peps/trunk/pep-0333.txt	Thu Sep 16 22:00:17 2010
@@ -172,7 +172,7 @@
         return ['Hello world!\n']
 
 
-    class AppClass(object):
+    class AppClass:
         """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(object):
+    class LatinIter:
 
         """Transform iterated output to piglatin, if it's okay to do so
 
@@ -345,7 +345,7 @@
             else:
                 return self._next()
 
-    class Latinator(object):
+    class Latinator:
 
         # by default, don't transform output
         transform = False
@@ -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, '')``.  In other words,
+application had returned ``iter(filelike.read, '')``.  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(object):
+    class FileWrapper:
 
         def __init__(self, filelike, blksize=8192):
             self.filelike = filelike


More information about the Python-checkins mailing list