11# SOME DESCRIPTIVE TITLE.
2- # Copyright (C) 2001-2022 , Python Software Foundation
2+ # Copyright (C) 2001-2023 , Python Software Foundation
33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66# Translators:
7- # ww song <[email protected] >, 20218- 9- # Josh Ouyang <[email protected] >, 202110- # jaystone776 <[email protected] >, 202111- # Freesand Leo <[email protected] >, 20217+ # Rafael Fontenelle <[email protected] >, 2023128#
139#, fuzzy
1410msgid ""
1511msgstr ""
16- "Project-Id-Version : Python 3.10 \n "
12+ "Project-Id-Version : Python 3.11 \n "
1713"Report-Msgid-Bugs-To : \n "
18- "POT-Creation-Date : 2022-11-04 14:28 +0000\n "
19- "PO-Revision-Date : 2021-06-28 00:48 +0000\n "
20- "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2021 \n "
21- "Language-Team : Chinese (China) (https://www .transifex.com/python-doc/teams/5390/zh_CN/)\n "
14+ "POT-Creation-Date : 2023-08-25 20:36 +0000\n "
15+ "PO-Revision-Date : 2023-05-24 02:08 +0000\n "
16+ "Last-Translator : Rafael Fontenelle <rffontenelle@gmail .com>, 2023 \n "
17+ "Language-Team : Chinese (China) (https://app .transifex.com/python-doc/teams/5390/zh_CN/)\n "
2218"MIME-Version : 1.0\n "
2319"Content-Type : text/plain; charset=UTF-8\n "
2420"Content-Transfer-Encoding : 8bit\n "
@@ -95,52 +91,52 @@ msgstr ""
9591#: ../../c-api/dict.rst:75
9692msgid ""
9793"Insert *val* into the dictionary *p* using *key* as a key. *key* should be a"
98- " :c:expr:`const char*`. The key object is created using "
99- "``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on "
100- "failure. This function *does not* steal a reference to *val*."
94+ " :c:expr:`const char*` UTF-8 encoded bytes string . The key object is "
95+ "created using ``PyUnicode_FromString(key)``. Return ``0`` on success or "
96+ "``-1`` on failure. This function *does not* steal a reference to *val*."
10197msgstr ""
10298
10399#: ../../c-api/dict.rst:83
104100msgid ""
105- "Remove the entry in dictionary *p* with key *key*. *key* must be hashable; "
106- "if it isn't, :exc:`TypeError` is raised. If *key* is not in the dictionary, "
107- ":exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on failure."
101+ "Remove the entry in dictionary *p* with key *key*. *key* must be "
102+ ":term:`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not "
103+ "in the dictionary, :exc:`KeyError` is raised. Return ``0`` on success or "
104+ "``-1`` on failure."
108105msgstr ""
109- "移除字典 *p* 中键为 *key* 的条目。 *key* 必须是可哈希的;如果不是,则会引发 :exc:`TypeError`。 如果字典中没有 "
110- "*key*,则会引发 :exc:`KeyError`。 成功时返回 ``0``,失败时返回 ``-1``。"
106+ "移除字典 *p* 中键为 *key* 的条目。 *key* 必须是 :term:`hashable`;如果不是,则会引发 "
107+ ":exc:`TypeError`。 如果字典中没有 *key*,则会引发 :exc:`KeyError`。 成功时返回 ``0`` 或者失败时返回 "
108+ "``-1``。"
111109
112110#: ../../c-api/dict.rst:91
113111msgid ""
114- "Remove the entry in dictionary *p* which has a key specified by the string "
115- "*key*. If *key* is not in the dictionary, :exc:`KeyError` is raised. Return "
116- "``0`` on success or ``-1`` on failure."
112+ "Remove the entry in dictionary *p* which has a key specified by the UTF-8 "
113+ "encoded bytes string *key*. If *key* is not in the dictionary, "
114+ ":exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on failure."
117115msgstr ""
118- "移除字典 *p* 中由字符串 *key* 指定的键的条目。 如果字典中没有 *key*,则会引发 :exc:`KeyError`。 成功时返回 "
119- "``0``,失败时返回 ``-1``。"
120116
121- #: ../../c-api/dict.rst:98
117+ #: ../../c-api/dict.rst:99
122118msgid ""
123119"Return the object from dictionary *p* which has a key *key*. Return "
124120"``NULL`` if the key *key* is not present, but *without* setting an "
125121"exception."
126122msgstr "从字典 *p* 中返回以 *key* 为键的对象。 如果键名 *key* 不存在但 *没有* 设置一个异常则返回 ``NULL``。"
127123
128- #: ../../c-api/dict.rst:101
124+ #: ../../c-api/dict.rst:104
129125msgid ""
130- "Note that exceptions which occur while calling :meth:`__hash__` and "
131- ":meth:`__eq__` methods will get suppressed. To get error reporting use "
132- ":c:func:`PyDict_GetItemWithError()` instead."
126+ "Exceptions that occur while this calls :meth:`~object. __hash__` and "
127+ ":meth:`~object. __eq__` methods are silently ignored. Prefer the "
128+ ":c:func:`PyDict_GetItemWithError` function instead."
133129msgstr ""
134- "需要注意的是,调用 :meth:`__hash__` 和 :meth:`__eq__` 方法产生的异常不会被抛出。改用 "
135- ":c:func:`PyDict_GetItemWithError()` 获得错误报告 。"
130+ "在调用 :meth:`~object. __hash__` 和 :meth:`~object. __eq__` 方法时发生的异常将被静默地忽略。 建议改用 "
131+ ":c:func:`PyDict_GetItemWithError` 函数 。"
136132
137- #: ../../c-api/dict.rst:105
133+ #: ../../c-api/dict.rst:108
138134msgid ""
139135"Calling this API without :term:`GIL` held had been allowed for historical "
140136"reason. It is no longer allowed."
141137msgstr "在不保持 :term:`GIL` 的情况下调用此 API 曾因历史原因而被允许。 现在已不再被允许。"
142138
143- #: ../../c-api/dict.rst:112
139+ #: ../../c-api/dict.rst:115
144140msgid ""
145141"Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. "
146142"Return ``NULL`` **with** an exception set if an exception occurred. Return "
@@ -149,23 +145,26 @@ msgstr ""
149145":c:func:`PyDict_GetItem` 的变种,它不会屏蔽异常。 当异常发生时将返回 ``NULL`` **并且** 设置一个异常。 "
150146"如果键不存在则返回 ``NULL`` **并且不会** 设置一个异常。"
151147
152- #: ../../c-api/dict.rst:120
148+ #: ../../c-api/dict.rst:123
153149msgid ""
154150"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a "
155- ":c:expr:`const char*`, rather than a :c:expr:`PyObject*`."
151+ ":c:expr:`const char*` UTF-8 encoded bytes string, rather than a "
152+ ":c:expr:`PyObject*`."
156153msgstr ""
157154
158- #: ../../c-api/dict.rst:123
155+ #: ../../c-api/dict.rst:129
159156msgid ""
160- "Note that exceptions which occur while calling :meth:`__hash__` and "
161- ":meth:`__eq__` methods and creating a temporary string object will get "
162- "suppressed. To get error reporting use :c:func:`PyDict_GetItemWithError()` "
163- "instead."
157+ "Exceptions that occur while this calls :meth:`~object.__hash__` and "
158+ ":meth:`~object.__eq__` methods or while creating the temporary :class:`str` "
159+ "object are silently ignored. Prefer using the "
160+ ":c:func:`PyDict_GetItemWithError` function with your own "
161+ ":c:func:`PyUnicode_FromString` *key* instead."
164162msgstr ""
165- "需要注意的是,调用 :meth:`__hash__` 、 :meth:`__eq__` 方法和创建一个临时的字符串对象时产生的异常不会被抛出。改用 "
166- ":c:func:`PyDict_GetItemWithError()` 获得错误报告。"
163+ "在调用 :meth:`~object.__hash__` 和 :meth:`~object.__eq__` 方法时或者在创建临时 "
164+ ":class:`str` 对象期间发生的异常将被静默地忽略。 建议改用 :c:func:`PyDict_GetItemWithError` "
165+ "函数并附带你自己的 :c:func:`PyUnicode_FromString` *key*。"
167166
168- #: ../../c-api/dict.rst:131
167+ #: ../../c-api/dict.rst:138
169168msgid ""
170169"This is the same as the Python-level :meth:`dict.setdefault`. If present, "
171170"it returns the value corresponding to *key* from the dictionary *p*. If the"
@@ -178,30 +177,30 @@ msgstr ""
178177"里面对应的值。如果键不存在,它会和值 *defaultobj* 一起插入并返回 *defaultobj* 。这个函数只计算 *key* "
179178"的哈希函数一次,而不是在查找和插入时分别计算它。"
180179
181- #: ../../c-api/dict.rst:141
180+ #: ../../c-api/dict.rst:148
182181msgid ""
183182"Return a :c:type:`PyListObject` containing all the items from the "
184183"dictionary."
185184msgstr "返回一个包含字典中所有键值项的 :c:type:`PyListObject`。"
186185
187- #: ../../c-api/dict.rst:146
186+ #: ../../c-api/dict.rst:153
188187msgid ""
189188"Return a :c:type:`PyListObject` containing all the keys from the dictionary."
190189msgstr "返回一个包含字典中所有键(keys)的 :c:type:`PyListObject`。"
191190
192- #: ../../c-api/dict.rst:151
191+ #: ../../c-api/dict.rst:158
193192msgid ""
194193"Return a :c:type:`PyListObject` containing all the values from the "
195194"dictionary *p*."
196195msgstr "返回一个包含字典中所有值(values)的 :c:type:`PyListObject`。"
197196
198- #: ../../c-api/dict.rst:159
197+ #: ../../c-api/dict.rst:166
199198msgid ""
200199"Return the number of items in the dictionary. This is equivalent to "
201200"``len(p)`` on a dictionary."
202201msgstr "返回字典中项目数,等价于对字典 *p* 使用 ``len(p)``。"
203202
204- #: ../../c-api/dict.rst:165
203+ #: ../../c-api/dict.rst:172
205204msgid ""
206205"Iterate over all key-value pairs in the dictionary *p*. The "
207206":c:type:`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` "
@@ -214,19 +213,23 @@ msgid ""
214213"Its value represents offsets within the internal dictionary structure, and "
215214"since the structure is sparse, the offsets are not consecutive."
216215msgstr ""
216+ "迭代字典 *p* 中的所有键值对。 在第一次调用此函数开始迭代之前,由 *ppos* 所引用的 :c:type:`Py_ssize_t` 必须被初始化为"
217+ " ``0``;该函数将为字典中的每个键值对返回真值,一旦所有键值对都报告完毕则返回假值。 形参 *pkey* 和 *pvalue* 应当指向 "
218+ ":c:expr:`PyObject*` 变量,它们将分别使用每个键和值来填充,或者也可以为 ``NULL``。 通过它们返回的任何引用都是暂借的。 "
219+ "*ppos* 在迭代期间不应被更改。 它的值表示内部字典结构中的偏移量,并且由于结构是稀疏的,因此偏移量并不连续。"
217220
218- #: ../../c-api/dict.rst:176
221+ #: ../../c-api/dict.rst:183
219222msgid "For example::"
220223msgstr "例如:"
221224
222- #: ../../c-api/dict.rst:186
225+ #: ../../c-api/dict.rst:193
223226msgid ""
224227"The dictionary *p* should not be mutated during iteration. It is safe to "
225228"modify the values of the keys as you iterate over the dictionary, but only "
226229"so long as the set of keys does not change. For example::"
227230msgstr "字典 *p* 不应该在遍历期间发生改变。在遍历字典时,改变键中的值是安全的,但仅限于键的集合不发生改变。例如::"
228231
229- #: ../../c-api/dict.rst:211
232+ #: ../../c-api/dict.rst:218
230233msgid ""
231234"Iterate over mapping object *b* adding key-value pairs to dictionary *a*. "
232235"*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` "
@@ -239,7 +242,7 @@ msgstr ""
239242":c:func:`PyObject_GetItem` 的对象。 如果 *override* 为真值,则如果在 *b* 中找到相同的键则 *a* "
240243"中已存在的相应键值对将被替换,否则如果在 *a* 中没有相同的键则只是添加键值对。 当成功时返回 ``0`` 或者当引发异常时返回 ``-1``。"
241244
242- #: ../../c-api/dict.rst:221
245+ #: ../../c-api/dict.rst:228
243246msgid ""
244247"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to "
245248"``a.update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall "
@@ -251,7 +254,7 @@ msgstr ""
251254":c:func:`PyDict_Update` 在第二个参数没有 \" keys\" 属性时不会回退到迭代键值对的序列。 当成功时返回 ``0`` "
252255"或者当引发异常时返回 ``-1``。"
253256
254- #: ../../c-api/dict.rst:230
257+ #: ../../c-api/dict.rst:237
255258msgid ""
256259"Update or merge into dictionary *a*, from the key-value pairs in *seq2*. "
257260"*seq2* must be an iterable object producing iterable objects of length 2, "
@@ -263,3 +266,23 @@ msgstr ""
263266"将 *seq2* 中的键值对更新或合并到字典 *a*。 *seq2* 必须为产生长度为 2 的用作键值对的元素的可迭代对象。 当存在重复的键时,如果 "
264267"*override* 真值则最后出现的键胜出。 当成功时返回 ``0`` 或者当引发异常时返回 ``-1``。 等价的 Python "
265268"代码(返回值除外)::"
269+
270+ #: ../../c-api/dict.rst:8
271+ msgid "object"
272+ msgstr "object -- 对象"
273+
274+ #: ../../c-api/dict.rst:8
275+ msgid "dictionary"
276+ msgstr "dictionary -- 字典"
277+
278+ #: ../../c-api/dict.rst:73
279+ msgid "PyUnicode_FromString()"
280+ msgstr "PyUnicode_FromString()"
281+
282+ #: ../../c-api/dict.rst:164
283+ msgid "built-in function"
284+ msgstr "内置函数"
285+
286+ #: ../../c-api/dict.rst:164
287+ msgid "len"
288+ msgstr "len"
0 commit comments