@@ -3565,6 +3565,12 @@ msgid ""
3565
3565
"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\" TD\" , {})``."
3566
3566
" (Contributed by Alex Waygood in :gh:`105566` and :gh:`105570`.)"
3567
3567
msgstr ""
3568
+ "弃用当创建 :class:`~typing.NamedTuple` 或 :class:`typing.TypedDict` 类时省略 *fields* "
3569
+ "形参的做法,并弃用将 ``None`` 传给这两种类型的 *fields* 形参的做法。 Python 3.15 将要求以一个有效的序列作为 "
3570
+ "*fields* 形参。 要创建具有零个字段的 NamedTuple 类,请使用 ``class NT(NamedTuple): pass`` 或 "
3571
+ "``NT = NamedTuple(\" NT\" , ())``。 要创建具有零人字段的 TypedDict 类,请使用 ``class "
3572
+ "TD(TypedDict): pass`` 或 ``TD = TypedDict(\" TD\" , {})``。 (由 Alex Waygood 在 "
3573
+ ":gh:`105566` 和 :gh:`105570` 中贡献。)"
3568
3574
3569
3575
#: ../../whatsnew/3.13.rst:1991
3570
3576
msgid ""
@@ -3573,6 +3579,8 @@ msgid ""
3573
3579
" it has yet to be supported by any major type checker. (Contributed by Alex "
3574
3580
"Waygood in :gh:`106309`.)"
3575
3581
msgstr ""
3582
+ "弃用 :func:`typing.no_type_check_decorator` 装饰器函数,将在 Python 3.15 中被移除。 存在于 "
3583
+ ":mod:`typing` 模块中八年之后,它仍未被任何主要类型检查器所支持。 (由 Alex Waygood 在 :gh:`106309` 中贡献。)"
3576
3584
3577
3585
#: ../../whatsnew/3.13.rst:1997
3578
3586
msgid ""
@@ -3582,6 +3590,9 @@ msgid ""
3582
3590
"Python 3.18. Use the new :ref:`type parameter syntax <type-params>` instead."
3583
3591
" (Contributed by Michael The in :gh:`107116`.)"
3584
3592
msgstr ""
3593
+ "弃用 :data:`typing.AnyStr`。 在 Python 3.16 中,它将从 ``typing.__all__`` "
3594
+ "移除,当它被导入或被访问时将会发出 :exc:`DeprecationWarning`。 它将在 Python 3.18 中被完全移除。 请改用新的 "
3595
+ ":ref:`类型形参语法 <type-params>`。 (由 Michael The 在 :gh:`107116` 中贡献。)"
3585
3596
3586
3597
#: ../../whatsnew/3.13.rst:2005
3587
3598
#: ../../deprecations/pending-removal-in-3.15.rst:93
@@ -4500,6 +4511,9 @@ msgid ""
4500
4511
" optimize closing of generators. (Contributed by Irit Katriel in "
4501
4512
":gh:`111354`.)"
4502
4513
msgstr ""
4514
+ "现在 :opcode:`YIELD_VALUE` 的操作数在 yield 是 yield-from 或 await 的一部分时为 ``1``,否则为 "
4515
+ "``0``。 :opcode:`RESUME` 的操作数被修改为增加一个比特位来指明 except-depth 是否为 "
4516
+ "1,这是优化生成器的关闭所需要的。 (由 Irit Katriel 在 :gh:`111354` 中贡献。)"
4503
4517
4504
4518
#: ../../whatsnew/3.13.rst:2034
4505
4519
msgid "C API Changes"
@@ -4743,6 +4757,10 @@ msgid ""
4743
4757
"``Py_GetConstant(Py_CONSTANT_ZERO)`` returns a strong reference to the "
4744
4758
"constant zero. (Contributed by Victor Stinner in :gh:`115754`.)"
4745
4759
msgstr ""
4760
+ "增加了 :c:func:`Py_GetConstant` 和 :c:func:`Py_GetConstantBorrowed` 函数用来获取对常量的 "
4761
+ ":term:`强引用 <strong reference>` 或 :term:`借入引用 <borrowed reference>`。 "
4762
+ "例如,``Py_GetConstant(Py_CONSTANT_ZERO)`` 将返回一个对常量零的强引用。 (由 Victor Stinner 在 "
4763
+ ":gh:`115754` 中贡献。)"
4746
4764
4747
4765
#: ../../whatsnew/3.13.rst:2155
4748
4766
msgid ""
@@ -4751,27 +4769,38 @@ msgid ""
4751
4769
" of a :term:`borrowed reference`. (Contributed by Victor Stinner in "
4752
4770
":gh:`105922`.)"
4753
4771
msgstr ""
4772
+ "增加了 :c:func:`PyImport_AddModuleRef` 函数作为 :c:func:`PyImport_AddModule` "
4773
+ "的替代,它将返回一个 :term:`strong reference` 而不是 :term:`borrowed reference`。 (由 "
4774
+ "Victor Stinner 在 :gh:`105922` 中贡献。)"
4754
4775
4755
4776
#: ../../whatsnew/3.13.rst:2160
4756
4777
msgid ""
4757
4778
"Add the :c:func:`Py_IsFinalizing` function to check whether the main Python "
4758
4779
"interpreter is :term:`shutting down <interpreter shutdown>`. (Contributed by"
4759
4780
" Victor Stinner in :gh:`108014`.)"
4760
4781
msgstr ""
4782
+ "增加了 :c:func:`Py_IsFinalizing` 函数用于检测主 Python 解释器是否 :term:`正在关闭 <interpreter "
4783
+ "shutdown>`。 (由 Victor Stinner 在 :gh:`108014` 中贡献。)"
4761
4784
4762
4785
#: ../../whatsnew/3.13.rst:2165
4763
4786
msgid ""
4764
4787
"Add the :c:func:`PyList_GetItemRef` function as a replacement for "
4765
4788
":c:func:`PyList_GetItem` that returns a :term:`strong reference` instead of "
4766
4789
"a :term:`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)"
4767
4790
msgstr ""
4791
+ "增加了 :c:func:`PyList_GetItemRef` 函数作为 :c:func:`PyList_GetItem` 的替代,它将返回一个 "
4792
+ ":term:`strong reference` 而不是 :term:`borrowed reference`。 (由 Sam Gross 在 "
4793
+ ":gh:`114329` 中贡献。)"
4768
4794
4769
4795
#: ../../whatsnew/3.13.rst:2170
4770
4796
msgid ""
4771
4797
"Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, "
4772
4798
"mirroring the Python :meth:`!list.extend` and :meth:`!list.clear` methods. "
4773
4799
"(Contributed by Victor Stinner in :gh:`111138`.)"
4774
4800
msgstr ""
4801
+ "增加了 :c:func:`PyList_Extend` 和 :c:func:`PyList_Clear` 函数,对应于 Python "
4802
+ ":meth:`!list.extend` 和 :meth:`!list.clear` 方法。 (由 Victor Stinner 在 "
4803
+ ":gh:`111138` 中贡献。)"
4775
4804
4776
4805
#: ../../whatsnew/3.13.rst:2174
4777
4806
msgid ""
0 commit comments