diff options
author | Georg Brandl <georg@python.org> | 2010-01-05 10:22:04 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-01-05 10:22:04 (GMT) |
commit | ede6c2aff6f2bf8842147ca286493e06ac0a99b0 (patch) | |
tree | 6dbb996deb2042c8f3aeb9310923c38a0c6f1257 | |
parent | 7de0a6e04cb935e1665b82804f08457c924c6a5d (diff) | |
download | cpython-ede6c2aff6f2bf8842147ca286493e06ac0a99b0.zip cpython-ede6c2aff6f2bf8842147ca286493e06ac0a99b0.tar.gz cpython-ede6c2aff6f2bf8842147ca286493e06ac0a99b0.tar.bz2 |
Assorted doc fixes by Florent.
-rw-r--r-- | Doc/glossary.rst | 4 | ||||
-rw-r--r-- | Doc/library/binascii.rst | 8 | ||||
-rw-r--r-- | Doc/library/reprlib.rst | 2 | ||||
-rw-r--r-- | Doc/library/stdtypes.rst | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst index a69a0f8..c08c204 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -355,7 +355,7 @@ Glossary list comprehension A compact way to process all or part of the elements in a sequence and - return a list with the results. ``result = ["0x%02x" % x for x in + return a list with the results. ``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` generates a list of strings containing even hex numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is optional. If omitted, all elements in ``range(256)`` are @@ -471,7 +471,7 @@ Glossary object drops to zero, it is deallocated. Reference counting is generally not visible to Python code, but it is a key element of the :term:`CPython` implementation. The :mod:`sys` module defines a - :func:`getrefcount` function that programmers can call to return the + :func:`~sys.getrefcount` function that programmers can call to return the reference count for a particular object. __slots__ diff --git a/Doc/library/binascii.rst b/Doc/library/binascii.rst index c42f81f..2f7851a 100644 --- a/Doc/library/binascii.rst +++ b/Doc/library/binascii.rst @@ -109,11 +109,11 @@ The :mod:`binascii` module defines the following functions: use as a checksum algorithm, it is not suitable for use as a general hash algorithm. Use as follows:: - print(binascii.crc32("hello world")) + print(binascii.crc32(b"hello world")) # Or, in two pieces: - crc = binascii.crc32("hello") - crc = binascii.crc32(" world", crc) & 0xffffffff - print('crc32 = 0x%08x' % crc) + crc = binascii.crc32(b"hello") + crc = binascii.crc32(b" world", crc) & 0xffffffff + print('crc32 = {:#010x}'.format(crc)) .. note:: To generate the same numeric value across all Python versions and diff --git a/Doc/library/reprlib.rst b/Doc/library/reprlib.rst index b529aca..056c5dc 100644 --- a/Doc/library/reprlib.rst +++ b/Doc/library/reprlib.rst @@ -129,5 +129,5 @@ for file objects could be added:: return repr(obj) aRepr = MyRepr() - print aRepr.repr(sys.stdin) # prints '<stdin>' + print(aRepr.repr(sys.stdin)) # prints '<stdin>' diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index f43b71a..d2fb5f9 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1907,7 +1907,7 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098: .. describe:: iter(d) Return an iterator over the keys of the dictionary. This is a shortcut - for :meth:`iterkeys`. + for ``iter(d.keys())``. .. method:: clear() |