11# SOME DESCRIPTIVE TITLE.
2- # Copyright (C) 2001-2022 , Python Software Foundation
2+ # Copyright (C) 2001-2024 , Python Software Foundation
33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66# Translators:
77# Fei Yin <[email protected] >, 201888# df2dc1c92e792f7ae8417c51df43db8f_594d92a <0f49be28017426edb1db1a2ab6e67088_717605>, 2018
9- # Aloxaf <[email protected] >, 2019109# Alpha Du <[email protected] >, 20191110# Shengjing Zhu <[email protected] >, 20191211# Freesand Leo <[email protected] >, 202212+ # Rafael Fontenelle <[email protected] >, 20241313#
1414#, fuzzy
1515msgid ""
1616msgstr ""
1717"Project-Id-Version : Python 3.9\n "
1818"Report-Msgid-Bugs-To : \n "
19- "POT-Creation-Date : 2022-11-04 14:34 +0000\n "
19+ "POT-Creation-Date : 2024-05-11 20:32 +0000\n "
2020"PO-Revision-Date : 2017-02-16 17:46+0000\n "
21- "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2022 \n "
22- "Language-Team : Chinese (China) (https://www .transifex.com/python-doc/teams/5390/zh_CN/)\n "
21+ "Last-Translator : Rafael Fontenelle <rffontenelle@gmail .com>, 2024 \n "
22+ "Language-Team : Chinese (China) (https://app .transifex.com/python-doc/teams/5390/zh_CN/)\n "
2323"MIME-Version : 1.0\n "
2424"Content-Type : text/plain; charset=UTF-8\n "
2525"Content-Transfer-Encoding : 8bit\n "
@@ -36,7 +36,7 @@ msgstr "作者"
3636
3737#: ../../howto/sorting.rst:6
3838msgid "Andrew Dalke and Raymond Hettinger"
39- msgstr "Andrew Dalke 和 Raymond Hettinger"
39+ msgstr "Andrew Dalke 与 Raymond Hettinger"
4040
4141#: ../../howto/sorting.rst:0
4242msgid "Release"
@@ -51,19 +51,17 @@ msgid ""
5151"Python lists have a built-in :meth:`list.sort` method that modifies the list"
5252" in-place. There is also a :func:`sorted` built-in function that builds a "
5353"new sorted list from an iterable."
54- msgstr ""
55- "Python 列表有一个内置的 :meth:`list.sort` 方法可以直接修改列表。还有一个 :func:`sorted` "
56- "内置函数,它会从一个可迭代对象构建一个新的排序列表。"
54+ msgstr "内置列表方法 :meth:`list.sort` 原地修改列表,而内置函数 :func:`sorted` 由可迭代对象建出新有序列表。"
5755
5856#: ../../howto/sorting.rst:14
5957msgid ""
6058"In this document, we explore the various techniques for sorting data using "
6159"Python."
62- msgstr "在本文档中,我们将探索使用Python对数据进行排序的各种技术 。"
60+ msgstr "在本文档中,我们将探索使用 Python 对数据进行排序的各种技术 。"
6361
6462#: ../../howto/sorting.rst:18
6563msgid "Sorting Basics"
66- msgstr "基本排序 "
64+ msgstr "排序的基础知识 "
6765
6866#: ../../howto/sorting.rst:20
6967msgid ""
@@ -78,51 +76,50 @@ msgid ""
7876"than :func:`sorted` - but if you don't need the original list, it's slightly"
7977" more efficient."
8078msgstr ""
81- "你也可以使用 :func :`list.sort` 方法,它会直接修改原列表 (并返回 ``None`` 以避免混淆),通常来说它不如 "
82- ":func:`sorted` 方便 ——— 但如果你不需要原列表,它会更有效率 。"
79+ "亦可用 :meth :`list.sort` 方法。它原地修改原列表 (并返回 ``None`` 以避免混淆)。往往不如 :func:`sorted` "
80+ "方便——但若不需原列表,用它会略高效些 。"
8381
8482#: ../../howto/sorting.rst:36
8583msgid ""
8684"Another difference is that the :meth:`list.sort` method is only defined for "
8785"lists. In contrast, the :func:`sorted` function accepts any iterable."
88- msgstr "另外一个区别是, :meth:`list.sort` 方法只是为列表定义的 ,而 :func:`sorted` 函数可以接受任何可迭代对象 。"
86+ msgstr "另一个区别是 :meth:`list.sort` 方法是只为列表定义的 ,而 :func:`sorted` 函数接受任何可迭代对象 。"
8987
9088#: ../../howto/sorting.rst:43
9189msgid "Key Functions"
92- msgstr "关键函数 "
90+ msgstr "键函数 "
9391
9492#: ../../howto/sorting.rst:45
9593msgid ""
9694"Both :meth:`list.sort` and :func:`sorted` have a *key* parameter to specify "
9795"a function (or other callable) to be called on each list element prior to "
9896"making comparisons."
9997msgstr ""
100- ":meth:`list.sort` 和 :func:`sorted` 都有一个 *key* "
101- "形参用来指定在进行比较前要在每个列表元素上调用的函数(或其他可调用对象 )。"
98+ ":meth:`list.sort` 和 :func:`sorted` 皆有 *key* "
99+ "形参用以指定在比较前要对每个列表元素调用的函数(或其它可调用对象 )。"
102100
103101#: ../../howto/sorting.rst:49
104102msgid "For example, here's a case-insensitive string comparison:"
105- msgstr "例如,下面是一个不区分大小写的字符串比较 :"
103+ msgstr "例如,这是个不区分大小写的字符串比较 :"
106104
107105#: ../../howto/sorting.rst:54
108106msgid ""
109107"The value of the *key* parameter should be a function (or other callable) "
110108"that takes a single argument and returns a key to use for sorting purposes. "
111109"This technique is fast because the key function is called exactly once for "
112110"each input record."
113- msgstr ""
114- "*key* 形参的值应该是个函数(或其他可调用对象),它接受一个参数并返回一个用于排序的键。 这种机制速度很快,因为对于每个输入记录只会调用一次键函数。"
111+ msgstr "*key* 形参的值需为一元函数(或其它可调用对象),其返回值用于排序。这很快,因为键函数只需在输入的每个记录上调用恰好一次。"
115112
116113#: ../../howto/sorting.rst:59
117114msgid ""
118115"A common pattern is to sort complex objects using some of the object's "
119116"indices as keys. For example:"
120- msgstr "一种常见的模式是使用对象的一些索引作为键对复杂对象进行排序 。例如:"
117+ msgstr "常见的模式是用对象的某一些索引作为键对复杂对象排序 。例如:"
121118
122119#: ../../howto/sorting.rst:70
123120msgid ""
124121"The same technique works for objects with named attributes. For example:"
125- msgstr "同样的技术也适用于具有命名属性的对象 。例如:"
122+ msgstr "同样的方法也适用于有具名属性的对象 。例如:"
126123
127124#: ../../howto/sorting.rst:89
128125msgid "Operator Module Functions"
@@ -141,30 +138,30 @@ msgstr ""
141138
142139#: ../../howto/sorting.rst:96
143140msgid "Using those functions, the above examples become simpler and faster:"
144- msgstr "使用这些函数,上述示例变得更简单,更快捷 :"
141+ msgstr "用了那些函数之后,前面的示例变得更简单,运行起来也更快 :"
145142
146143#: ../../howto/sorting.rst:106
147144msgid ""
148145"The operator module functions allow multiple levels of sorting. For example,"
149146" to sort by *grade* then by *age*:"
150- msgstr "Operator 模块功能允许多级排序。 例如,按 *grade* 排序,然后按 *age* 排序:"
147+ msgstr "运算符模块的函数可以用来作多级排序。 例如,按 *grade* 排序,然后按 *age* 排序:"
151148
152149#: ../../howto/sorting.rst:116
153150msgid "Ascending and Descending"
154- msgstr "升序和降序 "
151+ msgstr "升序与降序 "
155152
156153#: ../../howto/sorting.rst:118
157154msgid ""
158155"Both :meth:`list.sort` and :func:`sorted` accept a *reverse* parameter with "
159156"a boolean value. This is used to flag descending sorts. For example, to get "
160157"the student data in reverse *age* order:"
161158msgstr ""
162- ":meth:`list.sort` 和 :func:`sorted` 接受布尔值的 *reverse* 参数。这用于标记降序排序。 例如,要以反向 "
163- "*age* 顺序获取学生数据 :"
159+ ":meth:`list.sort` 和 :func:`sorted` 接受布尔形参 *reverse* 用于标记降序排序。 例如,将学生数据按 *age* "
160+ " 倒序排序 :"
164161
165162#: ../../howto/sorting.rst:129
166163msgid "Sort Stability and Complex Sorts"
167- msgstr "排序稳定性和排序复杂度 "
164+ msgstr "排序稳定性与复杂排序 "
168165
169166#: ../../howto/sorting.rst:131
170167msgid ""
@@ -173,38 +170,38 @@ msgid ""
173170"that when multiple records have the same key, their original order is "
174171"preserved."
175172msgstr ""
176- "排序保证是 `稳定 <https://en.wikipedia.org/wiki/Sorting_algorithm#Stability>`_ \\ "
177- "的。 这意味着当多个记录具有相同的键值时,将保留其原始顺序 。"
173+ "排序保证 `稳定 "
174+ "<https://en.wikipedia.org/wiki/Sorting_algorithm#Stability>`_:等键记录保持原始顺序 。"
178175
179176#: ../../howto/sorting.rst:139
180177msgid ""
181178"Notice how the two records for *blue* retain their original order so that "
182179"``('blue', 1)`` is guaranteed to precede ``('blue', 2)``."
183- msgstr "注意 *blue* 的两个记录如何保留它们的原始顺序,以便 ``('blue', 1)`` 保证在 ``('blue', 2)`` 之前 。"
180+ msgstr "注意 *blue* 的两个记录是如何保序的: ``('blue', 1)`` 保证先于 ``('blue', 2)``。"
184181
185182#: ../../howto/sorting.rst:142
186183msgid ""
187184"This wonderful property lets you build complex sorts in a series of sorting "
188185"steps. For example, to sort the student data by descending *grade* and then "
189186"ascending *age*, do the *age* sort first and then sort again using *grade*:"
190187msgstr ""
191- "这个美妙的属性允许你在一系列排序步骤中构建复杂的排序 。例如,要按 *grade* 降序然后 *age* 升序对学生数据进行排序,请先 *age* "
192- "排序,然后再使用 *grade* 排序 :"
188+ "这个了不起的特性使得借助一系列排序步骤构建出复杂排序成为可能 。例如,要按 *grade* 降序后 *age* 升序排序学生数据,只需先用 *age* "
189+ "排序再用 *grade* 排序即可 :"
193190
194191#: ../../howto/sorting.rst:150
195192msgid ""
196193"This can be abstracted out into a wrapper function that can take a list and "
197194"tuples of field and order to sort them on multiple passes."
198- msgstr "这可以被抽象为一个包装函数,该函数能接受一个列表以及字段和顺序的元组,以对它们进行多重排序 。"
195+ msgstr "可抽象为包装函数,依据接收的一些字段序的元组对接收的列表做多趟排序 。"
199196
200197#: ../../howto/sorting.rst:161
201198msgid ""
202199"The `Timsort <https://en.wikipedia.org/wiki/Timsort>`_ algorithm used in "
203200"Python does multiple sorts efficiently because it can take advantage of any "
204201"ordering already present in a dataset."
205202msgstr ""
206- "Python 中使用的 `Timsort <https://en.wikipedia.org/wiki/Timsort>`_ "
207- "算法可以有效地进行多种排序,因为它可以利用数据集中已存在的任何排序 。"
203+ "Python 中曾用的 `Timsort <https://en.wikipedia.org/wiki/Timsort>`_ "
204+ "算法利用数据集中已有的任何有序性来高效进行多种排序 。"
208205
209206#: ../../howto/sorting.rst:166
210207msgid "The Old Way Using Decorate-Sort-Undecorate"
0 commit comments