diff options
author | Georg Brandl <georg@python.org> | 2010-02-06 18:46:57 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-02-06 18:46:57 (GMT) |
commit | c4a55fccaba4936458c32f5f3b3913fcf2848b42 (patch) | |
tree | a90e0efacec59c07bc943ba8ab8593a3a1f6f4ed /Doc/faq/programming.rst | |
parent | 3102bd9afe7fe657a8e3533b5cdee3e5e9282f27 (diff) | |
download | cpython-c4a55fccaba4936458c32f5f3b3913fcf2848b42.zip cpython-c4a55fccaba4936458c32f5f3b3913fcf2848b42.tar.gz cpython-c4a55fccaba4936458c32f5f3b3913fcf2848b42.tar.bz2 |
Recorded merge of revisions 78024 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78024 | georg.brandl | 2010-02-06 19:44:44 +0100 (Sa, 06 Feb 2010) | 1 line
#5341: fix "builtin" where used as an adjective ("built-in" is correct).
........
Diffstat (limited to 'Doc/faq/programming.rst')
-rw-r--r-- | Doc/faq/programming.rst | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index 3c9e5f4..a35459b 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -178,9 +178,10 @@ it is much shorter and far faster to use :: L2 = list(L1[:3]) # "list" is redundant if L1 is a list. -Note that the functionally-oriented builtins such as :func:`map`, :func:`zip`, -and friends can be a convenient accelerator for loops that perform a single -task. For example to pair the elements of two lists together:: +Note that the functionally-oriented built-in functions such as :func:`map`, +:func:`zip`, and friends can be a convenient accelerator for loops that +perform a single task. For example to pair the elements of two lists +together:: >>> list(zip([1, 2, 3], [4, 5, 6])) [(1, 4), (2, 5), (3, 6)] @@ -203,7 +204,7 @@ manipulating strings, use the ``replace()`` and the ``format()`` :ref:`methods on string objects <string-methods>`. Use regular expressions only when you're not dealing with constant string patterns. -Be sure to use the :meth:`list.sort` builtin method to do sorting, and see the +Be sure to use the :meth:`list.sort` built-in method to do sorting, and see the `sorting mini-HOWTO <http://wiki.python.org/moin/HowTo/Sorting>`_ for examples of moderately advanced usage. :meth:`list.sort` beats other techniques for sorting in all but the most extreme circumstances. @@ -361,7 +362,7 @@ Though a bit surprising at first, a moment's consideration explains this. On one hand, requiring :keyword:`global` for assigned variables provides a bar against unintended side-effects. On the other hand, if ``global`` was required for all global references, you'd be using ``global`` all the time. You'd have -to declare as global every reference to a builtin function or to a component of +to declare as global every reference to a built-in function or to a component of an imported module. This clutter would defeat the usefulness of the ``global`` declaration for identifying side-effects. @@ -1033,7 +1034,7 @@ trailing newline from a string. How do I iterate over a sequence in reverse order? -------------------------------------------------- -Use the :func:`reversed` builtin function, which is new in Python 2.4:: +Use the :func:`reversed` built-in function, which is new in Python 2.4:: for x in reversed(sequence): ... # do something with x... |