mirror of
https://github.com/python/cpython.git
synced 2024-12-11 10:50:11 +08:00
Fix input type for zlib.
This commit is contained in:
parent
8f358aa758
commit
53afa6d239
@ -207,14 +207,14 @@ including: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`zipfile` and
|
||||
:mod:`tarfile`. ::
|
||||
|
||||
>>> import zlib
|
||||
>>> s = 'witch which has which witches wrist watch'
|
||||
>>> s = b'witch which has which witches wrist watch'
|
||||
>>> len(s)
|
||||
41
|
||||
>>> t = zlib.compress(s)
|
||||
>>> len(t)
|
||||
37
|
||||
>>> zlib.decompress(t)
|
||||
'witch which has which witches wrist watch'
|
||||
b'witch which has which witches wrist watch'
|
||||
>>> zlib.crc32(s)
|
||||
226805979
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user