]> granicus.if.org Git - python/commitdiff
Tidy up comments from dd4f7d5c51c7 (zlib compression dictionary support).
authorNadeem Vawda <nadeem.vawda@gmail.com>
Thu, 21 Jun 2012 22:35:57 +0000 (00:35 +0200)
committerNadeem Vawda <nadeem.vawda@gmail.com>
Thu, 21 Jun 2012 22:35:57 +0000 (00:35 +0200)
Lib/test/test_zlib.py
Modules/zlibmodule.c

index 904ac4df614bde75eb600b4538c5b081bfcb716a..d637c2d685e97ef2781b73a0a14b1771efbf0a4b 100644 (file)
@@ -427,24 +427,23 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
 
     def test_dictionary(self):
         h = HAMLET_SCENE
-        # build a simulated dictionary out of the words in HAMLET
+        # Build a simulated dictionary out of the words in HAMLET.
         words = h.split()
         random.shuffle(words)
         zdict = b''.join(words)
-        # use it to compress HAMLET
+        # Use it to compress HAMLET.
         co = zlib.compressobj(zdict=zdict)
         cd = co.compress(h) + co.flush()
-        # verify that it will decompress with the dictionary
+        # Verify that it will decompress with the dictionary.
         dco = zlib.decompressobj(zdict=zdict)
         self.assertEqual(dco.decompress(cd) + dco.flush(), h)
-        # verify that it fails when not given the dictionary
+        # Verify that it fails when not given the dictionary.
         dco = zlib.decompressobj()
         self.assertRaises(zlib.error, dco.decompress, cd)
 
     def test_dictionary_streaming(self):
-        # this is simulating the needs of SPDY to be able to reuse the same
-        #  stream object (with its compression state) between sets of compressed
-        #  headers.
+        # This simulates the reuse of a compressor object for compressing
+        # several separate data streams.
         co = zlib.compressobj(zdict=HAMLET_SCENE)
         do = zlib.decompressobj(zdict=HAMLET_SCENE)
         piece = HAMLET_SCENE[1000:1500]
index 102740b2b0d805cffa2cadf2e4e08c27446e8aa1..a44ed0d19fb5d3b7688f57cb1dcf263dff790ad9 100644 (file)
@@ -619,7 +619,7 @@ PyZlib_objdecompress(compobject *self, PyObject *args)
             RetVal = NULL;
             goto error;
         }
-        /* repeat the call to inflate! */
+        /* Repeat the call to inflate. */
         Py_BEGIN_ALLOW_THREADS
         err = inflate(&(self->zst), Z_SYNC_FLUSH);
         Py_END_ALLOW_THREADS