11# SOME DESCRIPTIVE TITLE.
2- # Copyright (C) 2001-2023 , Python Software Foundation
2+ # Copyright (C) 2001-2024 , Python Software Foundation
33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
99# meowmeowcat <[email protected] >, 20211010# Jing Li <[email protected] >, 2022111112- # Freesand Leo <[email protected] >, 20231312# Rafael Fontenelle <[email protected] >, 202313+ # Freesand Leo <[email protected] >, 20241414#
1515#, fuzzy
1616msgid ""
1717msgstr ""
1818"Project-Id-Version : Python 3.9\n "
1919"Report-Msgid-Bugs-To : \n "
20- "POT-Creation-Date : 2023-09-22 15:46 +0000\n "
20+ "POT-Creation-Date : 2024-04-26 21:29 +0000\n "
2121"PO-Revision-Date : 2018-04-08 04:04+0000\n "
22- "Last-Translator : Rafael Fontenelle <rffontenelle@gmail .com>, 2023 \n "
22+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2024 \n "
2323"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2424"MIME-Version : 1.0\n "
2525"Content-Type : text/plain; charset=UTF-8\n "
@@ -250,7 +250,7 @@ msgid ""
250250"case, we can just use the default implementation provided by the API "
251251"function :c:func:`PyType_GenericNew`. ::"
252252msgstr ""
253- "要启用对象创建,我们需要提供一个 :c:member:`~PyTypeObject.tp_new` 处理句柄 。 这等价于 Python 方法 "
253+ "要启用对象创建,我们需要提供一个 :c:member:`~PyTypeObject.tp_new` 处理器 。 这等价于 Python 方法 "
254254":meth:`__new__`,但是必须显式地指定。 在这个场景中,我们可以直接使用 API 函数 "
255255":c:func:`PyType_GenericNew` 所提供的默认实现。 ::"
256256
@@ -415,10 +415,10 @@ msgid ""
415415"type above. In this case, we use the ``tp_new`` handler to initialize the "
416416"``first`` and ``last`` attributes to non-``NULL`` default values."
417417msgstr ""
418- "``tp_new`` 处理句柄负责创建 (而不是初始化)该类型的对象。 它在 Python 中被暴露为 :meth:`__new__` 方法。 "
419- "它不需要定义 ``tp_new`` 成员,实际上许多扩展类型会简单地重用 :c:func:`PyType_GenericNew`,就像上面第一版 "
420- "``Custom`` 类型所作的那样。 在此情况下,我们使用 ``tp_new`` 处理句柄来将 ``first`` 和 ``last`` "
421- "属性初始化为非 ``NULL`` 的默认值。"
418+ "``tp_new`` 处理器负责创建 (而不是初始化)该类型的对象。 它在 Python 中被暴露为 :meth:`__new__` 方法。 它不需要定义 "
419+ " ``tp_new`` 成员,实际上许多扩展类型会简单地重用 :c:func:`PyType_GenericNew`,就像上面第一版 "
420+ "``Custom`` 类型所作的那样。 在此情况下,我们使用 ``tp_new`` 处理器来将 ``first`` 和 ``last`` 属性初始化为非 "
421+ " ``NULL`` 的默认值。"
422422
423423#: ../../extending/newtypes_tutorial.rst:327
424424msgid ""
@@ -431,7 +431,7 @@ msgid ""
431431msgstr ""
432432"``tp_new`` 将接受被实例化的类型(不要求为 "
433433"``CustomType``,如果被实例化的是一个子类)以及在该类型被调用时传入的任何参数,并预期返回所创建的实例。 ``tp_new`` "
434- "处理句柄总是接受位置和关键字参数 ,但它们总是会忽略这些参数,而将参数处理留给初始化(即 C 中的 ``tp_init`` 或 Python 中的 "
434+ "处理器总是接受位置和关键字参数 ,但它们总是会忽略这些参数,而将参数处理留给初始化(即 C 中的 ``tp_init`` 或 Python 中的 "
435435"``__init__`` 函数)方法来执行。"
436436
437437#: ../../extending/newtypes_tutorial.rst:335
@@ -514,7 +514,7 @@ msgid ""
514514"values. We might be tempted, for example to assign the ``first`` member "
515515"like this::"
516516msgstr ""
517- "不同于 ``tp_new`` 处理句柄 ,``tp_init`` 不保证一定会被调用 (例如,在默认情况下 :mod:`pickle` "
517+ "不同于 ``tp_new`` 处理器 ,``tp_init`` 不保证一定会被调用 (例如,在默认情况下 :mod:`pickle` "
518518"模块不会在被解封的实例上调用 :meth:`__init__`)。 它还可能被多次调用。 任何人都可以在我们的对象上调用 "
519519":meth:`__init__` 方法。 由于这个原因,我们在为属性赋新值时必须非常小心。 我们可能会被误导,例如像这样给 ``first`` "
520520"成员赋值::"
@@ -554,7 +554,7 @@ msgid ""
554554":c:member:`~PyTypeObject.tp_dealloc` handler on a type which doesn't support"
555555" cyclic garbage collection [#]_."
556556msgstr ""
557- "当减少一个 :c:member:`~PyTypeObject.tp_dealloc` 处理句柄内不支持循环垃圾回收的类型的引用计数的时候 [#]_."
557+ "当减少一个 :c:member:`~PyTypeObject.tp_dealloc` 处理器内不支持循环垃圾回收的类型的引用计数的时候 [#]_."
558558
559559#: ../../extending/newtypes_tutorial.rst:434
560560msgid ""
@@ -731,7 +731,7 @@ msgstr "我们还移除了这些属性的成员定义::"
731731msgid ""
732732"We also need to update the :c:member:`~PyTypeObject.tp_init` handler to only"
733733" allow strings [#]_ to be passed::"
734- msgstr "我们还需要将 :c:member:`~PyTypeObject.tp_init` 处理句柄更新为只允许传入字符串 [#]_::"
734+ msgstr "我们还需要将 :c:member:`~PyTypeObject.tp_init` 处理器更新为只允许传入字符串 [#]_::"
735735
736736#: ../../extending/newtypes_tutorial.rst:645
737737msgid ""
@@ -892,7 +892,7 @@ msgid ""
892892"extensions will use the versions automatically provided."
893893msgstr ""
894894"这样就差不多了。 如果我们编写了自定义的 :c:member:`~PyTypeObject.tp_alloc` 或 "
895- ":c:member:`~PyTypeObject.tp_free` 处理句柄 ,则我们需要针对循环垃圾回收来修改它。 大多数扩展都将使用自动提供的版本。"
895+ ":c:member:`~PyTypeObject.tp_free` 处理器 ,则我们需要针对循环垃圾回收来修改它。 大多数扩展都将使用自动提供的版本。"
896896
897897#: ../../extending/newtypes_tutorial.rst:793
898898msgid "Subclassing other types"
@@ -959,9 +959,8 @@ msgid ""
959959msgstr ""
960960"这个模式在编写具有自定义 :c:member:`~PyTypeObject.tp_new` 和 "
961961":c:member:`~PyTypeObject.tp_dealloc` 成员的类型时很重要。 "
962- ":c:member:`~PyTypeObject.tp_new` 处理句柄不应为具有 "
963- ":c:member:`~PyTypeObject.tp_alloc` 的对象实际分配内存,而是让基类通过调用自己的 "
964- ":c:member:`~PyTypeObject.tp_new` 来处理它。"
962+ ":c:member:`~PyTypeObject.tp_new` 处理器不应为具有 :c:member:`~PyTypeObject.tp_alloc`"
963+ " 的对象实际分配内存,而是让基类通过调用自己的 :c:member:`~PyTypeObject.tp_new` 来处理它。"
965964
966965#: ../../extending/newtypes_tutorial.rst:853
967966msgid ""
@@ -1007,7 +1006,7 @@ msgid ""
10071006"We relied on this in the :c:member:`~PyTypeObject.tp_dealloc` handler in "
10081007"this example, because our type doesn't support garbage collection."
10091008msgstr ""
1010- "在本示例中我们需要 :c:member:`~PyTypeObject.tp_dealloc` 处理句柄中的这一机制 ,因为我们的类型不支持垃圾回收。"
1009+ "在本示例中我们需要 :c:member:`~PyTypeObject.tp_dealloc` 处理器中的这一机制 ,因为我们的类型不支持垃圾回收。"
10111010
10121011#: ../../extending/newtypes_tutorial.rst:899
10131012msgid ""
0 commit comments