@@ -12,7 +12,7 @@ msgid ""
12
12
msgstr ""
13
13
"Project-Id-Version :Python 3.10\n "
14
14
"Report-Msgid-Bugs-To :\n "
15
- "POT-Creation-Date :2025-04-25 16:05 +0000\n "
15
+ "POT-Creation-Date :2025-05-02 16:07 +0000\n "
16
16
"PO-Revision-Date :2022-11-05 17:23+0000\n "
17
17
"Last-Translator :Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n "
18
18
"Language-Team :Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -3275,6 +3275,9 @@ msgid ""
3275
3275
"and is written to (and read from) the file :file:`~/.python-history`. "
3276
3276
"(Contributed by Antoine Pitrou and Éric Araujo in :issue:`5845`.)"
3277
3277
msgstr ""
3278
+ "在支持 :mod:`readline` 的系统上的交互模式中现在将默认启用 Tab 键补全。 历史记录也将默认启用,并会写入到 "
3279
+ ":file:`~/.python-history` 文件(也会从中读取)。 (由 Antoine Pitrou 和 Éric Araujo 在 "
3280
+ ":issue:`5845` 中贡献。)"
3278
3281
3279
3282
#: ../../whatsnew/3.4.rst:1952
3280
3283
msgid ""
@@ -3283,6 +3286,8 @@ msgid ""
3283
3286
"changes were made to :mod:`argparse` (:issue:`18920`) and other modules that"
3284
3287
" have script-like invocation capabilities (:issue:`18922`)."
3285
3288
msgstr ""
3289
+ "现在附带 ``--version`` 唤起 Python 解释器将会把版本信息输出到标准输出而不是标准错误 (:issue:`18338`)。 对于 "
3290
+ ":mod:`argparse` (:issue:`18920`) 和其他具有脚本类唤起功能的模块也做了类似的修改 (:issue:`18922`)。"
3286
3291
3287
3292
#: ../../whatsnew/3.4.rst:1957
3288
3293
msgid ""
@@ -3415,6 +3420,10 @@ msgid ""
3415
3420
"Set LINEAR_PROBES=0 to turn-off linear probing entirely. (Contributed by "
3416
3421
"Raymond Hettinger in :issue:`18771`.)"
3417
3422
msgstr ""
3423
+ "针对集合的哈希碰撞的耗费现在已被降低。 每次哈希表检测现在会先检查一系列连续的、相邻的键/哈希值对再继续对整个哈希表执行随机检测。 "
3424
+ "这将利用缓存本地化来使得碰撞求解付出较少代价。 这种碰撞求解方案可被描述为线性检测和开放寻址的结合。 额外的线性检测数默认为九次。 这可以在编译时通过将"
3425
+ " LINEAR_PROBES 定义为任意值来修改。 设置 LINEAR_PROBES=0 可完全关闭线性检测。 (由 Raymond Hettinger"
3426
+ " 在 :issue:`18771` 中贡献。)"
3418
3427
3419
3428
#: ../../whatsnew/3.4.rst:2028
3420
3429
msgid ""
@@ -3426,26 +3435,37 @@ msgid ""
3426
3435
"Heimes and Victor Stinner in :issue:`19219`, :issue:`19218`, :issue:`19209`,"
3427
3436
" :issue:`19205` and :issue:`9548`.)"
3428
3437
msgstr ""
3438
+ "解释器启动速度加快了约 30%。 多项措施促成了此次加速。 解释器在启动时加载的模块有所减少,例如 :mod:`re`, "
3439
+ ":mod:`collections` 和 :mod:`locale` 模块及其依赖默认不再被导入。 marshal 模块得到改进以便更快速地加载已编译的"
3440
+ " Python 代码。 (由 Antoine Pitrou, Christian Heimes 和 Victor Stinner 在 "
3441
+ ":issue:`19219`, :issue:`19218`, :issue:`19209`, :issue:`19205` 和 "
3442
+ ":issue:`9548` 中贡献。)"
3429
3443
3430
3444
#: ../../whatsnew/3.4.rst:2036
3431
3445
msgid ""
3432
3446
":class:`bz2.BZ2File` is now as fast or faster than the Python2 version for "
3433
3447
"most cases. :class:`lzma.LZMAFile` has also been optimized. (Contributed "
3434
3448
"by Serhiy Storchaka and Nadeem Vawda in :issue:`16034`.)"
3435
3449
msgstr ""
3450
+ "现在 :class:`bz2.BZ2File` 在多数情况下相比 Python2 版本速度都一样快更快或。 :class:`lzma.LZMAFile`"
3451
+ " 也获得了优化。 (由 Serhiy Storchaka 和 Nadeem Vawda 在 :issue:`16034` 中贡献。)"
3436
3452
3437
3453
#: ../../whatsnew/3.4.rst:2040
3438
3454
msgid ""
3439
3455
":func:`random.getrandbits` is 20%-40% faster for small integers (the most "
3440
3456
"common use case). (Contributed by Serhiy Storchaka in :issue:`16674`.)"
3441
3457
msgstr ""
3458
+ ":func:`random.getrandbits` 对于小整数(最常见的应用场景)可加速 20%-40%。 (由 Serhiy Storchaka 在"
3459
+ " :issue:`16674` 中贡献。)"
3442
3460
3443
3461
#: ../../whatsnew/3.4.rst:2043
3444
3462
msgid ""
3445
3463
"By taking advantage of the new storage format for strings, pickling of "
3446
3464
"strings is now significantly faster. (Contributed by Victor Stinner and "
3447
3465
"Antoine Pitrou in :issue:`15596`.)"
3448
3466
msgstr ""
3467
+ "得益于字符串的新存储格式,对字符串执行 pickle 操作现在将有明显加速。 (由 Victor Stinner 和 Antoine Pitrou 在 "
3468
+ ":issue:`15596` 中贡献。)"
3449
3469
3450
3470
#: ../../whatsnew/3.4.rst:2047
3451
3471
msgid ""
@@ -3454,6 +3474,9 @@ msgid ""
3454
3474
" significant amounts of data through :mod:`subprocess`. (Contributed by "
3455
3475
"Richard Oudkerk in :issue:`15758`.)"
3456
3476
msgstr ""
3477
+ "一个 :meth:`io.FileIO.readall` 中的性能问题已被解决。 这对 Windows 有更具体的情况,将显著地提升通过 "
3478
+ ":mod:`subprocess` 以管道方式传递大量数据这一应用场景下的速度。 (由 Richard Oudkerk 在 :issue:`15758`"
3479
+ " 中贡献。)"
3457
3480
3458
3481
#: ../../whatsnew/3.4.rst:2052
3459
3482
msgid ""
@@ -3492,6 +3515,9 @@ msgid ""
3492
3515
":exc:`DeprecationWarning` when the interpreter is run with deprecation "
3493
3516
"warnings enabled (for example, by using ``-Wd``)."
3494
3517
msgstr ""
3518
+ "本小节列出了已在 Python 3.4 中弃用,并将在 Python 3.5 或之后的版本中移除的各种 API 和其他特性。 "
3519
+ "在大多数(但并非全部)情况下,在解释器运行时设置了弃用警告时(例如通过使用 ``-Wd`` 选项)使用已弃用的 API 将产生 "
3520
+ ":exc:`DeprecationWarning`。"
3495
3521
3496
3522
#: ../../whatsnew/3.4.rst:2077
3497
3523
msgid "Deprecations in the Python API"
@@ -3749,6 +3775,10 @@ msgid ""
3749
3775
"objects that do not have a __format__ method that handles it. See "
3750
3776
":issue:`7994` for background."
3751
3777
msgstr ""
3778
+ ":meth:`object.__format__` 不再接受非空格式字符串,它现在会改为引发 :exc:`TypeError`。 使用非空字符串自 "
3779
+ "Python 3.2 起已被弃用。 做出此项改变是为了防止当对象获得 __format__ "
3780
+ "方法时之前可用(但不正确)的代码执行失败的情况,这意味着现在当你对没有用于处理 ``'s'`` 的 __format__ "
3781
+ "方法的对象使用该格式代码时你的代码可能会引发 :exc:`TypeError`。 请参阅 :issue:`7994` 了解相关背景。"
3752
3782
3753
3783
#: ../../whatsnew/3.4.rst:2216
3754
3784
msgid ""
@@ -3813,6 +3843,9 @@ msgid ""
3813
3843
"how :envvar:`PATH` works. The behavior now conforms to the posix convention"
3814
3844
" for :envvar:`PATH`."
3815
3845
msgstr ""
3846
+ "在 posix shell 中,将 :envvar:`PATH` 环境变量设为空值就等于完全不设置。 不过,将 :envvar:`PYTHONPATH`"
3847
+ " 设为空值则 *不等于* 完全不设置:将 :envvar:`PYTHONPATH` 设为空值等于将其设为 ``.``,这在类 "
3848
+ ":envvar:`PATH` 运作方式来进行理解时会导致困惑。 现在的行为将与 posix 中 :envvar:`PATH` 的惯例保持一致。"
3816
3849
3817
3850
#: ../../whatsnew/3.4.rst:2257
3818
3851
msgid ""
@@ -3821,13 +3854,17 @@ msgid ""
3821
3854
"``-X showrefcount`` option. (Contributed by Ezio Melotti in "
3822
3855
":issue:`17323`.)"
3823
3856
msgstr ""
3857
+ "现在 CPython 解释器的调试构建版 (``--with-pydebug``) 的 [X refs, Y blocks] 输出默认将关闭。 可以使用"
3858
+ " ``-X showrefcount`` 选项来重新启用它。 (由 Ezio Melotti 在 :issue:`17323` 中贡献。)"
3824
3859
3825
3860
#: ../../whatsnew/3.4.rst:2261
3826
3861
msgid ""
3827
3862
"The python command and most stdlib scripts (as well as :mod:`argparse`) now "
3828
3863
"output ``--version`` information to ``stdout`` instead of ``stderr`` (for "
3829
3864
"issue list see :ref:`other-improvements-3.4` above)."
3830
3865
msgstr ""
3866
+ "现在 python 命令和大多数标准库脚本(和 :mod:`argparse` 一样)会将 ``--version`` 信息输出到 ``stdout``"
3867
+ " 而不是 ``stderr`` (相关问题列表参见上面的 :ref:`other-improvements-3.4`)。"
3831
3868
3832
3869
#: ../../whatsnew/3.4.rst:2267
3833
3870
msgid "Changes in the Python API"
@@ -3842,6 +3879,9 @@ msgid ""
3842
3879
"compatibility, catch both :exc:`NotImplementedError` or the appropriate "
3843
3880
"exception as needed."
3844
3881
msgstr ""
3882
+ "在 :mod:`importlib.abc` 中定义的 ABC 现在将会引发适当的异常或是返回默认值而不是无脑引发 "
3883
+ ":exc:`NotImplementedError`。 这将只影响调用 :func:`super` 并一路下落到这些 ABC 的代码。 "
3884
+ "为保持兼容性,:exc:`NotImplementedError` 和所需的相应异常都要被捕获。"
3845
3885
3846
3886
#: ../../whatsnew/3.4.rst:2275
3847
3887
msgid ""
@@ -3866,6 +3906,9 @@ msgid ""
3866
3906
"reloading. Note that this restores a pre-3.3 behavior in that it means a "
3867
3907
"module is re-found when re-loaded (:issue:`19413`)."
3868
3908
msgstr ""
3909
+ "当重载时 import 操作现在会无条件地重置相关属性 (例如 ``__name__``, ``__loader__``, "
3910
+ "``__package__``, ``__file__``, ``__cached__``)。 请注意在模块重载时会被重发现这一点上该操作恢复了 3.3"
3911
+ " 之前的行为 (:issue:`19413`)。"
3869
3912
3870
3913
#: ../../whatsnew/3.4.rst:2290
3871
3914
msgid ""
@@ -3876,6 +3919,9 @@ msgid ""
3876
3919
"to determine if a module is a package or not is to use ``hasattr(module, "
3877
3920
"'__path__')`` (:issue:`18065`)."
3878
3921
msgstr ""
3922
+ "冻结的包将不再把 ``__path__`` 设为一个包含包名的列表,它们现在会把它设为一个空列表。 "
3923
+ "当存在与冻结的包同名的目录时之前版本的行为可能会使导入系统错误地处理子模块。 确定一个模块是否属于包的正确方式是使用 ``hasattr(module,"
3924
+ " '__path__')`` (:issue:`18065`)。"
3879
3925
3880
3926
#: ../../whatsnew/3.4.rst:2297
3881
3927
msgid ""
@@ -3895,6 +3941,8 @@ msgid ""
3895
3941
" a warning that import will overwrite those files with a regular file "
3896
3942
"regardless of what type of file path they were originally."
3897
3943
msgstr ""
3944
+ "现在 :func:`py_compile.compile` 在它要写入的文件路径是符号链接或非常规文件时会引发 "
3945
+ ":exc:`FileExistsError`。 这是为了提示导入系统将用一个常规文件覆盖相应文件而不管原始文件路径是什么类型而发出的警告。"
3898
3946
3899
3947
#: ../../whatsnew/3.4.rst:2310
3900
3948
msgid ""
@@ -3907,6 +3955,10 @@ msgid ""
3907
3955
"before and wish to continue to ignore syntax or decoding issues, catch all "
3908
3956
"three exceptions now."
3909
3957
msgstr ""
3958
+ "当被加载的源代码触发了 :exc:`SyntaxError` 或 :exc:`UnicodeDecodeError` 时 "
3959
+ ":meth:`importlib.abc.SourceLoader.get_source` 将不再引发 :exc:`ImportError`。 因为 "
3960
+ ":exc:`ImportError` 本意只是在应该找到源代码但却找不到时被引发,而在源代码已找到但结构不正确时使用此异常会感觉有些过度/过载。 "
3961
+ "如果你在之前是捕获 ImportError 并希望继续忽略语法或解码问题,现在应当捕获所有这三个异常。"
3910
3962
3911
3963
#: ../../whatsnew/3.4.rst:2319
3912
3964
msgid ""
@@ -3919,6 +3971,10 @@ msgid ""
3919
3971
"behaviour was intentional can use :func:`inspect.unwrap` to access the first"
3920
3972
" function in the chain that has no ``__wrapped__`` attribute."
3921
3973
msgstr ""
3974
+ "现在 :func:`functools.update_wrapper` 和 :func:`functools.wraps` 会正确地将 "
3975
+ "``__wrapped__`` 属性设为被包装的函数,即使该函数同样设置了 ``__wrapped__`` 属性。 这意味着 "
3976
+ "``__wrapped__`` 属性现在会正确地链接由被装饰函数组成的栈而不是链中指向最内层函数的的每个 ``__wrapped__`` 属性。 "
3977
+ "确定要沿袭之前版本行为的内省库可以使用 :func:`inspect.unwrap` 来访问链中没有 ``__wrapped__`` 属性的第一个函数。"
3922
3978
3923
3979
#: ../../whatsnew/3.4.rst:2329
3924
3980
msgid ""
@@ -4114,6 +4170,9 @@ msgid ""
4114
4170
"deprecated. This key should be replaced by ``EXT_SUFFIX`` or "
4115
4171
"``SHLIB_SUFFIX``, depending on the context (:issue:`19555`)."
4116
4172
msgstr ""
4173
+ "附带 ``SO`` 键调用 :func:`sysconfig.get_config_var`,或者在对 "
4174
+ ":func:`sysconfig.get_config_vars` 的调用结果中查找 ``SO`` 的做法已被弃用。 该键应当被 "
4175
+ "``EXT_SUFFIX`` 或 ``SHLIB_SUFFIX`` 替代,由具体场景决定 (:issue:`19555`)。"
4117
4176
4118
4177
#: ../../whatsnew/3.4.rst:2455
4119
4178
msgid ""
@@ -4124,12 +4183,16 @@ msgid ""
4124
4183
" stream in :mod:`~io.TextIOWrapper` to use its *newline* argument "
4125
4184
"(:issue:`15204`)."
4126
4185
msgstr ""
4186
+ "任何指定了 ``U`` 的 ``open`` 函数调用都应当被修改。 ``U`` 在 Python3 将没有效果并且最终会在被使用时引发错误。 "
4187
+ "对于该函数,要得到与它的旧 Python2 行为相同的效果可以使用 *newline* 参数,或者在必要时将流包装在 "
4188
+ ":mod:`~io.TextIOWrapper` 以使用其 *newline* 参数 (:issue:`15204`)。"
4127
4189
4128
4190
#: ../../whatsnew/3.4.rst:2462
4129
4191
msgid ""
4130
4192
"If you use ``pyvenv`` in a script and desire that pip *not* be installed, "
4131
4193
"you must add ``--without-pip`` to your command invocation."
4132
4194
msgstr ""
4195
+ "如果你在脚本中使用 ``pyvenv`` 并且希望 *不要* 安装 pip,你必须在你的唤起命令中添加 ``--without-pip``。"
4133
4196
4134
4197
#: ../../whatsnew/3.4.rst:2466
4135
4198
msgid ""
@@ -4139,6 +4202,9 @@ msgid ""
4139
4202
"you have tests that are doing white-space-sensitive comparisons of such "
4140
4203
"output (:issue:`16333`)."
4141
4204
msgstr ""
4205
+ ":func:`json.dump` 和 :func:`json.dumps` "
4206
+ "在指定了缩进值时的默认行为已被改变:它不会在行末的条目分隔逗号后面再附加空格。 此项改变仅在你使用了对这样的输出执行空格敏感比较的测试时才会有影响 "
4207
+ "(:issue:`16333`)。"
4142
4208
4143
4209
#: ../../whatsnew/3.4.rst:2472
4144
4210
msgid ""
@@ -4181,6 +4247,11 @@ msgid ""
4181
4247
"when invoking these operations (directly or indirectly) and running against "
4182
4248
"a version of Python that is compiled with assertions enabled."
4183
4249
msgstr ""
4250
+ "现在 :c:func:`PyEval_EvalFrameEx`, :c:func:`PyObject_Repr` 和 "
4251
+ ":c:func:`PyObject_Str` 以及其他一些内部 C API "
4252
+ "都包括了一个调试断言,以确保它们不会在可能会静默地丢弃当前活动异常的情况下使用。 在预期并且希望丢弃活动异常的情况下(例如,由于已通过 "
4253
+ ":c:func:`PyErr_Fetch` 将其保存在本地或是有意将其替换为不同的异常 ),则需调用显式的 :c:func:`PyErr_Clear` "
4254
+ "以避免在(直接或间接)唤起这些操作和针对启用断言编译的 Python 的版本运行时触发断言。"
4184
4255
4185
4256
#: ../../whatsnew/3.4.rst:2500
4186
4257
msgid ""