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