@@ -17,7 +17,7 @@ msgid ""
17
17
msgstr ""
18
18
"Project-Id-Version : Python 3.7\n "
19
19
"Report-Msgid-Bugs-To : \n "
20
- "POT-Creation-Date : 2023-03-17 14:40+0000\n "
20
+ "POT-Creation-Date : 2023-03-24 14:40+0000\n "
21
21
"PO-Revision-Date : 2019-09-01 03:36+0000\n "
22
22
"
Last-Translator :
Freesand Leo <[email protected] >, 2023\n "
23
23
"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -695,6 +695,8 @@ msgid ""
695
695
"of getter and setter functions that decide the attribute to get or set based"
696
696
" on data in the closure.)"
697
697
msgstr ""
698
+ "读取函数接受一个 :class:`Custom` 对象和一个“闭包”,它是一个空指针。 在本例中,该闭包会被忽略。 "
699
+ "(该闭包支持将定义数据传给读取器和设置器的进阶用法。 例如,这可以被用来允许单组读取和设置函数根据闭包中的数据来决定要读取或设置的属性。)"
698
700
699
701
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:586
700
702
msgid ""
@@ -703,31 +705,34 @@ msgid ""
703
705
" being deleted. In our setter, we raise an error if the attribute is "
704
706
"deleted or if its new value is not a string."
705
707
msgstr ""
708
+ "设置器函数将接受 :class:`Custom` 对象、新值以及闭包。 新值可以为 ``NULL``,在此情况下属性将被删除。 "
709
+ "在我们的设置器中,如果属性被删除或者如果它的新值不是字符串则我们将引发一个错误。"
706
710
707
711
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:591
708
712
msgid "We create an array of :c:type:`PyGetSetDef` structures::"
709
- msgstr ""
713
+ msgstr "我们创建一个 :c:type:`PyGetSetDef` 结构体的数组:: "
710
714
711
715
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:601
712
716
msgid "and register it in the :c:member:`~PyTypeObject.tp_getset` slot::"
713
- msgstr ""
717
+ msgstr "并在 :c:member:`~PyTypeObject.tp_getset` 槽位中注册它:: "
714
718
715
719
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:605
716
720
msgid ""
717
721
"The last item in a :c:type:`PyGetSetDef` structure is the \" closure\" "
718
722
"mentioned above. In this case, we aren't using a closure, so we just pass "
719
723
"``NULL``."
720
724
msgstr ""
725
+ "在 :c:type:`PyGetSetDef` 结构体中的最后一项是上面提到的“闭包”。 在本例中,我们没有使用闭包,因此我们只传入 ``NULL``。"
721
726
722
727
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:608
723
728
msgid "We also remove the member definitions for these attributes::"
724
- msgstr ""
729
+ msgstr "我们还移除了这些属性的成员定义:: "
725
730
726
731
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:616
727
732
msgid ""
728
733
"We also need to update the :c:member:`~PyTypeObject.tp_init` handler to only"
729
734
" allow strings [#]_ to be passed::"
730
- msgstr ""
735
+ msgstr "我们还需要将 :c:member:`~PyTypeObject.tp_init` 处理句柄更新为只允许传入字符串 [#]_:: "
731
736
732
737
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:645
733
738
msgid ""
@@ -738,6 +743,9 @@ msgid ""
738
743
"these calls is in the ``tp_dealloc`` implementation, where there is the "
739
744
"possibility that the initialization of these members failed in ``tp_new``."
740
745
msgstr ""
746
+ "通过这些更改,我们能够确保 ``first`` 和 ``last`` 成员一定不为 ``NULL`` 以便我们能在几乎所有情况下移除 ``NULL`` "
747
+ "值检查。 这意味着大部分 :c:func:`Py_XDECREF` 调用都可以被转换为 :c:func:`Py_DECREF` 调用。 "
748
+ "我们不能更改这些调用的唯一场合是在 ``tp_dealloc`` 实现中,那里这些成员的初始化有可能在 ``tp_new`` 中失败。"
741
749
742
750
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/extending/newtypes_tutorial.rst:652
743
751
msgid ""
0 commit comments