9
9
# Shengjing Zhu <zsj950618@gmail.com>, 2020
10
10
# zeroswan <zeroswan@outlook.com>, 2020
11
11
# Rafael Fontenelle <rffontenelle@gmail.com>, 2023
12
+ # Alpha Du <alphanow@gmail.com>, 2024
12
13
# Freesand Leo <yuqinju@163.com>, 2024
13
14
#
14
15
#, fuzzy
15
16
msgid ""
16
17
msgstr ""
17
18
"Project-Id-Version : Python 3.9\n "
18
19
"Report-Msgid-Bugs-To : \n "
19
- "POT-Creation-Date : 2024-02-16 21:12 +0000\n "
20
+ "POT-Creation-Date : 2024-03-01 21:26 +0000\n "
20
21
"PO-Revision-Date : 2017-02-16 23:43+0000\n "
21
22
"Last-Translator : Freesand Leo <yuqinju@163.com>, 2024\n "
22
23
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -54,6 +55,10 @@ msgid ""
54
55
":class:`~collections.Counter` classes in the :mod:`collections` module, and "
55
56
"many other improvements."
56
57
msgstr ""
58
+ "数字处理在许多方面得到了改进,包括浮点数和 :class:`~decimal.Decimal` 类。标准库中有一些有用的补充,例如大大增强的 "
59
+ ":mod:`unittest` 模块,用于解析命令行选项的 :mod:`argparse` 模块,在 :mod:`collections` 模块中方便的"
60
+ " :class:`~collections.OrderedDict` 和 :class:`~collections.Counter` "
61
+ "类,以及许多其他改进。"
57
62
58
63
#: ../../whatsnew/2.7.rst:63
59
64
msgid ""
@@ -62,6 +67,8 @@ msgid ""
62
67
"3, several new features from the Python 3.x series have been included in "
63
68
"2.7."
64
69
msgstr ""
70
+ "Python 2.7计划成为2.x版本的最后一个发布版本,因此我们努力使其成为长期支持的好版本。为了帮助迁移到Python "
71
+ "3,我们在2.7中包含了几个来自Python 3.x系列的新特性。"
65
72
66
73
#: ../../whatsnew/2.7.rst:68
67
74
msgid ""
@@ -74,6 +81,9 @@ msgid ""
74
81
"Whenever possible, \" What's New in Python\" links to the bug/patch item for "
75
82
"each change."
76
83
msgstr ""
84
+ "本文并不试图提供新特性的完整规范说明,而是提供一个方便的概览。要了解完整的细节,请参阅Python "
85
+ "2.7的文档。如果你想了解有关设计和实现的具体考量,请参阅特定新特性的PEP或在https://bugs.python.org上讨论更改的问题。在可能的情况下,“What's"
86
+ " New in Python”链接到每个更改的错误修正/补丁项。"
77
87
78
88
#: ../../whatsnew/2.7.rst:80
79
89
msgid "The Future for Python 2.x"
@@ -186,13 +196,18 @@ msgid ""
186
196
" in the branch that became Python 3.2. (Discussed on stdlib-sig and carried "
187
197
"out in :issue:`7319`.)"
188
198
msgstr ""
199
+ "对于Python 2.7,一个策略决定是默认情况下禁止只对开发人员有兴趣的警告。 现在,除非另有要求,否则将忽略 "
200
+ ":exc:`DeprecationWarning` 及其子类,以防止用户看到应用程序触发的警告。 这个更改也在成为Python 3.2 "
201
+ "的分歧点上进行了。 (在 stdlib-sig 上进行了讨论,并在 :issue:`7319` 中执行。)"
189
202
190
203
#: ../../whatsnew/2.7.rst:146
191
204
msgid ""
192
205
"In previous releases, :exc:`DeprecationWarning` messages were enabled by "
193
206
"default, providing Python developers with a clear indication of where their "
194
207
"code may break in a future major version of Python."
195
208
msgstr ""
209
+ "在以前的版本中,默认情况下启用了 :exc:`DeprecationWarning` 消息,为 Python "
210
+ "开发人员提供了一个明确的指示,说明他们的代码可能在未来的 Python 主要版本中出现问题。"
196
211
197
212
#: ../../whatsnew/2.7.rst:151
198
213
msgid ""
@@ -202,6 +217,8 @@ msgid ""
202
217
" worry about an application that's actually working correctly and burdening "
203
218
"application developers with responding to these concerns."
204
219
msgstr ""
220
+ "然而,越来越多基于 Python 的应用程序的用户并不直接参与这些应用程序的开发。:exc:`DeprecationWarning` "
221
+ "消息与这些用户无关,这让他们担心应用能否真正正常工作,并让应用开发人员承担起回应这些担忧的负担。"
205
222
206
223
#: ../../whatsnew/2.7.rst:158
207
224
msgid ""
@@ -211,12 +228,16 @@ msgid ""
211
228
"``\" default\" `` (or ``\" d\" ``) before running Python. Python code can also "
212
229
"re-enable them by calling ``warnings.simplefilter('default')``."
213
230
msgstr ""
231
+ "显示通过使用 :option:`-Wdefault<-W>` (简写: :option:`-Wd<-W>`) 开关运行 Python,或者在运行 "
232
+ "Python 之前将 :envvar:`PYTHONWARNINGS` 环境变量设置为 ``\" default\" `` (或 "
233
+ "``\" d\" ``),可以重新启用 :exc:`DeprecationWarning` 消息。 Python 代码也可以通过调用 "
234
+ "``warnings.simplefilter('default')`` 重新启用它们。"
214
235
215
236
#: ../../whatsnew/2.7.rst:165
216
237
msgid ""
217
238
"The ``unittest`` module also automatically reenables deprecation warnings "
218
239
"when running tests."
219
- msgstr ""
240
+ msgstr "``unittest`` 模块还会在运行测试时自动重新启用弃用警告。 "
220
241
221
242
#: ../../whatsnew/2.7.rst:170
222
243
msgid "Python 3.1 Features"
@@ -277,25 +298,27 @@ msgid ""
277
298
" in previous versions of Python, it's guaranteed that ``float(repr(x))`` "
278
299
"recovers ``x``."
279
300
msgstr ""
301
+ "在很多情况下,浮点数 ``x`` 的 :func:`repr` 更短:现在它基于最短的十进制字符串 ,保证四舍五入到 ``x``。 与 Python "
302
+ "以前的版本一样,保证 ``float(repr(x))`` 能恢复到 ``x``。"
280
303
281
304
#: ../../whatsnew/2.7.rst:192
282
305
msgid ""
283
306
"Float-to-string and string-to-float conversions are correctly rounded. The "
284
307
":func:`round` function is also now correctly rounded."
285
- msgstr ""
308
+ msgstr "浮点数到字符串和字符串到浮点数的转换已正确舍入。:func:`round` 函数现在也能正确舍入。 "
286
309
287
310
#: ../../whatsnew/2.7.rst:194
288
311
msgid ""
289
312
"The :c:type:`PyCapsule` type, used to provide a C API for extension modules."
290
- msgstr ""
313
+ msgstr ":c:type:`PyCapsule` 类型,用于为扩展模块提供 C API 。 "
291
314
292
315
#: ../../whatsnew/2.7.rst:195
293
316
msgid "The :c:func:`PyLong_AsLongAndOverflow` C API function."
294
- msgstr ""
317
+ msgstr ":c:func:`PyLong_AsLongAndOverflow` C API 函数 。 "
295
318
296
319
#: ../../whatsnew/2.7.rst:197
297
320
msgid "Other new Python3-mode warnings include:"
298
- msgstr ""
321
+ msgstr "其他新的 Python3 模式警告包括: "
299
322
300
323
#: ../../whatsnew/2.7.rst:199
301
324
msgid ""
@@ -309,10 +332,11 @@ msgid ""
309
332
"switch that causes warnings about using classic division with integers and "
310
333
"long integers."
311
334
msgstr ""
335
+ ":option:`!-3` 开关现在会自动启用:option:`!-Qwarn` 开关,该开关会在使用经典整除法处理整数和长整数时发出警告。"
312
336
313
337
#: ../../whatsnew/2.7.rst:214
314
338
msgid "PEP 372: Adding an Ordered Dictionary to collections"
315
- msgstr ""
339
+ msgstr "PEP 372:将有序字典 添加到收藏集 "
316
340
317
341
#: ../../whatsnew/2.7.rst:216
318
342
msgid ""
@@ -323,23 +347,27 @@ msgid ""
323
347
"introduces a new :class:`~collections.OrderedDict` class in the "
324
348
":mod:`collections` module."
325
349
msgstr ""
350
+ "常规 Python 字典以任意顺序遍历键/值对。 多年来,许多作者编写了替代实现,以记住键最初插入的顺序。 基于这些实现的经验,2.7 在 "
351
+ ":mod:`collections` 模块 中引入了一个新的 :class:`~collections.OrderedDict` 类。"
326
352
327
353
#: ../../whatsnew/2.7.rst:222
328
354
msgid ""
329
355
"The :class:`~collections.OrderedDict` API provides the same interface as "
330
356
"regular dictionaries but iterates over keys and values in a guaranteed order"
331
357
" depending on when a key was first inserted::"
332
358
msgstr ""
359
+ ":class:`~collections.OrderedDict` API 提供与普通字典相同的接口 "
360
+ ",但会根据键首次插入的时间,按一定顺序遍历键和值::"
333
361
334
362
#: ../../whatsnew/2.7.rst:233
335
363
msgid ""
336
364
"If a new entry overwrites an existing entry, the original insertion position"
337
365
" is left unchanged::"
338
- msgstr ""
366
+ msgstr "如果新条目覆盖了现有条目,则原插入位置保持不变 :: "
339
367
340
368
#: ../../whatsnew/2.7.rst:240
341
369
msgid "Deleting an entry and reinserting it will move it to the end::"
342
- msgstr ""
370
+ msgstr "删除条目并重新插入会将其移至末尾 :: "
343
371
344
372
#: ../../whatsnew/2.7.rst:247
345
373
msgid ""
@@ -348,18 +376,20 @@ msgid ""
348
376
"added key is returned and removed; if it's false, the oldest key is "
349
377
"selected::"
350
378
msgstr ""
379
+ ":meth:`~collections.OrderedDict.popitem` 方法有一个可选 *last* 参数 ,默认为 ``True`` 。如果"
380
+ " *last* 为真 ,则返回并删除最近添加的密钥;如果为 false ,则选择最旧的密钥: :"
351
381
352
382
#: ../../whatsnew/2.7.rst:262
353
383
msgid ""
354
384
"Comparing two ordered dictionaries checks both the keys and values, and "
355
385
"requires that the insertion order was the same::"
356
- msgstr ""
386
+ msgstr "比较两个有序字典会同时检查键和值,并要求插入顺序相同 :: "
357
387
358
388
#: ../../whatsnew/2.7.rst:278
359
389
msgid ""
360
390
"Comparing an :class:`~collections.OrderedDict` with a regular dictionary "
361
391
"ignores the insertion order and just compares the keys and values."
362
- msgstr ""
392
+ msgstr "将 :class:`~collections.OrderedDict` 与普通字典进行比较时,会忽略插入顺序,只比较键和值。 "
363
393
364
394
#: ../../whatsnew/2.7.rst:281
365
395
msgid ""
@@ -373,7 +403,7 @@ msgstr ""
373
403
msgid ""
374
404
"The standard library now supports use of ordered dictionaries in several "
375
405
"modules."
376
- msgstr ""
406
+ msgstr "现在,标准库支持在多个模块 中使用有序字典。 "
377
407
378
408
#: ../../whatsnew/2.7.rst:290
379
409
msgid ""
@@ -388,6 +418,9 @@ msgid ""
388
418
":func:`collections.namedtuple` now returns an ordered dictionary with the "
389
419
"values appearing in the same order as the underlying tuple indices."
390
420
msgstr ""
421
+ ":func:`collections.namedtuple` 的 "
422
+ ":meth:`~collections.somenamedtuple._asdict()` "
423
+ "方法现在会返回一个有序字典,其值的出现顺序与底层元组的索引相同。"
391
424
392
425
#: ../../whatsnew/2.7.rst:298
393
426
msgid ""
@@ -417,6 +450,8 @@ msgid ""
417
450
"large numbers, rendering them as 18,446,744,073,709,551,616 instead of "
418
451
"18446744073709551616."
419
452
msgstr ""
453
+ "为了使程序输出更易读,可以在大数字上添加分隔符,将其显示为 18,446,744,073,709,551,616 而不是 "
454
+ "18446744073709551616。"
420
455
421
456
#: ../../whatsnew/2.7.rst:319
422
457
msgid ""
@@ -426,17 +461,20 @@ msgid ""
426
461
"unsuitable for multi-threaded applications where different threads are "
427
462
"producing output for different locales."
428
463
msgstr ""
464
+ "完全通用的解决方案是 :mod:`locale` 模块 ,它可以使用不同的分隔符(北美为\" ,\" ,欧洲为\" .\" )和不同的分组大小,但 "
465
+ ":mod:`locale` 使用起来比较复杂,而且不适合多线程应用程序,因为不同的线程会为不同的本地生成输出。"
429
466
430
467
#: ../../whatsnew/2.7.rst:325
431
468
msgid ""
432
469
"Therefore, a simple comma-grouping mechanism has been added to the mini-"
433
470
"language used by the :meth:`str.format` method. When formatting a floating-"
434
471
"point number, simply include a comma between the width and the precision::"
435
472
msgstr ""
473
+ "因此,在 :meth:`str.format` 方法使用的迷你语言中添加了一个简单的逗号分组机制。 在格式化浮点数时,只需在宽度和精度之间加上逗号 ::"
436
474
437
475
#: ../../whatsnew/2.7.rst:333
438
476
msgid "When formatting an integer, include the comma after the width:"
439
- msgstr ""
477
+ msgstr "格式化整数时,在宽度后面加上逗号: "
440
478
441
479
#: ../../whatsnew/2.7.rst:338
442
480
msgid ""
@@ -445,6 +483,7 @@ msgid ""
445
483
"formatting mechanism isn't as general as the :mod:`locale` module, but it's "
446
484
"easier to use."
447
485
msgstr ""
486
+ "这种机制完全没有适应性;逗号总是用作分隔符,分组总是以三位数为一组。 逗号格式机制不如 :mod:`locale` 模块通用,但使用起来更方便。"
448
487
449
488
#: ../../whatsnew/2.7.rst:345
450
489
msgid ":pep:`378` - Format Specifier for Thousands Separator"
@@ -456,13 +495,13 @@ msgstr "PEP 由 Raymond Hettinger 撰写,由 Eric Smith 实现"
456
495
457
496
#: ../../whatsnew/2.7.rst:349
458
497
msgid "PEP 389: The argparse Module for Parsing Command Lines"
459
- msgstr ""
498
+ msgstr "PEP 389:用于解析命令行的 argparse 模块 "
460
499
461
500
#: ../../whatsnew/2.7.rst:351
462
501
msgid ""
463
502
"The :mod:`argparse` module for parsing command-line arguments was added as a"
464
503
" more powerful replacement for the :mod:`optparse` module."
465
- msgstr ""
504
+ msgstr "用于解析命令-line参数的 :mod:`argparse` 模块是作为 :mod:`optparse` 模块更强大的替代功能而添加的。 "
466
505
467
506
#: ../../whatsnew/2.7.rst:355
468
507
msgid ""
0 commit comments