44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66# Translators:
7- # Freesand Leo <[email protected] >, 202087# Josh Ouyang <[email protected] >, 20208+ # Freesand Leo <[email protected] >, 202099#
1010#, fuzzy
1111msgid ""
@@ -14,7 +14,7 @@ msgstr ""
1414"Report-Msgid-Bugs-To : \n "
1515"POT-Creation-Date : 2020-02-09 12:40+0000\n "
1616"PO-Revision-Date : 2020-05-30 11:51+0000\n "
17- "
Last-Translator :
Josh Ouyang <[email protected] >, 2020\n"
17+ "
Last-Translator :
Freesand Leo <[email protected] >, 2020\n"
1818"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
1919"MIME-Version : 1.0\n "
2020"Content-Type : text/plain; charset=UTF-8\n "
@@ -39,6 +39,14 @@ msgid ""
3939":c:func:`PyNumber_InPlaceAnd`, :c:func:`PyNumber_InPlaceSubtract`, "
4040":c:func:`PyNumber_InPlaceOr`, and :c:func:`PyNumber_InPlaceXor`)."
4141msgstr ""
42+ "这一章节详细介绍了 :class:`set` 和 :class:`frozenset` 对象的公共 API。 "
43+ "任何未在下面列出的功能最好是使用抽象对象协议 (包括 :c:func:`PyObject_CallMethod`, "
44+ ":c:func:`PyObject_RichCompareBool`, :c:func:`PyObject_Hash`, "
45+ ":c:func:`PyObject_Repr`, :c:func:`PyObject_IsTrue`, :c:func:`PyObject_Print`"
46+ " 以及 :c:func:`PyObject_GetIter`) 或者抽象数字协议 (包括 :c:func:`PyNumber_And`, "
47+ ":c:func:`PyNumber_Subtract`, :c:func:`PyNumber_Or`, :c:func:`PyNumber_Xor`, "
48+ ":c:func:`PyNumber_InPlaceAnd`, :c:func:`PyNumber_InPlaceSubtract`, "
49+ ":c:func:`PyNumber_InPlaceOr` 以及 :c:func:`PyNumber_InPlaceXor`) 来访问。"
4250
4351#: ../../c-api/set.rst:29
4452msgid ""
@@ -51,53 +59,57 @@ msgid ""
5159"All access should be done through the documented API rather than by "
5260"manipulating the values in the structure."
5361msgstr ""
62+ "这个 :c:type:`PyObject` 的子类型被用来保存 :class:`set` 和 :class:`frozenset` 对象的内部数据。 "
63+ "它类似于 "
64+ ":c:type:`PyDictObject`,因为对于小尺寸集合来说它是固定大小的(很像元组的存储方式),并且对于中等和大尺寸集合来说它将指向单独的可变大小的内存块(很像列表的存储方式)。"
65+ " 此结构体的字段不应被视为公有并且可能发生改变。 所有访问应当通过已写入文档的 API 来进行,而不可通过操纵结构体中的值。"
5466
5567#: ../../c-api/set.rst:40
5668msgid ""
5769"This is an instance of :c:type:`PyTypeObject` representing the Python "
5870":class:`set` type."
59- msgstr ""
71+ msgstr "这是一个 :c:type:`PyTypeObject` 实例,表示 Python :class:`set` 类型。 "
6072
6173#: ../../c-api/set.rst:46
6274msgid ""
6375"This is an instance of :c:type:`PyTypeObject` representing the Python "
6476":class:`frozenset` type."
65- msgstr ""
77+ msgstr "这是一个 :c:type:`PyTypeObject` 实例,表示 Python :class:`frozenset` 类型。 "
6678
6779#: ../../c-api/set.rst:49
6880msgid ""
6981"The following type check macros work on pointers to any Python object. "
7082"Likewise, the constructor functions work with any iterable Python object."
71- msgstr ""
83+ msgstr "下列类型检查宏适用于指向任意 Python 对象的指针。 类似地,这些构造函数也适用于任意可迭代的 Python 对象。 "
7284
7385#: ../../c-api/set.rst:55
7486msgid ""
7587"Return true if *p* is a :class:`set` object or an instance of a subtype."
76- msgstr ""
88+ msgstr "如果 *p* 是一个 :class:`set` 对象或者是其子类型的实例则返回真值。 "
7789
7890#: ../../c-api/set.rst:59
7991msgid ""
8092"Return true if *p* is a :class:`frozenset` object or an instance of a "
8193"subtype."
82- msgstr ""
94+ msgstr "如果 *p* 是一个 :class:`frozenset` 对象或者是其子类型的实例则返回真值。 "
8395
8496#: ../../c-api/set.rst:64
8597msgid ""
8698"Return true if *p* is a :class:`set` object, a :class:`frozenset` object, or"
8799" an instance of a subtype."
88- msgstr ""
100+ msgstr "如果 *p* 是一个 :class:`set` 对象、:class:`frozenset` 对象或者是其子类型的实例则返回真值。 "
89101
90102#: ../../c-api/set.rst:70
91103msgid ""
92104"Return true if *p* is a :class:`set` object or a :class:`frozenset` object "
93105"but not an instance of a subtype."
94- msgstr ""
106+ msgstr "如果 *p* 是一个 :class:`set` 对象或 :class:`frozenset` 对象但不是其子类型的实例则返回真值。 "
95107
96108#: ../../c-api/set.rst:76
97109msgid ""
98110"Return true if *p* is a :class:`frozenset` object but not an instance of a "
99111"subtype."
100- msgstr ""
112+ msgstr "如果 *p* 是一个 :class:`frozenset` 对象但不是其子类型的实例则返回真值。 "
101113
102114#: ../../c-api/set.rst:82
103115msgid ""
@@ -107,6 +119,9 @@ msgid ""
107119" is not actually iterable. The constructor is also useful for copying a set"
108120" (``c=set(s)``)."
109121msgstr ""
122+ "返回一个新的 :class:`set`,其中包含 *iterable* 所返回的对象。 *iterable* 可以为 ``NULL`` "
123+ "表示创建一个新的空集合。 成功时返回新的集合,失败时返回 ``NULL``。 如果 *iterable* 实际上不是可迭代对象则引发 "
124+ ":exc:`TypeError`。 该构造器也适用于拷贝集合 (``c=set(s)``)。"
110125
111126#: ../../c-api/set.rst:91
112127msgid ""
@@ -115,23 +130,28 @@ msgid ""
115130" Return the new set on success or ``NULL`` on failure. Raise "
116131":exc:`TypeError` if *iterable* is not actually iterable."
117132msgstr ""
133+ "返回一个新的 :class:`frozenset`,其中包含 *iterable* 所返回的对象。 *iterable* 可以为 ``NULL`` "
134+ "表示创建一个新的空冻结集合。 成功时返回新的冻结集合,失败时返回 ``NULL``。 如果 *iterable* 实际上不是可迭代对象则引发 "
135+ ":exc:`TypeError`。"
118136
119137#: ../../c-api/set.rst:97
120138msgid ""
121139"The following functions and macros are available for instances of "
122140":class:`set` or :class:`frozenset` or instances of their subtypes."
123- msgstr ""
141+ msgstr "下列函数和宏适用于 :class:`set` 或 :class:`frozenset` 的实例或是其子类型的实例。 "
124142
125143#: ../../c-api/set.rst:105
126144msgid ""
127145"Return the length of a :class:`set` or :class:`frozenset` object. Equivalent"
128146" to ``len(anyset)``. Raises a :exc:`PyExc_SystemError` if *anyset* is not a"
129147" :class:`set`, :class:`frozenset`, or an instance of a subtype."
130148msgstr ""
149+ "返回 :class:`set` 或 :class:`frozenset` 对象的长度。 等价于 ``len(anyset)``。 如果 *anyset*"
150+ " 不是 :class:`set`, :class:`frozenset` 或其子类型的实例则会引发 :exc:`PyExc_SystemError`。"
131151
132152#: ../../c-api/set.rst:112
133153msgid "Macro form of :c:func:`PySet_Size` without error checking."
134- msgstr ""
154+ msgstr "宏版本的 :c:func:`PySet_Size`,不带错误检测。 "
135155
136156#: ../../c-api/set.rst:117
137157msgid ""
@@ -142,6 +162,10 @@ msgid ""
142162":exc:`PyExc_SystemError` if *anyset* is not a :class:`set`, "
143163":class:`frozenset`, or an instance of a subtype."
144164msgstr ""
165+ "如果找到返回 ``1``,如果未找到返回 ``0``,如果遇到错误则返回 ``-1``。 不同于 Python :meth:`__contains__`"
166+ " 方法,此函数不会自动将不可哈希的集合转换为临时的冻结集合。 如果 *key* 为不可哈希对象则会引发 :exc:`TypeError`。 如果 "
167+ "*anyset* 不是 :class:`set`, :class:`frozenset` 或其子类型的实例则会引发 "
168+ ":exc:`PyExc_SystemError`。"
145169
146170#: ../../c-api/set.rst:126
147171msgid ""
0 commit comments