Skip to content

Commit 9895834

Browse files
[po] auto sync
1 parent c00efd5 commit 9895834

File tree

2 files changed

+63
-6
lines changed

2 files changed

+63
-6
lines changed

.stat.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "92.96%", "updated_at": "2024-05-28T06:21:13Z"}
1+
{"translation": "93.01%", "updated_at": "2024-05-28T07:20:15Z"}

whatsnew/2.0.po

+62-5
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ msgid ""
158158
"notification e-mail messages that are completely unhelpful, so Ka-Ping Yee "
159159
"wrote an HTML screen-scraper that sends more useful messages."
160160
msgstr ""
161+
"转向使用 SourceForge 的服务显著提高了开发速度。 "
162+
"补丁现在由原提交者以外的人提交、评论、修改,并在不同人员之间来回传递,直到补丁被认为值得检入。 "
163+
"程序错误在一个中心位置被跟踪,并可以分配给特定人员进行修复,我们还可以统计未解决程序错误的数量来衡量进度。 "
164+
"这并不是没有代价的:开发人员现在需要处理更多的电子邮件,关注更多的邮件列表,并且需要为新环境编写专门的工具。 例如,SourceForge "
165+
"发送的默认补丁和错误通知电子邮件完全无用,所以 Ka-Ping Yee 编写了一个 HTML 屏幕抓取器以便发送更有用的信息。"
161166

162167
#: ../../whatsnew/2.0.rst:95
163168
msgid ""
@@ -233,6 +238,8 @@ msgid ""
233238
"instead of the 8-bit number used by ASCII, meaning that 65,536 distinct "
234239
"characters can be supported."
235240
msgstr ""
241+
"Python 2.0 中最大的新特性是引入了一种新的基本数据类型:Unicode 字符串。 Unicode 使用 16 位二进制数表示字符,而不是 "
242+
"ASCII 所使用的 8 位,这意味着可以支持 65,536 个不同的字符。"
236243

237244
#: ../../whatsnew/2.0.rst:148
238245
msgid ""
@@ -243,6 +250,9 @@ msgid ""
243250
"was written up as :pep:`100`, \"Python Unicode Integration\". This article "
244251
"will simply cover the most significant points about the Unicode interfaces."
245252
msgstr ""
253+
"Unicode 支持的最终接口是通过在 python-dev 邮件列表上无数次激烈的讨论达成的,主要由 Marc-André Lemburg 基于 "
254+
"Fredrik Lundh 的 Unicode 字符串类型实现来完成。 详细的接口说明被写成了 :pep:`100` \"Python Unicode "
255+
"Integration\"。 这篇文章只简单地涵盖关于 Unicode 接口的最重要信息。"
246256

247257
#: ../../whatsnew/2.0.rst:155
248258
msgid ""
@@ -267,6 +277,11 @@ msgid ""
267277
"installation by calling the ``sys.setdefaultencoding(encoding)`` function in"
268278
" a customized version of :file:`site.py`."
269279
msgstr ""
280+
"Unicode 字符串和常规字符串一样,是一种不可变的序列类型。 它们可以被索引和切片,但不能原地修改。 Unicode 字符串有一个 "
281+
"``encode( [encoding] )`` 方法,该方法返回一个以所需编码格式表示的 8 位字符串。 编码格式通过字符串命名,如 "
282+
"``'ascii'``、``'utf-8'``、``'iso-8859-1'`` 等等。 为实现和注册新的编码格式定义了一个编解码器 "
283+
"API,这些编码格式随后可在整个 Python 程序中使用。 如果未指定编码格式,默认编码格式通常是 7 位 ASCII,不过这可以通过在自定义版本的 "
284+
":file:`site.py` 模块中调用 ``sys.setdefaultencoding(encoding)`` 函数来更改。"
270285

271286
#: ../../whatsnew/2.0.rst:172
272287
msgid ""
@@ -304,6 +319,10 @@ msgid ""
304319
"errors to be silently ignored and ``'replace'`` uses U+FFFD, the official "
305320
"replacement character, in case of any problems."
306321
msgstr ""
322+
"函数 ``unicode(string [, encoding] [, errors] )`` 从 8 位字符串创建一个 Unicode 字符串。 "
323+
"``encoding`` 是一个指定使用编码格式的字符串。``errors`` 参数指定如何处理当前编码格式中无效的字符;传入 ``'strict'``"
324+
" 作为参数值会在有任何编码错误时引发异常,而 ``'ignore'`` 会静默忽略错误,``'replace'`` 则在出现问题时使用 U+FFFD "
325+
"即官方的替换字符。"
307326

308327
#: ../../whatsnew/2.0.rst:192
309328
msgid ""
@@ -313,6 +332,8 @@ msgid ""
313332
"some built-ins; if you find a built-in function that accepts strings but "
314333
"doesn't accept Unicode strings at all, please report it as a bug.)"
315334
msgstr ""
335+
"``exec`` 语句,以及各种内置函数如 ``eval()``,``getattr()`` 和 ``setattr()`` 也会接受 Unicode "
336+
"字符串和普通字符串。 (修复过程中可能会遗漏一些内置函数;如果你发现一个接受字符串但完全不接受 Unicode 字符串的内置函数,请报告此错误。)"
316337

317338
#: ../../whatsnew/2.0.rst:198
318339
msgid ""
@@ -322,6 +343,10 @@ msgid ""
322343
"that it's uppercase. ``unicodedata.bidirectional(u'\\u0660')`` returns 'AN',"
323344
" meaning that U+0660 is an Arabic number."
324345
msgstr ""
346+
"一个新的模块 :mod:`unicodedata` 提供了对 Unicode 字符属性的接口。 "
347+
"例如,``unicodedata.category(u'A')`` 返回 2 个字符的字符串 'Lu',其中 'L' 表示这是一个字母,'u' "
348+
"表示这是一个大写字母。 ``unicodedata.bidirectional(u'\\u0660')`` 返回 'AN',表示 U+0660 "
349+
"是一个阿拉伯数字。"
325350

326351
#: ../../whatsnew/2.0.rst:204
327352
msgid ""
@@ -331,6 +356,9 @@ msgid ""
331356
"4-element tuple: ``(encode_func, decode_func, stream_reader, "
332357
"stream_writer)``."
333358
msgstr ""
359+
":mod:`codecs` 模块包含查找现有编码格式和注册新编码格式的函数。 除非你想实现一个新的编码格式,否则你最常使用的是 "
360+
"``codecs.lookup(encoding)`` 函数,它返回一个 4 元素的元组: ``(encode_func, decode_func, "
361+
"stream_reader, stream_writer)``。"
334362

335363
#: ../../whatsnew/2.0.rst:209
336364
msgid ""
@@ -340,6 +368,8 @@ msgid ""
340368
"encoding, and *length* tells you how much of the Unicode string was "
341369
"converted."
342370
msgstr ""
371+
"*encode_func* 是一个接受 Unicode 字符串的函数,并返回一个 2 元组 ``(string, length)``。 *string*"
372+
" 是一个包含部分(可能是全部) Unicode 字符串转换为指定编码的 8 位字符串,*length* 告诉你转换了多少 Unicode 字符串。"
343373

344374
#: ../../whatsnew/2.0.rst:214
345375
msgid ""
@@ -348,6 +378,8 @@ msgid ""
348378
"Unicode string *ustring* and the integer *length* telling how much of the "
349379
"8-bit string was consumed."
350380
msgstr ""
381+
"*decode_func* 与 *encode_func* 相反,它接受一个 8 位字符串并返回一个 2 元组 ``(ustring, "
382+
"length)``,其中 *ustring* 是转换得到的 Unicode 字符串,*length* 是一个整数,表示消耗了多少 8 位字符串。"
351383

352384
#: ../../whatsnew/2.0.rst:219
353385
msgid ""
@@ -369,18 +401,20 @@ msgstr ""
369401
msgid ""
370402
"For example, the following code writes a Unicode string into a file, "
371403
"encoding it as UTF-8::"
372-
msgstr ""
404+
msgstr "例如,以下的代码将 Unicode 字符串写入一个 UTF-8 编码的文件::"
373405

374406
#: ../../whatsnew/2.0.rst:243
375407
msgid "The following code would then read UTF-8 input from the file::"
376-
msgstr ""
408+
msgstr "以下的代码则可以从文件中读取 UTF-8 输入::"
377409

378410
#: ../../whatsnew/2.0.rst:249
379411
msgid ""
380412
"Unicode-aware regular expressions are available through the :mod:`re` "
381413
"module, which has a new underlying implementation called SRE written by "
382414
"Fredrik Lundh of Secret Labs AB."
383415
msgstr ""
416+
"支持 Unicode 的正则表达式可以通过 :mod:`re` 模块使用,该模块有一个新的底层实现称为 SRE,由 Secret Labs AB 的 "
417+
"Fredrik Lundh 编写。"
384418

385419
#: ../../whatsnew/2.0.rst:253
386420
msgid ""
@@ -390,6 +424,8 @@ msgid ""
390424
"future version of Python may drop support for 8-bit strings and provide only"
391425
" Unicode strings."
392426
msgstr ""
427+
"添加了一个 ``-U`` 命令行选项,使 Python 编译器将所有字符串字面量解释为 Unicode 字符串字面量。 这用于测试和为你的 Python"
428+
" 代码提供未来保障,因为未来某个版本的 Python 可能会取消对 8 位字符串的支持,只提供 Unicode 字符串。"
393429

394430
#: ../../whatsnew/2.0.rst:262
395431
msgid "List Comprehensions"
@@ -404,6 +440,9 @@ msgid ""
404440
"might want to pull out all the strings containing a given substring, or "
405441
"strip off trailing whitespace from each line."
406442
msgstr ""
443+
"列表是 Python 中的一种主力数据类型,许多程序在某个时候都会处理列表。 "
444+
"对列表的两种常见操作是遍历它们,并筛选出符合某个条件的元素,或对每个元素应用某个函数。 "
445+
"例如,给定一个字符串列表,你可能想要提取出所有包含特定子字符串的字符串,或去掉每行的尾随空白。"
407446

408447
#: ../../whatsnew/2.0.rst:271
409448
msgid ""
@@ -416,17 +455,23 @@ msgid ""
416455
"paragraph, finding all the strings in the list containing a given substring."
417456
" You could write the following to do it::"
418457
msgstr ""
458+
"现有的 :func:`map` 和 :func:`filter` 函数可以用于此目的,但它们需要一个函数作为参数之一。 "
459+
"如果有一个现有的内置函数可以直接传递,这是很好的,但如果没有,你必须创建一个小函数来完成所需的工作。 而 Python "
460+
"的作用域规则会使结果变得丑陋,特别是如果这个小函数需要额外的信息。 以上一段中的第一个例子为例,找到列表中所有包含给定子字符串的字符串。 "
461+
"你可以写如下代码来实现::"
419462

420463
#: ../../whatsnew/2.0.rst:286
421464
msgid ""
422465
"Because of Python's scoping rules, a default argument is used so that the "
423466
"anonymous function created by the :keyword:`lambda` expression knows what "
424467
"substring is being searched for. List comprehensions make this cleaner::"
425468
msgstr ""
469+
"由于 Python 的作用域规则,将会使用默认参数以使由 :keyword:`lambda` 表达式创建的匿名函数知道正在搜索哪个子字符串。 "
470+
"列表推导能使这个过程更简洁::"
426471

427472
#: ../../whatsnew/2.0.rst:292
428473
msgid "List comprehensions have the form::"
429-
msgstr ""
474+
msgstr "列表推导式的形式如下::"
430475

431476
#: ../../whatsnew/2.0.rst:299
432477
msgid ""
@@ -438,12 +483,15 @@ msgid ""
438483
":keyword:`!if` clause is optional; if present, *expression* is only "
439484
"evaluated and added to the result if *condition* is true."
440485
msgstr ""
486+
":keyword:`!for`...:keyword:`!in` 子句包含要迭代的序列。 这些序列不必具有相同的长度,因为它们 *不是* "
487+
"并行迭代的,而是从左到右依次迭代;这一点将在以下段落中更清楚地解释。 生成列表的元素将是 *表达式* 的连续值。 最后的 :keyword:`!if` "
488+
"子句是可选的;如果存在,只有当 *condition* 为真时,*表达式* 才会被求值并添加到结果中。"
441489

442490
#: ../../whatsnew/2.0.rst:307
443491
msgid ""
444492
"To make the semantics very clear, a list comprehension is equivalent to the "
445493
"following Python code::"
446-
msgstr ""
494+
msgstr "为了使语义更为清晰,列表推导相当于以下 Python 代码::"
447495

448496
#: ../../whatsnew/2.0.rst:319
449497
msgid ""
@@ -452,13 +500,17 @@ msgid ""
452500
"all the sequences. If you have two lists of length 3, the output list is 9 "
453501
"elements long::"
454502
msgstr ""
503+
"这意味着当有多个 :keyword:`!for`...:keyword:`!in` 子句时,生成的列表将等于所有序列长的的乘积。 如果你有两个长度为 3"
504+
" 的列表,输出列表将有 9 个元素::"
455505

456506
#: ../../whatsnew/2.0.rst:330
457507
msgid ""
458508
"To avoid introducing an ambiguity into Python's grammar, if *expression* is "
459509
"creating a tuple, it must be surrounded with parentheses. The first list "
460510
"comprehension below is a syntax error, while the second one is correct::"
461511
msgstr ""
512+
"为了避免在 Python 的语法中引入歧义,如果 *表达式* 创建的是一个元组,它必须用括号括起来。 "
513+
"下面的第一个列表推导式有语法错误,而第二个则是正确的::"
462514

463515
#: ../../whatsnew/2.0.rst:339
464516
msgid ""
@@ -468,10 +520,13 @@ msgid ""
468520
"comprehension patch, which was then discussed for a seemingly endless time "
469521
"on the python-dev mailing list and kept up-to-date by Skip Montanaro."
470522
msgstr ""
523+
"列表推导的概念最初来自函数式编程语言 Haskell (https://www.haskell.org)。 Greg Ewing "
524+
"最有力地提出了将其添加到 Python 中的建议,并编写了最初的列表推导式补丁,然后在 python-dev 邮件列表上进行了看似无休止的讨论,并由 "
525+
"Skip Montanaro 保持更新。"
471526

472527
#: ../../whatsnew/2.0.rst:349
473528
msgid "Augmented Assignment"
474-
msgstr ""
529+
msgstr "增强赋值"
475530

476531
#: ../../whatsnew/2.0.rst:351
477532
msgid ""
@@ -481,6 +536,8 @@ msgid ""
481536
" value of the variable ``a`` by 2, equivalent to the slightly lengthier ``a"
482537
" = a + 2``."
483538
msgstr ""
539+
"增强赋值运算符,另一个长期以来要求添加的功能,已经被加入到 Python 2.0 中。 增强赋值运算符包括 ``+=``,``-=``,``*=`` "
540+
"等。例如,语句 ``a += 2`` 将变量 ``a`` 的值增加 2,等同于稍长一些的 ``a = a + 2``。"
484541

485542
#: ../../whatsnew/2.0.rst:356
486543
msgid ""

0 commit comments

Comments
 (0)