@@ -40,6 +40,8 @@ msgid ""
4040"a working example of the algorithm (the boundary conditions are already "
4141"right!)."
4242msgstr ""
43+ "这个模块对有序列表提供了支持,使得他们可以在插入新数据仍然保持有序。对于长列表,如果其包含元素的比较操作十分昂贵的话,这可以是对更常见方法的改进。这个模块叫做"
44+ " :mod:`bisect` 因为其使用了基本的二分(bisection)算法。源代码也可以作为很棒的算法示例(边界判断也做好啦!)"
4345
4446#: ../../library/bisect.rst:21
4547msgid "The following functions are provided:"
@@ -54,19 +56,24 @@ msgid ""
5456"existing entries. The return value is suitable for use as the first "
5557"parameter to ``list.insert()`` assuming that *a* is already sorted."
5658msgstr ""
59+ "在 *a* 中找到 *x* 合适的插入点以维持有序。参数 *lo* 和 *hi* 可以被用于确定需要考虑的子集;默认情况下整个列表都会被使用。如果 "
60+ "*x* 已经在 *a* 里存在,那么插入点会在已存在元素之前(也就是左边)。如果 *a* 是列表(list)的话,返回值是可以被放在 "
61+ "``list.insert()`` 的第一个参数的。"
5762
5863#: ../../library/bisect.rst:33
5964msgid ""
6065"The returned insertion point *i* partitions the array *a* into two halves so"
6166" that ``all(val < x for val in a[lo:i])`` for the left side and ``all(val >="
6267" x for val in a[i:hi])`` for the right side."
6368msgstr ""
69+ "返回的插入点 *i* 可以将数组 *a* 分成两部分。左侧是 ``all(val < x for val in a[lo:i])`` ,右侧是 "
70+ "``all(val >= x for val in a[i:hi])`` 。"
6471
6572#: ../../library/bisect.rst:40
6673msgid ""
6774"Similar to :func:`bisect_left`, but returns an insertion point which comes "
6875"after (to the right of) any existing entries of *x* in *a*."
69- msgstr ""
76+ msgstr "类似于 :func:`bisect_left`,但是返回的插入点是 *a* 中已存在元素 *x* 的右侧。 "
7077
7178#: ../../library/bisect.rst:43
7279msgid ""
0 commit comments