Issue #12646: Add an 'eof' attribute to zlib.Decompress.

This will make it easier to detect truncated input streams.

Also, make zlib's error messages more consistent.
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
index a7b8343..54835e7 100644
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -152,7 +152,7 @@
    compress a set of data that share a common initial prefix.
 
 
-Decompression objects support the following methods, and two attributes:
+Decompression objects support the following methods and attributes:
 
 
 .. attribute:: Decompress.unused_data
@@ -162,13 +162,6 @@
    available.  If the whole bytestring turned out to contain compressed data, this is
    ``b""``, an empty bytes object.
 
-   The only way to determine where a bytestring of compressed data ends is by actually
-   decompressing it.  This means that when compressed data is contained part of a
-   larger file, you can only find the end of it by reading data and feeding it
-   followed by some non-empty bytestring into a decompression object's
-   :meth:`decompress` method until the :attr:`unused_data` attribute is no longer
-   empty.
-
 
 .. attribute:: Decompress.unconsumed_tail
 
@@ -179,6 +172,17 @@
    :meth:`decompress` method call in order to get correct output.
 
 
+.. attribute:: Decompress.eof
+
+   A boolean indicating whether the end of the compressed data stream has been
+   reached.
+
+   This makes it possible to distinguish between a properly-formed compressed
+   stream, and an incomplete or truncated one.
+
+   .. versionadded:: 3.3
+
+
 .. method:: Decompress.decompress(data[, max_length])
 
    Decompress *data*, returning a bytes object containing the uncompressed data