Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 82ae4f1

Browse files
[po] auto sync
1 parent b2f0069 commit 82ae4f1

3 files changed

Lines changed: 26 additions & 11 deletions

File tree

library/bisect.po

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,28 +132,30 @@ msgid ""
132132
"Next, it runs the :meth:`insert` method on *a* to insert *x* at the "
133133
"appropriate position to maintain sort order."
134134
msgstr ""
135+
"此函数首先会运行 :func:`bisect_right` 来定位一个插入点。 然后,它会在 *a* 上运行 :meth:`insert` "
136+
"方法在正确的位置插入 *x* 以保持排序顺序。"
135137

136138
#: ../../library/bisect.rst:104
137139
msgid "Performance Notes"
138-
msgstr ""
140+
msgstr "性能说明"
139141

140142
#: ../../library/bisect.rst:106
141143
msgid ""
142144
"When writing time sensitive code using *bisect()* and *insort()*, keep these"
143145
" thoughts in mind:"
144-
msgstr ""
146+
msgstr "当使用 *bisect()* 和 *insort()* 编写时间敏感的代码时,请记住以下概念。"
145147

146148
#: ../../library/bisect.rst:109
147149
msgid ""
148150
"Bisection is effective for searching ranges of values. For locating specific"
149151
" values, dictionaries are more performant."
150-
msgstr ""
152+
msgstr "二分法对于搜索一定范围的值是很高效的。 对于定位特定的值,则字典的性能更好。"
151153

152154
#: ../../library/bisect.rst:112
153155
msgid ""
154156
"The *insort()* functions are ``O(n)`` because the logarithmic search step is"
155157
" dominated by the linear time insertion step."
156-
msgstr ""
158+
msgstr "*insort()* 函数的时间复杂度为 ``O(n)`` 因为对数时间的搜索步骤被线性时间的插入步骤所主导。"
157159

158160
#: ../../library/bisect.rst:115
159161
msgid ""
@@ -165,13 +167,18 @@ msgid ""
165167
"consider searching an array of precomputed keys to locate the insertion "
166168
"point (as shown in the examples section below)."
167169
msgstr ""
170+
"这些搜索函数都是无状态的并且会在它们被使用后丢弃键函数的结果。 因此,如果在一个循环中使用搜索函数,则键函数可能会在同一个数据元素上被反复调用。 "
171+
"如果键函数速度不快,请考虑用 :func:`functools.cache` 来包装它以避免重复计算。 "
172+
"另外,也可以考虑搜索一个预先计算好的键数组来定位插入点(如下面的示例节所演示的)。"
168173

169174
#: ../../library/bisect.rst:125
170175
msgid ""
171176
"`Sorted Collections <http://www.grantjenks.com/docs/sortedcollections/>`_ is"
172177
" a high performance module that uses *bisect* to managed sorted collections "
173178
"of data."
174179
msgstr ""
180+
"`Sorted Collections <http://www.grantjenks.com/docs/sortedcollections/>`_ "
181+
"是一个使用 *bisect* 来管理数据的已排序多项集的高性能模块。"
175182

176183
#: ../../library/bisect.rst:129
177184
msgid ""
@@ -181,6 +188,9 @@ msgid ""
181188
"search methods and support for a key-function. The keys are precomputed to "
182189
"save unnecessary calls to the key function during searches."
183190
msgstr ""
191+
"`SortedCollection recipe "
192+
"<https://code.activestate.com/recipes/577197-sortedcollection/>`_ 使用 bisect "
193+
"构建了一个功能完整的多项集类,拥有直观的搜索方法和对键函数的支持。 所有键函数都 是预先计算好的以避免在搜索期间对键函数的不必要的调用。"
184194

185195
#: ../../library/bisect.rst:137
186196
msgid "Searching Sorted Lists"
@@ -214,4 +224,4 @@ msgstr ""
214224
msgid ""
215225
"One technique to avoid repeated calls to a key function is to search a list "
216226
"of precomputed keys to find the index of a record::"
217-
msgstr ""
227+
msgstr "一种避免重复调用键函数的技巧是搜索一个预先计算好的键函数列表来找出记录的索引::"

tutorial/controlflow.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ msgstr ""
353353

354354
#: ../../tutorial/controlflow.rst:383
355355
msgid "Subpatterns may be captured using the ``as`` keyword::"
356-
msgstr ""
356+
msgstr "子模式可使用 ``as`` 关键字来捕获::"
357357

358358
#: ../../tutorial/controlflow.rst:387
359359
msgid ""

whatsnew/3.10.po

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,8 @@ msgid ""
691691
"may also be ``_``, so ``(x, y, *_)`` matches a sequence of at least two "
692692
"items without binding the remaining items."
693693
msgstr ""
694+
"序列模式支持通配符: ``[x, y, *rest]`` 和 ``(x, y, *rest)`` 的作用类似于解包赋值中的通配符。 在 ``*`` "
695+
"之后的名称也可以为 ``_``,因此 ``(x, y, *_)`` 可以匹配包含两个条目的序列而不必绑定其余的条目。"
694696

695697
#: ../../whatsnew/3.10.rst:654
696698
msgid ""
@@ -699,35 +701,38 @@ msgid ""
699701
"patterns, extra keys are ignored. A wildcard ``**rest`` is also supported."
700702
" (But ``**_`` would be redundant, so is not allowed.)"
701703
msgstr ""
704+
"映射模式: ``{\"bandwidth\": b, \"latency\": l}`` 会从一个字典中捕获 ``\"bandwidth\"`` 和 "
705+
"``\"latency\"`` 值。 与序列模式不同,额外的键会被忽略。 也支持符 ``**rest``。 (但 ``**_`` "
706+
"是冗余的,因而不被允许。)"
702707

703708
#: ../../whatsnew/3.10.rst:659
704709
msgid "Subpatterns may be captured using the ``as`` keyword::"
705-
msgstr ""
710+
msgstr "子模式可使用 ``as`` 关键字来捕获::"
706711

707712
#: ../../whatsnew/3.10.rst:663
708713
msgid ""
709714
"This binds x1, y1, x2, y2 like you would expect without the ``as`` clause, "
710715
"and p2 to the entire second item of the subject."
711-
msgstr ""
716+
msgstr "x1, y1, x2, y2 等绑定就如你在没有 ``as`` 子句的情况下所期望的,而 p2 会绑定目标的整个第二项。"
712717

713718
#: ../../whatsnew/3.10.rst:666
714719
msgid ""
715720
"Most literals are compared by equality. However, the singletons ``True``, "
716721
"``False`` and ``None`` are compared by identity."
717-
msgstr ""
722+
msgstr "大多数字面值是按相等性比较的。 但是,单例对象 ``True``, ``False`` 和 ``None`` 则是按标识号比较的。"
718723

719724
#: ../../whatsnew/3.10.rst:669
720725
msgid ""
721726
"Named constants may be used in patterns. These named constants must be "
722727
"dotted names to prevent the constant from being interpreted as a capture "
723728
"variable::"
724-
msgstr ""
729+
msgstr "命名常量也可以在模式中使用。 这些命名常量必须为带点号的名称以防止常量被解读为捕获变量::"
725730

726731
#: ../../whatsnew/3.10.rst:687
727732
msgid ""
728733
"For the full specification see :pep:`634`. Motivation and rationale are in "
729734
":pep:`635`, and a longer tutorial is in :pep:`636`."
730-
msgstr ""
735+
msgstr "完整规格说明参见 :pep:`634`。 动机与理由参见 :pep:`635`,更详细的教程参见 :pep:`636`。"
731736

732737
#: ../../whatsnew/3.10.rst:694
733738
msgid "Optional ``EncodingWarning`` and ``encoding=\"locale\"`` option"

0 commit comments

Comments
 (0)