@@ -1181,10 +1181,17 @@ msgid ""
11811181"with an iterator will just return the same exhausted iterator object used in"
11821182" the previous iteration pass, making it appear like an empty container."
11831183msgstr ""
1184+ "用来表示一连串数据流的对象。重复调用迭代器的 :meth:`~iterator.__next__` 方法(或将其传给内置函数 "
1185+ ":func:`next`)将逐个返回流中的项。当没有数据可用时则将引发 :exc:`StopIteration` "
1186+ "异常。到这时迭代器对象中的数据项已耗尽,继续调用其 :meth:`__next__` 方法只会再次引发 :exc:`StopIteration` "
1187+ "异常。迭代器必须具有 :meth:`__iter__` "
1188+ "方法用来返回该迭代器对象自身,因此迭代器必定也是可迭代对象,可被用于其他可迭代对象适用的大部分场合。一个显著的例外是那些会多次重复访问迭代项的代码。容器对象(例如"
1189+ " :class:`list`)在你每次向其传入 :func:`iter` 函数或是在 :keyword:`for` "
1190+ "循环中使用它时都会产生一个新的迭代器。如果在此情况下你尝试用迭代器则会返回在之前迭代过程中被耗尽的同一迭代器对象,使其看起来就像是一个空容器。"
11841191
11851192#: ../../glossary.rst:600
11861193msgid "More information can be found in :ref:`typeiter`."
1187- msgstr ""
1194+ msgstr "更多信息可查看 :ref:`typeiter`。 "
11881195
11891196#: ../../glossary.rst:601
11901197msgid "key function"
@@ -1196,6 +1203,8 @@ msgid ""
11961203" for sorting or ordering. For example, :func:`locale.strxfrm` is used to "
11971204"produce a sort key that is aware of locale specific sort conventions."
11981205msgstr ""
1206+ "键函数或称整理函数,是能够返回用于排序或排位的值的可调用对象。例如,:func:`locale.strxfrm` "
1207+ "可用于生成一个符合特定区域排序约定的排序键。"
11991208
12001209#: ../../glossary.rst:608
12011210msgid ""
@@ -1204,6 +1213,9 @@ msgid ""
12041213" :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, "
12051214":func:`heapq.nlargest`, and :func:`itertools.groupby`."
12061215msgstr ""
1216+ "Python 中有许多工具都允许用键函数来控制元素的排位或分组方式。其中包括 "
1217+ ":func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq.merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest`"
1218+ " 以及 :func:`itertools.groupby`。"
12071219
12081220#: ../../glossary.rst:614
12091221msgid ""
@@ -1216,14 +1228,19 @@ msgid ""
12161228":func:`~operator.methodcaller`. See the :ref:`Sorting HOW TO "
12171229"<sortinghowto>` for examples of how to create and use key functions."
12181230msgstr ""
1231+ "要创建一个键函数有多种方式。例如,:meth:`str.lower` 方法可以用作忽略大小写排序的键函数。另外,键函数也可通过 "
1232+ ":keyword:`lambda` 表达式来创建,例如 ``lambda r: (r[0], r[2])``。还有 :mod:`operator` "
1233+ "模块提供了三个键函数构造器::func:`~operator.attrgetter`、:func:`~operator.itemgetter` 和 "
1234+ ":func:`~operator.methodcaller`。请查看 :ref:`如何排序 <sortinghowto>` "
1235+ "一节以获取创建和使用键函数的示例。"
12191236
12201237#: ../../glossary.rst:622
12211238msgid "keyword argument"
12221239msgstr "keyword argument -- 关键字参数"
12231240
12241241#: ../../glossary.rst:624 ../../glossary.rst:883
12251242msgid "See :term:`argument`."
1226- msgstr ""
1243+ msgstr "参见 :term:`argument`。 "
12271244
12281245#: ../../glossary.rst:625
12291246msgid "lambda"
0 commit comments