]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 77316 via svnmerge from
authorGeorg Brandl <georg@python.org>
Sun, 4 Jul 2010 17:33:33 +0000 (17:33 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 4 Jul 2010 17:33:33 +0000 (17:33 +0000)
svn+ssh://svn.python.org/python/branches/py3k

........
  r77316 | georg.brandl | 2010-01-05 11:22:04 +0100 (Di, 05 Jan 2010) | 1 line

  Assorted doc fixes by Florent.
........

Doc/glossary.rst
Doc/library/binascii.rst
Doc/library/reprlib.rst
Doc/library/stdtypes.rst

index a05db12028613538ee861f52c29a6d532e11214c..54427206e02f362f5f7434ba76c01b60f4e2067f 100644 (file)
@@ -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
@@ -473,7 +473,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__
index c42f81f717935aada2bed4fa37a850d75b8bc90a..2f7851a0f9fd50fbb80bae08ef29de2de22baa85 100644 (file)
@@ -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
index 17a6ac4506074413cacdb6b3d6a7f1d46429eac9..958ead61a5032c1de420ea66b550135a50308e90 100644 (file)
@@ -130,5 +130,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>'
 
index 2a43b3d68cbce6b0e8630778f033afc042fcc62e..2bbc02042faabbe87efcbb1ad0b1c8a77ce84f81 100644 (file)
@@ -1903,7 +1903,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()