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