88# Fei Yin <[email protected] >, 201899# Zephyr Waitzman <[email protected] >, 2018101011- # chen_chao <[email protected] >, 20191211# Freesand Leo <[email protected] >, 20191312# zkonge, 2019
13+ # chen_chao <[email protected] >, 20191414#
1515#, fuzzy
1616msgid ""
@@ -19,7 +19,7 @@ msgstr ""
1919"Report-Msgid-Bugs-To : \n "
2020"POT-Creation-Date : 2019-01-01 10:14+0900\n "
2121"PO-Revision-Date : 2017-02-16 17:44+0000\n "
22- "Last-Translator : zkonge , 2019\n "
22+ "
Last-Translator :
chen_chao <[email protected] > , 2019\n"
2323"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2424"MIME-Version : 1.0\n "
2525"Content-Type : text/plain; charset=UTF-8\n "
@@ -1031,6 +1031,8 @@ msgid ""
10311031"first iterator, then all the elements of the second, and so on, until all of"
10321032" the iterables have been exhausted. ::"
10331033msgstr ""
1034+ ":func:`itertools.chain(iterA, iterB, ...) <itertools.chain>` "
1035+ "接受任意数量的可迭代对象作为输入,首先返回第一个迭代器的所有元素,然后是第二个的所有元素,如此一直进行下去,直到消耗掉所有输入的可迭代对象。"
10341036
10351037#: ../../howto/functional.rst:786
10361038msgid ""
@@ -1042,6 +1044,10 @@ msgid ""
10421044"and list slicing, you can't use negative values for *start*, *stop*, or "
10431045"*step*. ::"
10441046msgstr ""
1047+ ":func:`itertools.islice(iter, [start], stop, [step]) <itertools.islice>` "
1048+ "返回一个所输入的迭代器切片的数据流。如果只单独给定 *stop* 参数的话,它会返回从起始算起 *stop* 个数量的元素。如果你提供了起始下标 "
1049+ "*start*,你会得到 *stop-start* 个元素;如果你给定了 *step* 参数,数据流会跳过相应的元素。和 Python "
1050+ "里的字符串和列表切片不同,你不能在 *start*, *stop* 或者 *step* 这些参数中使用负数。::"
10451051
10461052#: ../../howto/functional.rst:800
10471053msgid ""
@@ -1056,6 +1062,9 @@ msgstr ""
10561062#: ../../howto/functional.rst:819
10571063msgid "Calling functions on elements"
10581064msgstr ""
1065+ ":func:`itertools.tee(iter, [n]) <itertools.tee>` 可以复制一个迭代器;它返回 *n* "
1066+ "个能够返回源迭代器内容的独立迭代器。如果你不提供参数 *n*,默认值为 "
1067+ "2。复制迭代器需要保存源迭代器的一部分内容,因此在源迭代器比较大的时候会显著地占用内存;同时,新迭代器中的一个会比其他迭代器占用更多的内存。"
10591068
10601069#: ../../howto/functional.rst:821
10611070msgid ""
@@ -1066,44 +1075,56 @@ msgid ""
10661075"<operator.attrgetter>` (returns a callable that fetches the ``.id`` "
10671076"attribute)."
10681077msgstr ""
1078+ ":mod:`operator` 模块包含一组对应于 Python 操作符的函数。比如 :func:`operator.add(a, b) "
1079+ "<operator.add>` (把两个数加起来),:func:`operator.ne(a, b) <operator.ne>` (和 ``a !="
1080+ " b`` 相同),以及 :func:`operator.attrgetter('id') <operator.attrgetter>` (返回获取 "
1081+ "``.id`` 属性的可调用对象)。"
10691082
10701083#: ../../howto/functional.rst:827
10711084msgid ""
10721085":func:`itertools.starmap(func, iter) <itertools.starmap>` assumes that the "
10731086"iterable will return a stream of tuples, and calls *func* using these tuples"
10741087" as the arguments::"
10751088msgstr ""
1089+ ":func:`itertools.starmap(func, iter) <itertools.starmap>` "
1090+ "假定可迭代对象能够返回一个元组的流,并且利用这些元组作为参数来调用 *func*::"
10761091
10771092#: ../../howto/functional.rst:839
10781093msgid "Selecting elements"
1079- msgstr ""
1094+ msgstr "选择元素 "
10801095
10811096#: ../../howto/functional.rst:841
10821097msgid ""
10831098"Another group of functions chooses a subset of an iterator's elements based "
10841099"on a predicate."
1085- msgstr ""
1100+ msgstr "另外一系列函数根据谓词选取一个迭代器中元素的子集。 "
10861101
10871102#: ../../howto/functional.rst:844
10881103msgid ""
10891104":func:`itertools.filterfalse(predicate, iter) <itertools.filterfalse>` is "
10901105"the opposite of :func:`filter`, returning all elements for which the "
10911106"predicate returns false::"
10921107msgstr ""
1108+ ":func:`itertools.filterfalse(predicate, iter) <itertools.filterfalse>` 和 "
1109+ ":func:`filter` 相反,返回所有让 predicate 返回 false 的元素::"
10931110
10941111#: ../../howto/functional.rst:851
10951112msgid ""
10961113":func:`itertools.takewhile(predicate, iter) <itertools.takewhile>` returns "
10971114"elements for as long as the predicate returns true. Once the predicate "
10981115"returns false, the iterator will signal the end of its results. ::"
10991116msgstr ""
1117+ ":func:`itertools.takewhile(predicate, iter) <itertools.takewhile>` 返回一直让 "
1118+ "predicate 返回 true 的元素。一旦 predicate 返回 false,迭代器就会发出终止结果的信号。::"
11001119
11011120#: ../../howto/functional.rst:864
11021121msgid ""
11031122":func:`itertools.dropwhile(predicate, iter) <itertools.dropwhile>` discards "
11041123"elements while the predicate returns true, and then returns the rest of the "
11051124"iterable's results. ::"
11061125msgstr ""
1126+ ":func:`itertools.dropwhile(predicate, iter) <itertools.dropwhile>` 在 "
1127+ "predicate 返回 true 的时候丢弃元素,并且返回可迭代对象的剩余结果。::"
11071128
11081129#: ../../howto/functional.rst:874
11091130msgid ""
@@ -1112,17 +1133,21 @@ msgid ""
11121133"corresponding element of *selectors* is true, stopping whenever either one "
11131134"is exhausted::"
11141135msgstr ""
1136+ ":func:`itertools.compress(data, selectors) <itertools.compress>` "
1137+ "接受两个迭代器,然后返回 *data* 中使相应地 *selector* 中的元素为真的元素;它会在任一个迭代器耗尽的时候停止::"
11151138
11161139#: ../../howto/functional.rst:883
11171140msgid "Combinatoric functions"
1118- msgstr ""
1141+ msgstr "组合函数 "
11191142
11201143#: ../../howto/functional.rst:885
11211144msgid ""
11221145"The :func:`itertools.combinations(iterable, r) <itertools.combinations>` "
11231146"returns an iterator giving all possible *r*-tuple combinations of the "
11241147"elements contained in *iterable*. ::"
11251148msgstr ""
1149+ ":func:`itertools.combinations(iterable, r) <itertools.combinations>` "
1150+ "返回一个迭代器,它能给出输入迭代器中所包含的元素的所有可能的 *r* 元元组的组合。::"
11261151
11271152#: ../../howto/functional.rst:900
11281153msgid ""
@@ -1133,24 +1158,27 @@ msgid ""
11331158"removes this constraint on the order, returning all possible arrangements of"
11341159" length *r*::"
11351160msgstr ""
1161+ "每个元组中的元素保持着 *可迭代对象* 返回他们的顺序。例如,在上面的例子中数字 1 总是会在 2, 3, 4 或 5 "
1162+ "前面。一个类似的函数,:func:`itertools.permutations(iterable, r=None) "
1163+ "<itertools.permutations>`,取消了保持顺序的限制,返回所有可能的长度为 *r* 的排列::"
11361164
11371165#: ../../howto/functional.rst:919
11381166msgid ""
11391167"If you don't supply a value for *r* the length of the iterable is used, "
11401168"meaning that all the elements are permuted."
1141- msgstr ""
1169+ msgstr "如果你不提供 *r* 参数的值,它会使用可迭代对象的长度,也就是说会排列所有的元素。 "
11421170
11431171#: ../../howto/functional.rst:922
11441172msgid ""
11451173"Note that these functions produce all of the possible combinations by "
11461174"position and don't require that the contents of *iterable* are unique::"
1147- msgstr ""
1175+ msgstr "注意这些函数会输出所有可能的位置组合,并不要求 *可迭代对象* 的内容不重复:: "
11481176
11491177#: ../../howto/functional.rst:929
11501178msgid ""
11511179"The identical tuple ``('a', 'a', 'b')`` occurs twice, but the two 'a' "
11521180"strings came from different positions."
1153- msgstr ""
1181+ msgstr "同一个元组 ``('a', 'a', 'b')`` 出现了两次,但是两个 'a' 字符来自不同的位置。 "
11541182
11551183#: ../../howto/functional.rst:932
11561184msgid ""
@@ -1160,6 +1188,9 @@ msgid ""
11601188" element is selected for the first position of each tuple and then is "
11611189"replaced before the second element is selected. ::"
11621190msgstr ""
1191+ ":func:`itertools.combinations_with_replacement(iterable, r) "
1192+ "<itertools.combinations_with_replacement>` "
1193+ "函数放松了一个不同的限制:元组中的元素可以重复。从概念讲,为每个元组第一个位置选取一个元素,然后在选择第二个元素前替换掉它。::"
11631194
11641195#: ../../howto/functional.rst:947
11651196msgid "Grouping elements"
0 commit comments