summaryrefslogtreecommitdiffstats
path: root/Doc/howto/sorting.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2012-04-29 16:32:30 (GMT)
committerRaymond Hettinger <python@rcn.com>2012-04-29 16:32:30 (GMT)
commit99a56386f1eee02c1cb5b47d7a2c8bbfd2f1eb24 (patch)
treebc87aed79cf1f76cfeab8c4b6f28b16228611119 /Doc/howto/sorting.rst
parent3899283670b48e92260a42ce820570aef1767158 (diff)
downloadcpython-99a56386f1eee02c1cb5b47d7a2c8bbfd2f1eb24.zip
cpython-99a56386f1eee02c1cb5b47d7a2c8bbfd2f1eb24.tar.gz
cpython-99a56386f1eee02c1cb5b47d7a2c8bbfd2f1eb24.tar.bz2
Issue 14688: Fix typo
Diffstat (limited to 'Doc/howto/sorting.rst')
-rw-r--r--Doc/howto/sorting.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/howto/sorting.rst b/Doc/howto/sorting.rst
index d9c70e2..00bc6f7 100644
--- a/Doc/howto/sorting.rst
+++ b/Doc/howto/sorting.rst
@@ -42,7 +42,7 @@ lists. In contrast, the :func:`sorted` function accepts any iterable.
Key Functions
=============
-Both :meth:`list.sort` and :func:`sorted` have *key* parameter to specify a
+Both :meth:`list.sort` and :func:`sorted` have a *key* parameter to specify a
function to be called on each list element prior to making comparisons.
For example, here's a case-insensitive string comparison:
@@ -89,7 +89,7 @@ Operator Module Functions
The key-function patterns shown above are very common, so Python provides
convenience functions to make accessor functions easier and faster. The
:mod:`operator` module has :func:`~operator.itemgetter`,
-:func:`~operator.attrgetter`, and an :func:`~operator.methodcaller` function.
+:func:`~operator.attrgetter`, and a :func:`~operator.methodcaller` function.
Using those functions, the above examples become simpler and faster:
@@ -114,7 +114,7 @@ Ascending and Descending
========================
Both :meth:`list.sort` and :func:`sorted` accept a *reverse* parameter with a
-boolean value. This is using to flag descending sorts. For example, to get the
+boolean value. This is used to flag descending sorts. For example, to get the
student data in reverse *age* order:
>>> sorted(student_tuples, key=itemgetter(2), reverse=True)