[Python-checkins] r74624 - in python/branches/release31-maint: Doc/c-api/typeobj.rst Doc/includes/mp_pool.py Doc/includes/shoddy.c Doc/library/_thread.rst Doc/library/codecs.rst Doc/library/ctypes.rst Doc/library/math.rst Doc/library/optparse.rst Doc/library/os.rst Doc/library/signal.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/reference/datamodel.rst Doc/tutorial/classes.rst Doc/tutorial/inputoutput.rst Misc/ACKS Misc/NEWS Objects/listsort.txt Objects/rangeobject.c Tools/pybench/README

georg.brandl python-checkins at python.org
Tue Sep 1 10:13:17 CEST 2009


Author: georg.brandl
Date: Tue Sep 1 10:13:16 2009
New Revision: 74624
Log:
Merged revisions 74613,74615,74619-74620,74622 via svnmerge from 
svn+ssh://svn.python.org/python/branches/py3k
................
 r74613 | georg.brandl | 2009年09月01日 09:34:27 +0200 (Di, 01 Sep 2009) | 1 line
 
 #6814: remove traces of xrange().
................
 r74615 | georg.brandl | 2009年09月01日 09:42:40 +0200 (Di, 01 Sep 2009) | 9 lines
 
 Recorded merge of revisions 74614 via svnmerge from 
 svn+ssh://pythondev@svn.python.org/python/trunk
 
 ........
 r74614 | georg.brandl | 2009年09月01日 09:40:54 +0200 (Di, 01 Sep 2009) | 1 line
 
 #6813: better documentation for numberless string formats.
 ........
................
 r74619 | georg.brandl | 2009年09月01日 10:02:03 +0200 (Di, 01 Sep 2009) | 1 line
 
 #6754: remove old struct member nb_inplace_divide.
................
 r74620 | georg.brandl | 2009年09月01日 10:03:26 +0200 (Di, 01 Sep 2009) | 1 line
 
 #6732: fix return value of module init function in example.
................
 r74622 | georg.brandl | 2009年09月01日 10:11:14 +0200 (Di, 01 Sep 2009) | 73 lines
 
 Merged revisions 74542,74544-74548,74550,74554-74555,74578,74588,74590,74603,74616-74618,74621 via svnmerge from 
 svn+ssh://pythondev@svn.python.org/python/trunk
 
 ........
 r74542 | georg.brandl | 2009年08月23日 23:28:56 +0200 (So, 23 Aug 2009) | 1 line
 
 Restore alphabetic order.
 ........
 r74544 | georg.brandl | 2009年08月24日 19:12:30 +0200 (Mo, 24 Aug 2009) | 1 line
 
 #6775: fix python.org URLs in README.
 ........
 r74545 | georg.brandl | 2009年08月24日 19:14:29 +0200 (Mo, 24 Aug 2009) | 1 line
 
 #6772: mention utf-8 as utf8 alias.
 ........
 r74546 | georg.brandl | 2009年08月24日 19:20:40 +0200 (Mo, 24 Aug 2009) | 1 line
 
 #6725: spell "namespace" consistently.
 ........
 r74547 | georg.brandl | 2009年08月24日 19:22:05 +0200 (Mo, 24 Aug 2009) | 1 line
 
 #6718: fix example.
 ........
 r74548 | georg.brandl | 2009年08月24日 19:24:27 +0200 (Mo, 24 Aug 2009) | 1 line
 
 #6677: mention "deleting" as an alias for removing files.
 ........
 r74550 | georg.brandl | 2009年08月24日 19:48:40 +0200 (Mo, 24 Aug 2009) | 1 line
 
 #6677: note that rmdir only removes empty directories.
 ........
 r74554 | georg.brandl | 2009年08月27日 20:59:02 +0200 (Do, 27 Aug 2009) | 1 line
 
 Typo fix.
 ........
 r74555 | georg.brandl | 2009年08月27日 21:02:43 +0200 (Do, 27 Aug 2009) | 1 line
 
 #6787: reference fix.
 ........
 r74578 | tarek.ziade | 2009年08月29日 15:33:21 +0200 (Sa, 29 Aug 2009) | 1 line
 
 fixed #6801: symmetric_difference_update also accepts pipe
 ........
 r74588 | georg.brandl | 2009年08月30日 10:35:01 +0200 (So, 30 Aug 2009) | 1 line
 
 #6803: fix old name.
 ........
 r74590 | georg.brandl | 2009年08月30日 13:51:53 +0200 (So, 30 Aug 2009) | 1 line
 
 #6801: fix copy-paste oversight.
 ........
 r74603 | georg.brandl | 2009年08月31日 08:38:29 +0200 (Mo, 31 Aug 2009) | 1 line
 
 other -> others where multiple arguments are accepted.
 ........
 r74616 | georg.brandl | 2009年09月01日 09:46:26 +0200 (Di, 01 Sep 2009) | 1 line
 
 #6808: clarification.
 ........
 r74617 | georg.brandl | 2009年09月01日 09:53:37 +0200 (Di, 01 Sep 2009) | 1 line
 
 #6765: hint that log(x, base) is not very sophisticated.
 ........
 r74618 | georg.brandl | 2009年09月01日 10:00:47 +0200 (Di, 01 Sep 2009) | 1 line
 
 #6810: add a link to the section about frame objects instead of just a description where to find it.
 ........
 r74621 | georg.brandl | 2009年09月01日 10:06:03 +0200 (Di, 01 Sep 2009) | 1 line
 
 #6638: fix wrong parameter name and markup a class.
 ........
................
Modified:
 python/branches/release31-maint/ (props changed)
 python/branches/release31-maint/Doc/c-api/typeobj.rst
 python/branches/release31-maint/Doc/includes/mp_pool.py
 python/branches/release31-maint/Doc/includes/shoddy.c
 python/branches/release31-maint/Doc/library/_thread.rst
 python/branches/release31-maint/Doc/library/codecs.rst
 python/branches/release31-maint/Doc/library/ctypes.rst
 python/branches/release31-maint/Doc/library/math.rst
 python/branches/release31-maint/Doc/library/optparse.rst
 python/branches/release31-maint/Doc/library/os.rst
 python/branches/release31-maint/Doc/library/signal.rst
 python/branches/release31-maint/Doc/library/stdtypes.rst
 python/branches/release31-maint/Doc/library/string.rst
 python/branches/release31-maint/Doc/reference/datamodel.rst
 python/branches/release31-maint/Doc/tutorial/classes.rst
 python/branches/release31-maint/Doc/tutorial/inputoutput.rst
 python/branches/release31-maint/Misc/ACKS
 python/branches/release31-maint/Misc/NEWS
 python/branches/release31-maint/Objects/listsort.txt
 python/branches/release31-maint/Objects/rangeobject.c
 python/branches/release31-maint/Tools/pybench/README
Modified: python/branches/release31-maint/Doc/c-api/typeobj.rst
==============================================================================
--- python/branches/release31-maint/Doc/c-api/typeobj.rst	(original)
+++ python/branches/release31-maint/Doc/c-api/typeobj.rst	Tue Sep 1 10:13:16 2009
@@ -1052,7 +1052,6 @@
 binaryfunc nb_inplace_add;
 binaryfunc nb_inplace_subtract;
 binaryfunc nb_inplace_multiply;
- binaryfunc nb_inplace_divide;
 binaryfunc nb_inplace_remainder;
 ternaryfunc nb_inplace_power;
 binaryfunc nb_inplace_lshift;
Modified: python/branches/release31-maint/Doc/includes/mp_pool.py
==============================================================================
--- python/branches/release31-maint/Doc/includes/mp_pool.py	(original)
+++ python/branches/release31-maint/Doc/includes/mp_pool.py	Tue Sep 1 10:13:16 2009
@@ -98,17 +98,17 @@
 
 t = time.time()
 A = list(map(pow3, range(N)))
- print('\tmap(pow3, xrange(%d)):\n\t\t%s seconds' % \
+ print('\tmap(pow3, range(%d)):\n\t\t%s seconds' % \
 (N, time.time() - t))
 
 t = time.time()
 B = pool.map(pow3, range(N))
- print('\tpool.map(pow3, xrange(%d)):\n\t\t%s seconds' % \
+ print('\tpool.map(pow3, range(%d)):\n\t\t%s seconds' % \
 (N, time.time() - t))
 
 t = time.time()
 C = list(pool.imap(pow3, range(N), chunksize=N//8))
- print('\tlist(pool.imap(pow3, xrange(%d), chunksize=%d)):\n\t\t%s' \
+ print('\tlist(pool.imap(pow3, range(%d), chunksize=%d)):\n\t\t%s' \
 ' seconds' % (N, N//8, time.time() - t))
 
 assert A == B == C, (len(A), len(B), len(C))
Modified: python/branches/release31-maint/Doc/includes/shoddy.c
==============================================================================
--- python/branches/release31-maint/Doc/includes/shoddy.c	(original)
+++ python/branches/release31-maint/Doc/includes/shoddy.c	Tue Sep 1 10:13:16 2009
@@ -95,4 +95,5 @@
 
 Py_INCREF(&ShoddyType);
 PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType);
+ return m;
 }
Modified: python/branches/release31-maint/Doc/library/_thread.rst
==============================================================================
--- python/branches/release31-maint/Doc/library/_thread.rst	(original)
+++ python/branches/release31-maint/Doc/library/_thread.rst	Tue Sep 1 10:13:16 2009
@@ -147,7 +147,7 @@
 module is available, interrupts always go to the main thread.)
 
 * Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is
- equivalent to calling :func:`exit`.
+ equivalent to calling :func:`_thread.exit`.
 
 * Not all built-in functions that may block waiting for I/O allow other threads
 to run. (The most popular ones (:func:`time.sleep`, :meth:`file.read`,
Modified: python/branches/release31-maint/Doc/library/codecs.rst
==============================================================================
--- python/branches/release31-maint/Doc/library/codecs.rst	(original)
+++ python/branches/release31-maint/Doc/library/codecs.rst	Tue Sep 1 10:13:16 2009
@@ -891,7 +891,8 @@
 name, together with a few common aliases, and the languages for which the
 encoding is likely used. Neither the list of aliases nor the list of languages
 is meant to be exhaustive. Notice that spelling alternatives that only differ in
-case or use a hyphen instead of an underscore are also valid aliases.
+case or use a hyphen instead of an underscore are also valid aliases; therefore,
+e.g. ``'utf-8'`` is a valid alias for the ``'utf_8'`` codec.
 
 Many of the character sets support the same languages. They vary in individual
 characters (e.g. whether the EURO SIGN is supported or not), and in the
Modified: python/branches/release31-maint/Doc/library/ctypes.rst
==============================================================================
--- python/branches/release31-maint/Doc/library/ctypes.rst	(original)
+++ python/branches/release31-maint/Doc/library/ctypes.rst	Tue Sep 1 10:13:16 2009
@@ -1592,7 +1592,7 @@
 The returned function prototype creates functions that use the standard C
 calling convention. The function will release the GIL during the call. If
 *use_errno* is set to True, the ctypes private copy of the system
- :data:`errno` variable is exchanged with the real :data:`errno` value bafore
+ :data:`errno` variable is exchanged with the real :data:`errno` value before
 and after the call; *use_last_error* does the same for the Windows error
 code.
 
Modified: python/branches/release31-maint/Doc/library/math.rst
==============================================================================
--- python/branches/release31-maint/Doc/library/math.rst	(original)
+++ python/branches/release31-maint/Doc/library/math.rst	Tue Sep 1 10:13:16 2009
@@ -150,8 +150,10 @@
 
 .. function:: log(x[, base])
 
- Return the logarithm of *x* to the given *base*. If the *base* is not specified,
- return the natural logarithm of *x* (that is, the logarithm to base *e*).
+ With one argument, return the natural logarithm of *x* (to base *e*).
+
+ With two arguments, return the logarithm of *x* to the given *base*,
+ calculated as ``log(x)/log(base)``.
 
 
 .. function:: log1p(x)
@@ -162,7 +164,8 @@
 
 .. function:: log10(x)
 
- Return the base-10 logarithm of *x*.
+ Return the base-10 logarithm of *x*. This is usually more accurate
+ than ``log(x, 10)``.
 
 
 .. function:: pow(x, y)
Modified: python/branches/release31-maint/Doc/library/optparse.rst
==============================================================================
--- python/branches/release31-maint/Doc/library/optparse.rst	(original)
+++ python/branches/release31-maint/Doc/library/optparse.rst	Tue Sep 1 10:13:16 2009
@@ -1166,19 +1166,20 @@
 the list of arguments to process (default: ``sys.argv[1:]``)
 
 ``values``
- object to store option arguments in (default: a new instance of optparse.Values)
+ object to store option arguments in (default: a new instance of
+ :class:`optparse.Values`)
 
 and the return values are
 
 ``options``
- the same object that was passed in as ``options``, or the optparse.Values
+ the same object that was passed in as ``values``, or the optparse.Values
 instance created by :mod:`optparse`
 
 ``args``
 the leftover positional arguments after all options have been processed
 
 The most common usage is to supply neither keyword argument. If you supply
-``options``, it will be modified with repeated ``setattr()`` calls (roughly one
+``values``, it will be modified with repeated ``setattr()`` calls (roughly one
 for every option argument stored to an option destination) and returned by
 :meth:`parse_args`.
 
Modified: python/branches/release31-maint/Doc/library/os.rst
==============================================================================
--- python/branches/release31-maint/Doc/library/os.rst	(original)
+++ python/branches/release31-maint/Doc/library/os.rst	Tue Sep 1 10:13:16 2009
@@ -396,7 +396,7 @@
 Close all file descriptors from *fd_low* (inclusive) to *fd_high* (exclusive),
 ignoring errors. Availability: Unix, Windows. Equivalent to::
 
- for fd in xrange(fd_low, fd_high):
+ for fd in range(fd_low, fd_high):
 try:
 os.close(fd)
 except OSError:
@@ -947,12 +947,12 @@
 
 .. function:: remove(path)
 
- Remove the file *path*. If *path* is a directory, :exc:`OSError` is raised; see
- :func:`rmdir` below to remove a directory. This is identical to the
- :func:`unlink` function documented below. On Windows, attempting to remove a
- file that is in use causes an exception to be raised; on Unix, the directory
- entry is removed but the storage allocated to the file is not made available
- until the original file is no longer in use. Availability: Unix,
+ Remove (delete) the file *path*. If *path* is a directory, :exc:`OSError` is
+ raised; see :func:`rmdir` below to remove a directory. This is identical to
+ the :func:`unlink` function documented below. On Windows, attempting to
+ remove a file that is in use causes an exception to be raised; on Unix, the
+ directory entry is removed but the storage allocated to the file is not made
+ available until the original file is no longer in use. Availability: Unix,
 Windows.
 
 
@@ -997,7 +997,10 @@
 
 .. function:: rmdir(path)
 
- Remove the directory *path*. Availability: Unix, Windows.
+ Remove (delete) the directory *path*. Only works when the directory is
+ empty, otherwise, :exc:`OSError` is raised. In order to remove whole
+ directory trees, :func:`shutil.rmtree` can be used. Availability: Unix,
+ Windows.
 
 
 .. function:: stat(path)
@@ -1099,9 +1102,9 @@
 
 .. function:: unlink(path)
 
- Remove the file *path*. This is the same function as :func:`remove`; the
- :func:`unlink` name is its traditional Unix name. Availability: Unix,
- Windows.
+ Remove (delete) the file *path*. This is the same function as
+ :func:`remove`; the :func:`unlink` name is its traditional Unix
+ name. Availability: Unix, Windows.
 
 
 .. function:: utime(path, times)
Modified: python/branches/release31-maint/Doc/library/signal.rst
==============================================================================
--- python/branches/release31-maint/Doc/library/signal.rst	(original)
+++ python/branches/release31-maint/Doc/library/signal.rst	Tue Sep 1 10:13:16 2009
@@ -205,9 +205,9 @@
 exception to be raised.
 
 The *handler* is called with two arguments: the signal number and the current
- stack frame (``None`` or a frame object; for a description of frame objects, see
- the reference manual section on the standard type hierarchy or see the attribute
- descriptions in the :mod:`inspect` module).
+ stack frame (``None`` or a frame object; for a description of frame objects,
+ see the :ref:`description in the type hierarchy <frame-objects>` or see the
+ attribute descriptions in the :mod:`inspect` module).
 
 
 .. _signal-example:
Modified: python/branches/release31-maint/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/release31-maint/Doc/library/stdtypes.rst	(original)
+++ python/branches/release31-maint/Doc/library/stdtypes.rst	Tue Sep 1 10:13:16 2009
@@ -1724,12 +1724,12 @@
 .. method:: update(other, ...)
 set |= other | ...
 
- Update the set, adding elements from *other*.
+ Update the set, adding elements from all others.
 
 .. method:: intersection_update(other, ...)
 set &= other & ...
 
- Update the set, keeping only elements found in it and *other*.
+ Update the set, keeping only elements found in it and all others.
 
 .. method:: difference_update(other, ...)
 set -= other | ...
@@ -2478,9 +2478,9 @@
 their implementation of the context management protocol. See the
 :mod:`contextlib` module for some examples.
 
-Python's :term:`generator`\s and the ``contextlib.contextfactory`` :term:`decorator`
+Python's :term:`generator`\s and the ``contextlib.contextmanager`` :term:`decorator`
 provide a convenient way to implement these protocols. If a generator function is
-decorated with the ``contextlib.contextfactory`` decorator, it will return a
+decorated with the ``contextlib.contextmanager`` decorator, it will return a
 context manager implementing the necessary :meth:`__enter__` and
 :meth:`__exit__` methods, rather than the iterator produced by an undecorated
 generator function.
Modified: python/branches/release31-maint/Doc/library/string.rst
==============================================================================
--- python/branches/release31-maint/Doc/library/string.rst	(original)
+++ python/branches/release31-maint/Doc/library/string.rst	Tue Sep 1 10:13:16 2009
@@ -194,7 +194,7 @@
 The grammar for a replacement field is as follows:
 
 .. productionlist:: sf
- replacement_field: "{" `field_name` ["!" `conversion`] [":" `format_spec`] "}"
+ replacement_field: "{" [`field_name`] ["!" `conversion`] [":" `format_spec`] "}"
 field_name: arg_name ("." `attribute_name` | "[" `element_index` "]")*
 arg_name: (`identifier` | `integer`)?
 attribute_name: `identifier`
@@ -202,7 +202,7 @@
 conversion: "r" | "s" | "a"
 format_spec: <described in the next section>
 
-In less formal terms, the replacement field starts with a *field_name* that specifies
+In less formal terms, the replacement field can start with a *field_name* that specifies
 the object whose value is to be formatted and inserted
 into the output instead of the replacement field.
 The *field_name* is optionally followed by a *conversion* field, which is
@@ -223,7 +223,7 @@
 
 "First, thou shalt count to {0}" # References first positional argument
 "Bring me a {}" # Implicitly references the first positional argument
- "From {} to {}" # Same as "From {0] to {1}"
+ "From {} to {}" # Same as "From {0} to {1}"
 "My quest is {name}" # References keyword argument 'name'
 "Weight in tons {0.weight}" # 'weight' attribute of first positional arg
 "Units destroyed: {players[0]}" # First element of keyword argument 'players'.
@@ -243,6 +243,7 @@
 
 "Harold's a clever {0!s}" # Calls str() on the argument first
 "Bring out the holy {name!r}" # Calls repr() on the argument first
+ "More {!a}" # Calls ascii() on the argument first
 
 The *format_spec* field contains a specification of how the value should be
 presented, including such details as field width, alignment, padding, decimal
Modified: python/branches/release31-maint/Doc/reference/datamodel.rst
==============================================================================
--- python/branches/release31-maint/Doc/reference/datamodel.rst	(original)
+++ python/branches/release31-maint/Doc/reference/datamodel.rst	Tue Sep 1 10:13:16 2009
@@ -864,6 +864,8 @@
 If a code object represents a function, the first item in :attr:`co_consts` is
 the documentation string of the function, or ``None`` if undefined.
 
+ .. _frame-objects:
+
 Frame objects
 .. index:: object: frame
 
Modified: python/branches/release31-maint/Doc/tutorial/classes.rst
==============================================================================
--- python/branches/release31-maint/Doc/tutorial/classes.rst	(original)
+++ python/branches/release31-maint/Doc/tutorial/classes.rst	Tue Sep 1 10:13:16 2009
@@ -51,8 +51,8 @@
 
 .. _tut-scopes:
 
-Python Scopes and Name Spaces
-=============================
+Python Scopes and Namespaces
+============================
 
 Before introducing classes, I first have to tell you something about Python's
 scope rules. Class definitions play some neat tricks with namespaces, and you
@@ -87,7 +87,7 @@
 :keyword:`del` statement. For example, ``del modname.the_answer`` will remove
 the attribute :attr:`the_answer` from the object named by ``modname``.
 
-Name spaces are created at different moments and have different lifetimes. The
+Namespaces are created at different moments and have different lifetimes. The
 namespace containing the built-in names is created when the Python interpreter
 starts up, and is never deleted. The global namespace for a module is created
 when the module definition is read in; normally, module namespaces also last
@@ -381,9 +381,9 @@
 attribute that is a function object, a method object is created by packing
 (pointers to) the instance object and the function object just found together in
 an abstract object: this is the method object. When the method object is called
-with an argument list, it is unpacked again, a new argument list is constructed
-from the instance object and the original argument list, and the function object
-is called with this new argument list.
+with an argument list, a new argument list is constructed from the instance
+object and the argument list, and the function object is called with this new
+argument list.
 
 
 .. _tut-remarks:
Modified: python/branches/release31-maint/Doc/tutorial/inputoutput.rst
==============================================================================
--- python/branches/release31-maint/Doc/tutorial/inputoutput.rst	(original)
+++ python/branches/release31-maint/Doc/tutorial/inputoutput.rst	Tue Sep 1 10:13:16 2009
@@ -126,12 +126,12 @@
 
 Basic usage of the :meth:`str.format` method looks like this::
 
- >>> print('We are the {0} who say "{1}!"'.format('knights', 'Ni'))
+ >>> print('We are the {} who say "{}!"'.format('knights', 'Ni'))
 We are the knights who say "Ni!"
 
 The brackets and characters within them (called format fields) are replaced with
-the objects passed into the :meth:`~str.format` method. The number in the
-brackets refers to the position of the object passed into the
+the objects passed into the :meth:`~str.format` method. A number in the
+brackets can be used to refer to the position of the object passed into the
 :meth:`~str.format` method. ::
 
 >>> print('{0} and {1}'.format('spam', 'eggs'))
@@ -152,6 +152,15 @@
 other='Georg'))
 The story of Bill, Manfred, and Georg.
 
+``'!a'`` (apply :func:`ascii`), ``'!s'`` (apply :func:`str`) and ``'!r'``
+(apply :func:`repr`) can be used to convert the value before it is formatted::
+
+ >>> import math
+ >>> print('The value of PI is approximately {}.'.format(math.pi))
+ The value of PI is approximately 3.14159265359.
+ >>> print('The value of PI is approximately {!r}.'.format(math.pi))
+ The value of PI is approximately 3.141592653589793.
+
 An optional ``':'`` and format specifier can follow the field name. This allows
 greater control over how the value is formatted. The following example
 truncates Pi to three places after the decimal.
Modified: python/branches/release31-maint/Misc/ACKS
==============================================================================
--- python/branches/release31-maint/Misc/ACKS	(original)
+++ python/branches/release31-maint/Misc/ACKS	Tue Sep 1 10:13:16 2009
@@ -789,6 +789,7 @@
 Truida Wiedijk
 Felix Wiemann
 Gerry Wiener
+Frank Wierzbicki
 Bryce "Zooko" Wilcox-O'Hearn
 John Williams
 Sue Williams
Modified: python/branches/release31-maint/Misc/NEWS
==============================================================================
--- python/branches/release31-maint/Misc/NEWS	(original)
+++ python/branches/release31-maint/Misc/NEWS	Tue Sep 1 10:13:16 2009
@@ -1462,6 +1462,9 @@
 - Issue #4204: Fixed module build errors on FreeBSD 4.
 
 
+- Issue #6801 : symmetric_difference_update also accepts |.
+ Thanks to Carl Chenet. 
+
 C-API
 -----
 
Modified: python/branches/release31-maint/Objects/listsort.txt
==============================================================================
--- python/branches/release31-maint/Objects/listsort.txt	(original)
+++ python/branches/release31-maint/Objects/listsort.txt	Tue Sep 1 10:13:16 2009
@@ -606,7 +606,7 @@
 
 def fill(n):
 from random import random
- return [random() for i in xrange(n)]
+ return [random() for i in range(n)]
 
 def mycmp(x, y):
 global ncmp
Modified: python/branches/release31-maint/Objects/rangeobject.c
==============================================================================
--- python/branches/release31-maint/Objects/rangeobject.c	(original)
+++ python/branches/release31-maint/Objects/rangeobject.c	Tue Sep 1 10:13:16 2009
@@ -431,7 +431,7 @@
 	rangeiter_new,				/* tp_new */
 };
 
-/* Return number of items in range/xrange (lo, hi, step). step > 0
+/* Return number of items in range (lo, hi, step). step > 0
 * required. Return a value < 0 if & only if the true value is too
 * large to fit in a signed long.
 */
Modified: python/branches/release31-maint/Tools/pybench/README
==============================================================================
--- python/branches/release31-maint/Tools/pybench/README	(original)
+++ python/branches/release31-maint/Tools/pybench/README	Tue Sep 1 10:13:16 2009
@@ -260,10 +260,7 @@
 
 # Run test rounds
 	#
- # NOTE: Use xrange() for all test loops unless you want to face
-	# a 20MB process !
-	#
- for i in xrange(self.rounds):
+ for i in range(self.rounds):
 
 # Repeat the operations per round to raise the run-time
 # per operation significantly above the noise level of the
@@ -305,7 +302,7 @@
 a = 1
 
 # Run test rounds (without actually doing any operation)
- for i in xrange(self.rounds):
+ for i in range(self.rounds):
 
 	 # Skip the actual execution of the operations, since we
 	 # only want to measure the test's administration overhead.


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /