1
1
# SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2022 , Python Software Foundation
2
+ # Copyright (C) 2001-2024 , Python Software Foundation
3
3
# This file is distributed under the same license as the Python package.
4
4
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
#
6
6
# Translators:
7
7
# Fei Yin <icebirds@163.com>, 2018
8
8
# df2dc1c92e792f7ae8417c51df43db8f_594d92a <0f49be28017426edb1db1a2ab6e67088_717605>, 2018
9
- # Aloxaf <aloxafx@gmail.com>, 2019
10
9
# Alpha Du <alphanow@gmail.com>, 2019
11
10
# Shengjing Zhu <zsj950618@gmail.com>, 2019
12
11
# Freesand Leo <yuqinju@163.com>, 2022
12
+ # Rafael Fontenelle <rffontenelle@gmail.com>, 2024
13
13
#
14
14
#, fuzzy
15
15
msgid ""
16
16
msgstr ""
17
17
"Project-Id-Version : Python 3.9\n "
18
18
"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 "
20
20
"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 "
23
23
"MIME-Version : 1.0\n "
24
24
"Content-Type : text/plain; charset=UTF-8\n "
25
25
"Content-Transfer-Encoding : 8bit\n "
@@ -36,7 +36,7 @@ msgstr "作者"
36
36
37
37
#: ../../howto/sorting.rst:6
38
38
msgid "Andrew Dalke and Raymond Hettinger"
39
- msgstr "Andrew Dalke 和 Raymond Hettinger"
39
+ msgstr "Andrew Dalke 与 Raymond Hettinger"
40
40
41
41
#: ../../howto/sorting.rst:0
42
42
msgid "Release"
@@ -51,19 +51,17 @@ msgid ""
51
51
"Python lists have a built-in :meth:`list.sort` method that modifies the list"
52
52
" in-place. There is also a :func:`sorted` built-in function that builds a "
53
53
"new sorted list from an iterable."
54
- msgstr ""
55
- "Python 列表有一个内置的 :meth:`list.sort` 方法可以直接修改列表。还有一个 :func:`sorted` "
56
- "内置函数,它会从一个可迭代对象构建一个新的排序列表。"
54
+ msgstr "内置列表方法 :meth:`list.sort` 原地修改列表,而内置函数 :func:`sorted` 由可迭代对象建出新有序列表。"
57
55
58
56
#: ../../howto/sorting.rst:14
59
57
msgid ""
60
58
"In this document, we explore the various techniques for sorting data using "
61
59
"Python."
62
- msgstr "在本文档中,我们将探索使用Python对数据进行排序的各种技术 。"
60
+ msgstr "在本文档中,我们将探索使用 Python 对数据进行排序的各种技术 。"
63
61
64
62
#: ../../howto/sorting.rst:18
65
63
msgid "Sorting Basics"
66
- msgstr "基本排序 "
64
+ msgstr "排序的基础知识 "
67
65
68
66
#: ../../howto/sorting.rst:20
69
67
msgid ""
@@ -78,51 +76,50 @@ msgid ""
78
76
"than :func:`sorted` - but if you don't need the original list, it's slightly"
79
77
" more efficient."
80
78
msgstr ""
81
- "你也可以使用 :func :`list.sort` 方法,它会直接修改原列表 (并返回 ``None`` 以避免混淆),通常来说它不如 "
82
- ":func:`sorted` 方便 ——— 但如果你不需要原列表,它会更有效率 。"
79
+ "亦可用 :meth :`list.sort` 方法。它原地修改原列表 (并返回 ``None`` 以避免混淆)。往往不如 :func:`sorted` "
80
+ "方便——但若不需原列表,用它会略高效些 。"
83
81
84
82
#: ../../howto/sorting.rst:36
85
83
msgid ""
86
84
"Another difference is that the :meth:`list.sort` method is only defined for "
87
85
"lists. In contrast, the :func:`sorted` function accepts any iterable."
88
- msgstr "另外一个区别是, :meth:`list.sort` 方法只是为列表定义的 ,而 :func:`sorted` 函数可以接受任何可迭代对象 。"
86
+ msgstr "另一个区别是 :meth:`list.sort` 方法是只为列表定义的 ,而 :func:`sorted` 函数接受任何可迭代对象 。"
89
87
90
88
#: ../../howto/sorting.rst:43
91
89
msgid "Key Functions"
92
- msgstr "关键函数 "
90
+ msgstr "键函数 "
93
91
94
92
#: ../../howto/sorting.rst:45
95
93
msgid ""
96
94
"Both :meth:`list.sort` and :func:`sorted` have a *key* parameter to specify "
97
95
"a function (or other callable) to be called on each list element prior to "
98
96
"making comparisons."
99
97
msgstr ""
100
- ":meth:`list.sort` 和 :func:`sorted` 都有一个 *key* "
101
- "形参用来指定在进行比较前要在每个列表元素上调用的函数(或其他可调用对象 )。"
98
+ ":meth:`list.sort` 和 :func:`sorted` 皆有 *key* "
99
+ "形参用以指定在比较前要对每个列表元素调用的函数(或其它可调用对象 )。"
102
100
103
101
#: ../../howto/sorting.rst:49
104
102
msgid "For example, here's a case-insensitive string comparison:"
105
- msgstr "例如,下面是一个不区分大小写的字符串比较 :"
103
+ msgstr "例如,这是个不区分大小写的字符串比较 :"
106
104
107
105
#: ../../howto/sorting.rst:54
108
106
msgid ""
109
107
"The value of the *key* parameter should be a function (or other callable) "
110
108
"that takes a single argument and returns a key to use for sorting purposes. "
111
109
"This technique is fast because the key function is called exactly once for "
112
110
"each input record."
113
- msgstr ""
114
- "*key* 形参的值应该是个函数(或其他可调用对象),它接受一个参数并返回一个用于排序的键。 这种机制速度很快,因为对于每个输入记录只会调用一次键函数。"
111
+ msgstr "*key* 形参的值需为一元函数(或其它可调用对象),其返回值用于排序。这很快,因为键函数只需在输入的每个记录上调用恰好一次。"
115
112
116
113
#: ../../howto/sorting.rst:59
117
114
msgid ""
118
115
"A common pattern is to sort complex objects using some of the object's "
119
116
"indices as keys. For example:"
120
- msgstr "一种常见的模式是使用对象的一些索引作为键对复杂对象进行排序 。例如:"
117
+ msgstr "常见的模式是用对象的某一些索引作为键对复杂对象排序 。例如:"
121
118
122
119
#: ../../howto/sorting.rst:70
123
120
msgid ""
124
121
"The same technique works for objects with named attributes. For example:"
125
- msgstr "同样的技术也适用于具有命名属性的对象 。例如:"
122
+ msgstr "同样的方法也适用于有具名属性的对象 。例如:"
126
123
127
124
#: ../../howto/sorting.rst:89
128
125
msgid "Operator Module Functions"
@@ -141,30 +138,30 @@ msgstr ""
141
138
142
139
#: ../../howto/sorting.rst:96
143
140
msgid "Using those functions, the above examples become simpler and faster:"
144
- msgstr "使用这些函数,上述示例变得更简单,更快捷 :"
141
+ msgstr "用了那些函数之后,前面的示例变得更简单,运行起来也更快 :"
145
142
146
143
#: ../../howto/sorting.rst:106
147
144
msgid ""
148
145
"The operator module functions allow multiple levels of sorting. For example,"
149
146
" to sort by *grade* then by *age*:"
150
- msgstr "Operator 模块功能允许多级排序。 例如,按 *grade* 排序,然后按 *age* 排序:"
147
+ msgstr "运算符模块的函数可以用来作多级排序。 例如,按 *grade* 排序,然后按 *age* 排序:"
151
148
152
149
#: ../../howto/sorting.rst:116
153
150
msgid "Ascending and Descending"
154
- msgstr "升序和降序 "
151
+ msgstr "升序与降序 "
155
152
156
153
#: ../../howto/sorting.rst:118
157
154
msgid ""
158
155
"Both :meth:`list.sort` and :func:`sorted` accept a *reverse* parameter with "
159
156
"a boolean value. This is used to flag descending sorts. For example, to get "
160
157
"the student data in reverse *age* order:"
161
158
msgstr ""
162
- ":meth:`list.sort` 和 :func:`sorted` 接受布尔值的 *reverse* 参数。这用于标记降序排序。 例如,要以反向 "
163
- "*age* 顺序获取学生数据 :"
159
+ ":meth:`list.sort` 和 :func:`sorted` 接受布尔形参 *reverse* 用于标记降序排序。 例如,将学生数据按 *age* "
160
+ " 倒序排序 :"
164
161
165
162
#: ../../howto/sorting.rst:129
166
163
msgid "Sort Stability and Complex Sorts"
167
- msgstr "排序稳定性和排序复杂度 "
164
+ msgstr "排序稳定性与复杂排序 "
168
165
169
166
#: ../../howto/sorting.rst:131
170
167
msgid ""
@@ -173,38 +170,38 @@ msgid ""
173
170
"that when multiple records have the same key, their original order is "
174
171
"preserved."
175
172
msgstr ""
176
- "排序保证是 `稳定 <https://en.wikipedia.org/wiki/Sorting_algorithm#Stability>`_ \\ "
177
- "的。 这意味着当多个记录具有相同的键值时,将保留其原始顺序 。"
173
+ "排序保证 `稳定 "
174
+ "<https://en.wikipedia.org/wiki/Sorting_algorithm#Stability>`_:等键记录保持原始顺序 。"
178
175
179
176
#: ../../howto/sorting.rst:139
180
177
msgid ""
181
178
"Notice how the two records for *blue* retain their original order so that "
182
179
"``('blue', 1)`` is guaranteed to precede ``('blue', 2)``."
183
- msgstr "注意 *blue* 的两个记录如何保留它们的原始顺序,以便 ``('blue', 1)`` 保证在 ``('blue', 2)`` 之前 。"
180
+ msgstr "注意 *blue* 的两个记录是如何保序的: ``('blue', 1)`` 保证先于 ``('blue', 2)``。"
184
181
185
182
#: ../../howto/sorting.rst:142
186
183
msgid ""
187
184
"This wonderful property lets you build complex sorts in a series of sorting "
188
185
"steps. For example, to sort the student data by descending *grade* and then "
189
186
"ascending *age*, do the *age* sort first and then sort again using *grade*:"
190
187
msgstr ""
191
- "这个美妙的属性允许你在一系列排序步骤中构建复杂的排序 。例如,要按 *grade* 降序然后 *age* 升序对学生数据进行排序,请先 *age* "
192
- "排序,然后再使用 *grade* 排序 :"
188
+ "这个了不起的特性使得借助一系列排序步骤构建出复杂排序成为可能 。例如,要按 *grade* 降序后 *age* 升序排序学生数据,只需先用 *age* "
189
+ "排序再用 *grade* 排序即可 :"
193
190
194
191
#: ../../howto/sorting.rst:150
195
192
msgid ""
196
193
"This can be abstracted out into a wrapper function that can take a list and "
197
194
"tuples of field and order to sort them on multiple passes."
198
- msgstr "这可以被抽象为一个包装函数,该函数能接受一个列表以及字段和顺序的元组,以对它们进行多重排序 。"
195
+ msgstr "可抽象为包装函数,依据接收的一些字段序的元组对接收的列表做多趟排序 。"
199
196
200
197
#: ../../howto/sorting.rst:161
201
198
msgid ""
202
199
"The `Timsort <https://en.wikipedia.org/wiki/Timsort>`_ algorithm used in "
203
200
"Python does multiple sorts efficiently because it can take advantage of any "
204
201
"ordering already present in a dataset."
205
202
msgstr ""
206
- "Python 中使用的 `Timsort <https://en.wikipedia.org/wiki/Timsort>`_ "
207
- "算法可以有效地进行多种排序,因为它可以利用数据集中已存在的任何排序 。"
203
+ "Python 中曾用的 `Timsort <https://en.wikipedia.org/wiki/Timsort>`_ "
204
+ "算法利用数据集中已有的任何有序性来高效进行多种排序 。"
208
205
209
206
#: ../../howto/sorting.rst:166
210
207
msgid "The Old Way Using Decorate-Sort-Undecorate"
0 commit comments