Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteff3cdc

Browse files
[po] auto sync
1 parenteff5cc3 commiteff3cdc

File tree

3 files changed

+247
-59
lines changed

3 files changed

+247
-59
lines changed

‎.stat.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation":"82.06%","updated_at":"2025-09-23T14:19:13Z"}
1+
{"translation":"82.74%","updated_at":"2025-09-24T12:20:29Z"}

‎whatsnew/2.4.po‎

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version:Python 3.9\n"
1313
"Report-Msgid-Bugs-To:\n"
14-
"POT-Creation-Date:2025-01-03 16:35+0000\n"
14+
"POT-Creation-Date:2025-09-23 17:40+0000\n"
1515
"PO-Revision-Date:2025-09-22 17:56+0000\n"
1616
"Last-Translator:python-doc bot, 2025\n"
1717
"Language-Team:Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -1382,6 +1382,8 @@ msgid ""
13821382
"primary effect is to make :file:`.pyc` files significantly smaller. "
13831383
"(Contributed by Martin von Löwis.)"
13841384
msgstr""
1385+
":mod:`marshal` 模块现在在解包数据结构时共享内部字符串。这可能会缩小某些 pickle 字符串的大小,但主要效果是使 "
1386+
":file:`.pyc` 文件显著变小。(由 Martin von Löwis 贡献。)"
13851387

13861388
#:../../whatsnew/2.4.rst:1194
13871389
msgid""
@@ -1398,6 +1400,9 @@ msgid ""
13981400
" or item; these callables make excellent data extractors when used with "
13991401
":func:`map` or :func:`sorted`. For example::"
14001402
msgstr""
1403+
":mod:`operator` 模块新增了两个函数,``attrgetter(attr)`` 和 "
1404+
"``itemgetter(index)``。这两个函数都返回一个接受单个参数并返回相应属性或项的可调用对象;这些可调用对象在与 :func:`map` "
1405+
"或 :func:`sorted` 一起使用时,是非常优秀的数据提取器。例如:"
14011406

14021407
#:../../whatsnew/2.4.rst:1214
14031408
msgid""
@@ -1407,6 +1412,9 @@ msgid ""
14071412
" can now include the string ``'%default'``, which will be replaced by the "
14081413
"option's default value. (Contributed by Greg Ward.)"
14091414
msgstr""
1415+
":mod:`optparse` 模块进行了多项更新。该模块现在通过 :func:`gettext.gettext` 传递其消息,使得可以国际化 "
1416+
"Optik 的帮助和错误消息。选项的帮助消息现在可以包含字符串 ``'%default'``,该字符串将被选项的默认值替换。(由 Greg Ward "
1417+
"贡献。)"
14101418

14111419
#:../../whatsnew/2.4.rst:1220
14121420
msgid""
@@ -1425,6 +1433,8 @@ msgid ""
14251433
"to platform-specific sources of randomness such as :file:`/dev/urandom` on "
14261434
"Linux or the Windows CryptoAPI. (Contributed by Trevor Perrin.)"
14271435
msgstr""
1436+
":mod:`os` 模块新增了 ``urandom(n)`` 函数,返回一个包含 *n* 字节随机数据的字符串。该函数提供了对平台特定随机源(如 "
1437+
"Linux 上的 :file:`/dev/urandom` 或 Windows CryptoAPI)的访问。(由 Trevor Perrin 贡献。)"
14281438

14291439
#:../../whatsnew/2.4.rst:1231
14301440
msgid""
@@ -1434,6 +1444,9 @@ msgid ""
14341444
"false if *path* is a symlink that points to a destination that doesn't "
14351445
"exist. (Contributed by Beni Cherniavsky.)"
14361446
msgstr""
1447+
"另一个新函数:``os.path.lexists(path)`` 如果指定的文件存在(无论是否为符号链接)则返回 true。这与现有的 "
1448+
"``os.path.exists(path)`` 函数不同,后者在 *path* 是指向不存在目标的符号链接时返回 false。(由 Beni "
1449+
"Cherniavsky 贡献。)"
14371450

14381451
#:../../whatsnew/2.4.rst:1237
14391452
msgid""
@@ -1462,6 +1475,9 @@ msgid ""
14621475
"arbitrarily large random numbers more efficient. (Contributed by Raymond "
14631476
"Hettinger.)"
14641477
msgstr""
1478+
":mod:`random` 模块有一个新方法 ``getrandbits(N)``,返回一个长度为 *N* 位的长整数。现有的 "
1479+
":meth:`randrange` 方法现在在适当的情况下使用 :meth:`getrandbits`,使得生成任意大的随机数更加高效。(由 "
1480+
"Raymond Hettinger 贡献。)"
14651481

14661482
#:../../whatsnew/2.4.rst:1252
14671483
msgid""
@@ -1473,6 +1489,9 @@ msgid ""
14731489
"string; if the group didn't match, the pattern *B* will be used instead. "
14741490
"(Contributed by Gustavo Niemeyer.)"
14751491
msgstr""
1492+
":mod:`re` 模块接受的正则表达式语言扩展了简单的条件表达式,写作 ``(?(group)A|B)``。*group* 可以是数字组 ID 或用 "
1493+
"``(?P<group>...)`` 在表达式中提前定义的组名。如果指定的组匹配,正则表达式模式 *A* 将被用于测试字符串;如果组未匹配,则使用模式 "
1494+
"*B*。(由 Gustavo Niemeyer 贡献。)"
14761495

14771496
#:../../whatsnew/2.4.rst:1259
14781497
msgid""
@@ -1487,6 +1506,10 @@ msgid ""
14871506
"segfault. Python 2.4's regular expression engine can match this pattern "
14881507
"without problems."
14891508
msgstr""
1509+
"由于 Gustavo Niemeyer 大量工作,:mod:`re` 模块也不再是递归的。在递归正则表达式引擎中,某些模式会导致大量 C "
1510+
"栈空间被消耗,甚至可能溢出栈。例如,如果你将一个 30000 字节的 ``a`` 字符串与表达式 ``(a|b)+`` "
1511+
"匹配,每个字符会消耗一个栈帧。Python 2.3 试图检查栈溢出并抛出 :exc:`RuntimeError` "
1512+
"异常,但某些模式可以绕过检查,如果你运气不好,Python 可能会段错误。Python 2.4 的正则表达式引擎可以无问题地匹配此模式。"
14901513

14911514
#:../../whatsnew/2.4.rst:1269
14921515
msgid""
@@ -1496,6 +1519,9 @@ msgid ""
14961519
"would quietly accept this, but 2.4 will raise a :exc:`RuntimeError` "
14971520
"exception."
14981521
msgstr""
1522+
":mod:`signal` 模块现在对 :func:`signal.signal` 函数的参数进行更严格的错误检查。例如,你不能在 "
1523+
":const:`SIGKILL` 信号上设置处理程序;之前的 Python 版本会默默接受这一点,但 2.4 版本将引发一个 "
1524+
":exc:`RuntimeError` 异常。"
14991525

15001526
#:../../whatsnew/2.4.rst:1274
15011527
msgid""
@@ -1504,6 +1530,8 @@ msgid ""
15041530
"the service name for a given port number. (Contributed by Dave Cole and "
15051531
"Barry Warsaw.)"
15061532
msgstr""
1533+
":mod:`socket` 模块新增了两个函数。:func:`socketpair` 返回一对已连接的套接字,而 "
1534+
"``getservbyport(port)`` 用于查找给定端口号的服务名称。(由 Dave Cole 和 Barry Warsaw 贡献。)"
15071535

15081536
#:../../whatsnew/2.4.rst:1279
15091537
msgid""
@@ -1512,6 +1540,8 @@ msgid ""
15121540
" exit functions. Eventually :func:`sys.exitfunc` will become a purely "
15131541
"internal interface, accessed only by :mod:`atexit`."
15141542
msgstr""
1543+
":func:`sys.exitfunc` 函数已被弃用。代码应使用现有的 :mod:`atexit` 模块,它能正确处理调用多个退出函数。最终 "
1544+
":func:`sys.exitfunc` 将成为一个纯内部接口,仅由 :mod:`atexit` 访问。"
15151545

15161546
#:../../whatsnew/2.4.rst:1284
15171547
msgid""
@@ -1525,20 +1555,26 @@ msgid ""
15251555
"thread-local data. The module contains a :class:`local` class whose "
15261556
"attribute values are local to different threads. ::"
15271557
msgstr""
1558+
":mod:`threading` 模块现在有了一种优雅简洁的方式来支持线程本地数据。该模块包含一个 :class:`local` "
1559+
"类,其属性值对不同线程是本地的。::"
15281560

15291561
#:../../whatsnew/2.4.rst:1297
15301562
msgid""
15311563
"Other threads can assign and retrieve their own values for the "
15321564
":attr:`number` and :attr:`url` attributes. You can subclass :class:`local` "
15331565
"to initialize attributes or to add methods. (Contributed by Jim Fulton.)"
15341566
msgstr""
1567+
"其他线程可以为 :attr:`number` 和 :attr:`url` 属性分配和检索它们自己的值。你可以子类化 :class:`local` "
1568+
"来初始化属性或添加方法。(由 Jim Fulton 贡献。)"
15351569

15361570
#:../../whatsnew/2.4.rst:1301
15371571
msgid""
15381572
"The :mod:`timeit` module now automatically disables periodic garbage "
15391573
"collection during the timing loop. This change makes consecutive timings "
15401574
"more comparable. (Contributed by Raymond Hettinger.)"
15411575
msgstr""
1576+
":mod:`timeit` 模块现在在计时循环中自动禁用周期性垃圾收集。这一改变使得连续计时更具可比性。(由 Raymond Hettinger "
1577+
"贡献。)"
15421578

15431579
#:../../whatsnew/2.4.rst:1305
15441580
msgid""
@@ -1547,6 +1583,8 @@ msgid ""
15471583
"sockets, and regular expression pattern objects. (Contributed by Raymond "
15481584
"Hettinger.)"
15491585
msgstr""
1586+
":mod:`weakref` 模块现在支持更多种类的对象,包括 Python "
1587+
"函数、类实例、集合、冻结集合、双端队列、数组、文件、套接字和正则表达式模式对象。(由 Raymond Hettinger 贡献。)"
15501588

15511589
#:../../whatsnew/2.4.rst:1310
15521590
msgid""
@@ -1582,6 +1620,8 @@ msgid ""
15821620
"applications can use the Mozilla or Lynx cookie files, and one that stores "
15831621
"cookies in the same format as the Perl libwww library."
15841622
msgstr""
1623+
"为了跨会话存储 Cookie,提供了两种 Cookie 罐的实现:一种以 Netscape 格式存储 Cookie,以便应用程序可以使用 Mozilla"
1624+
" 或 Lynx 的 Cookie 文件,另一种以与 Perl libwww 库相同的格式存储 Cookie。"
15851625

15861626
#:../../whatsnew/2.4.rst:1337
15871627
msgid""
@@ -1605,22 +1645,24 @@ msgid ""
16051645
":func:`doctest.testmod`, but the refactorings allow customizing the module's"
16061646
" operation in various ways"
16071647
msgstr""
1648+
"由于 Edward Loper 和 Tim Peters 的贡献,:mod:`doctest` 模块进行了大量重构。测试仍然可以简单到只需运行 "
1649+
":func:`doctest.testmod`,但重构允许以各种方式自定义模块的操作。"
16081650

16091651
#:../../whatsnew/2.4.rst:1354
16101652
msgid""
16111653
"The new :class:`DocTestFinder` class extracts the tests from a given "
16121654
"object's docstrings::"
1613-
msgstr""
1655+
msgstr"新的 :class:`DocTestFinder` 类从给定对象的文档字符串中提取测试:"
16141656

16151657
#:../../whatsnew/2.4.rst:1370
16161658
msgid""
16171659
"The new :class:`DocTestRunner` class then runs individual tests and can "
16181660
"produce a summary of the results::"
1619-
msgstr""
1661+
msgstr"新的 :class:`DocTestRunner` 类然后运行单个测试并可以生成结果摘要:"
16201662

16211663
#:../../whatsnew/2.4.rst:1379
16221664
msgid"The above example produces the following output::"
1623-
msgstr""
1665+
msgstr"上述示例生成以下输出:"
16241666

16251667
#:../../whatsnew/2.4.rst:1387
16261668
msgid""
@@ -1629,6 +1671,9 @@ msgid ""
16291671
"number of different flags that customize its behaviour; ambitious users can "
16301672
"also write a completely new subclass of :class:`OutputChecker`."
16311673
msgstr""
1674+
":class:`DocTestRunner` 使用一个 :class:`OutputChecker` "
1675+
"类的实例来比较预期输出和实际输出。这个类接受多个不同的标志来定制其行为;有野心的用户也可以编写一个全新的 :class:`OutputChecker` "
1676+
"子类。"
16321677

16331678
#:../../whatsnew/2.4.rst:1392
16341679
msgid""
@@ -1637,10 +1682,12 @@ msgid ""
16371682
"the expected output matches any substring, making it easier to accommodate "
16381683
"outputs that vary in minor ways::"
16391684
msgstr""
1685+
"默认的输出检查器提供了一些方便的功能。例如,使用 :const:`doctest.ELLIPSIS` "
1686+
"选项标志,预期输出中的省略号(``...``)可以匹配任何子字符串,这使得更容易适应在细小方面有所变化的输出::"
16401687

16411688
#:../../whatsnew/2.4.rst:1403
16421689
msgid"Another special string, ``<BLANKLINE>``, matches a blank line::"
1643-
msgstr""
1690+
msgstr"另一个特殊字符串,``<BLANKLINE>``, 匹配一个空行::"
16441691

16451692
#:../../whatsnew/2.4.rst:1411
16461693
msgid""
@@ -1649,12 +1696,15 @@ msgid ""
16491696
":const:`doctest.REPORT_CDIFF` (context diffs), or "
16501697
":const:`doctest.REPORT_NDIFF` (delta-style) option flags. For example::"
16511698
msgstr""
1699+
"另一个新功能是通过指定 :const:`doctest.REPORT_UDIFF` (统一差异) "
1700+
"、:const:`doctest.REPORT_CDIFF` (上下文差异) 或 :const:`doctest.REPORT_NDIFF` "
1701+
"(增量式差异) 选项标志,生成输出差异风格的显示。例如::"
16521702

16531703
#:../../whatsnew/2.4.rst:1427
16541704
msgid""
16551705
"Running the above function's tests with :const:`doctest.REPORT_UDIFF` "
16561706
"specified, you get the following output:"
1657-
msgstr""
1707+
msgstr"在指定 :const:`doctest.REPORT_UDIFF` 的情况下运行上述函数的测试,你会得到以下输出:"
16581708

16591709
#:../../whatsnew/2.4.rst:1448
16601710
msgid"Build and C API Changes"
@@ -1670,6 +1720,8 @@ msgid ""
16701720
"extension functions: :c:macro:`Py_RETURN_NONE`, :c:macro:`Py_RETURN_TRUE`, "
16711721
"and :c:macro:`Py_RETURN_FALSE`. (Contributed by Brett Cannon.)"
16721722
msgstr""
1723+
"为常见扩展函数返回值添加了三个新的便利宏::c:macro:`Py_RETURN_NONE`、:c:macro:`Py_RETURN_TRUE` 和 "
1724+
":c:macro:`Py_RETURN_FALSE`。(由 Brett Cannon 贡献。)"
16731725

16741726
#:../../whatsnew/2.4.rst:1456
16751727
msgid""
@@ -1683,13 +1735,17 @@ msgid ""
16831735
"tuples from a variable length argument list of Python objects. (Contributed"
16841736
" by Raymond Hettinger.)"
16851737
msgstr""
1738+
"一个新的函数 ``PyTuple_Pack(N, obj1, obj2, ..., "
1739+
"objN)``,可以从一个可变长度的Python对象参数列表中构造元组。(由Raymond Hettinger贡献。)"
16861740

16871741
#:../../whatsnew/2.4.rst:1463
16881742
msgid""
16891743
"A new function, ``PyDict_Contains(d, k)``, implements fast dictionary "
16901744
"lookups without masking exceptions raised during the look-up process. "
16911745
"(Contributed by Raymond Hettinger.)"
16921746
msgstr""
1747+
"一个新的函数 ``PyDict_Contains(d, k)``,实现了快速的字典查找,而不会掩盖查找过程中引发的异常。(由Raymond "
1748+
"Hettinger贡献。)"
16931749

16941750
#:../../whatsnew/2.4.rst:1467
16951751
msgid""
@@ -1711,6 +1767,9 @@ msgid ""
17111767
":c:func:`PyArg_ParseTupleAndKeywords` but takes a :c:type:`va_list` instead"
17121768
" of a number of arguments. (Contributed by Greg Chapman.)"
17131769
msgstr""
1770+
"一个新的函数 :c:func:`PyArg_VaParseTupleAndKeywords`,与 "
1771+
":c:func:`PyArg_ParseTupleAndKeywords` 相同,但接受一个 :c:type:`va_list` "
1772+
"而不是参数数量。(由Greg Chapman贡献。)"
17141773

17151774
#:../../whatsnew/2.4.rst:1479
17161775
msgid""
@@ -1732,6 +1791,11 @@ msgid ""
17321791
"platform, though that processor architecture doesn't call that register "
17331792
"\"the TSC register\". (Contributed by Jeremy Hylton.)"
17341793
msgstr""
1794+
"Python现在可以内置对解释器本身的额外分析功能,旨在帮助开发Python核心的人员。向 :program:`configure` 脚本提供 "
1795+
":option:`!--enable-profiling` 选项将允许您使用 :program:`gprof` 对解释器进行分析,提供 "
1796+
":option:`!--with-tsc` 开关则启用使用Pentium的时间戳计数器寄存器进行分析。请注意,:option:`!--with-tsc`"
1797+
" 开关命名略有不当,因为该分析功能在PowerPC平台上也能工作,尽管该处理器架构不将该寄存器称为“TSC寄存器”。(由Jeremy "
1798+
"Hylton贡献。)"
17351799

17361800
#:../../whatsnew/2.4.rst:1494
17371801
msgid""
@@ -1747,7 +1811,7 @@ msgstr "移植专属的改变"
17471811
msgid""
17481812
"The Windows port now builds under MSVC++ 7.1 as well as version 6. "
17491813
"(Contributed by Martin von Löwis.)"
1750-
msgstr""
1814+
msgstr"Windows端口现在可以在MSVC++ 7.1以及版本6下构建。(由Martin von Löwis贡献。)"
17511815

17521816
#:../../whatsnew/2.4.rst:1510
17531817
msgid"Porting to Python 2.4"
@@ -1765,13 +1829,16 @@ msgid ""
17651829
"trigger a :exc:`FutureWarning` and return a value limited to 32 or 64 bits;"
17661830
" instead they return a long integer."
17671831
msgstr""
1832+
"左移操作和过大的十六进制/八进制常量不再触发 :exc:`FutureWarning`,并且返回一个限制在32或64位的值;相反,它们返回一个长整数。"
17681833

17691834
#:../../whatsnew/2.4.rst:1522
17701835
msgid""
17711836
"The :func:`zip` built-in function and :func:`itertools.izip` now return an "
17721837
"empty list instead of raising a :exc:`TypeError` exception if called with no"
17731838
" arguments."
17741839
msgstr""
1840+
":func:`zip` 内置函数和 :func:`itertools.izip` 现在在无参数调用时返回一个空列表,而不是抛出 "
1841+
":exc:`TypeError` 异常。"
17751842

17761843
#:../../whatsnew/2.4.rst:1526
17771844
msgid""
@@ -1780,6 +1847,8 @@ msgid ""
17801847
"different classes will now always be unequal, and relative comparisons "
17811848
"(``<``, ``>``) will raise a :exc:`TypeError`."
17821849
msgstr""
1850+
"您不能再比较由 :mod:`datetime` 模块提供的 :class:`date` 和 :class:`~datetime.datetime` "
1851+
"实例。不同类的两个实例现在将始终不相等,并且相对比较(``<``,``>``)将抛出 :exc:`TypeError`。"
17831852

17841853
#:../../whatsnew/2.4.rst:1531
17851854
msgid""
@@ -1793,6 +1862,7 @@ msgid ""
17931862
" the wrong order. This has been corrected; applications relying on the "
17941863
"wrong order need to be fixed."
17951864
msgstr""
1865+
":func:`LexicalHandler.startDTD` 过去接收公共和系统 ID 的顺序错误。这已被纠正;依赖错误顺序的应用程序需要修复。"
17961866

17971867
#:../../whatsnew/2.4.rst:1538
17981868
msgid""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp