Fix input type for zlib.

This commit is contained in:
Georg Brandl 2010-11-30 08:20:16 +00:00
parent 8f358aa758
commit 53afa6d239
1 changed files with 2 additions and 2 deletions

View File

@ -207,14 +207,14 @@ including: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`zipfile` and
:mod:`tarfile`. :: :mod:`tarfile`. ::
>>> import zlib >>> import zlib
>>> s = 'witch which has which witches wrist watch' >>> s = b'witch which has which witches wrist watch'
>>> len(s) >>> len(s)
41 41
>>> t = zlib.compress(s) >>> t = zlib.compress(s)
>>> len(t) >>> len(t)
37 37
>>> zlib.decompress(t) >>> zlib.decompress(t)
'witch which has which witches wrist watch' b'witch which has which witches wrist watch'
>>> zlib.crc32(s) >>> zlib.crc32(s)
226805979 226805979