Expand Up @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800 \n" "POT-Creation-Date: 2023-08-26 00:03+0000 \n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang <me@liang2.tw>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" Expand Down Expand Up @@ -90,9 +90,9 @@ msgstr "" #: ../../c-api/dict.rst:75 msgid "" "Insert *val* into the dictionary *p* using *key* as a key. *key* should be " "a :c:expr:`const char*`. The key object is created using " "``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on " "failure. This function *does not* steal a reference to *val*." "a :c:expr:`const char*` UTF-8 encoded bytes string . The key object is " "created using ``PyUnicode_FromString(key)``. Return ``0`` on success or " "``-1`` on failure. This function *does not* steal a reference to *val*." msgstr "" #: ../../c-api/dict.rst:83 Expand All @@ -105,52 +105,53 @@ msgstr "" #: ../../c-api/dict.rst:91 msgid "" "Remove the entry in dictionary *p* which has a key specified by thestring " "*key*. If *key* is not in the dictionary, :exc:`KeyError` is raised. Return " "``0`` on success or ``-1`` on failure." "Remove the entry in dictionary *p* which has a key specified by theUTF-8 " "encoded bytes string *key*. If *key* is not in the dictionary, :exc:" "`KeyError` is raised. Return ` `0`` on success or ``-1`` on failure." msgstr "" #: ../../c-api/dict.rst:98 #: ../../c-api/dict.rst:99 msgid "" "Return the object from dictionary *p* which has a key *key*. Return " "``NULL`` if the key *key* is not present, but *without* setting an exception." msgstr "" #: ../../c-api/dict.rst:103 #: ../../c-api/dict.rst:104 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods are silently ignored. Prefer the :c:func:" "`PyDict_GetItemWithError` function instead." msgstr "" #: ../../c-api/dict.rst:107 #: ../../c-api/dict.rst:108 msgid "" "Calling this API without :term:`GIL` held had been allowed for historical " "reason. It is no longer allowed." msgstr "" #: ../../c-api/dict.rst:114 #: ../../c-api/dict.rst:115 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " "``NULL`` **without** an exception set if the key wasn't present." msgstr "" #: ../../c-api/dict.rst:122 #: ../../c-api/dict.rst:123 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" "expr:`const char*`, rather than a :c:expr:`PyObject*`." "expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" #: ../../c-api/dict.rst:127 #: ../../c-api/dict.rst:129 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods or while creating the temporary :class:`str` object " "are silently ignored. Prefer using the :c:func:`PyDict_GetItemWithError` " "function with your own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" #: ../../c-api/dict.rst:136 #: ../../c-api/dict.rst:138 msgid "" "This is the same as the Python-level :meth:`dict.setdefault`. If present, " "it returns the value corresponding to *key* from the dictionary *p*. If the " Expand All @@ -160,29 +161,29 @@ msgid "" "the insertion." msgstr "" #: ../../c-api/dict.rst:146 #: ../../c-api/dict.rst:148 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "" #: ../../c-api/dict.rst:151 #: ../../c-api/dict.rst:153 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "" #: ../../c-api/dict.rst:156 #: ../../c-api/dict.rst:158 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "" #: ../../c-api/dict.rst:164 #: ../../c-api/dict.rst:166 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "" #: ../../c-api/dict.rst:170 #: ../../c-api/dict.rst:172 msgid "" "Iterate over all key-value pairs in the dictionary *p*. The :c:type:" "`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " Expand All @@ -196,21 +197,21 @@ msgid "" "structure is sparse, the offsets are not consecutive." msgstr "" #: ../../c-api/dict.rst:181 #: ../../c-api/dict.rst:183 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" #: ../../c-api/dict.rst:191 #: ../../c-api/dict.rst:193 msgid "" "The dictionary *p* should not be mutated during iteration. It is safe to " "modify the values of the keys as you iterate over the dictionary, but only " "so long as the set of keys does not change. For example::" msgstr "" #: ../../c-api/dict.rst:216 #: ../../c-api/dict.rst:218 msgid "" "Iterate over mapping object *b* adding key-value pairs to dictionary *a*. " "*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` " Expand All @@ -220,7 +221,7 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" #: ../../c-api/dict.rst:226 #: ../../c-api/dict.rst:228 msgid "" "This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a." "update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back " Expand All @@ -229,7 +230,7 @@ msgid "" "exception was raised." msgstr "" #: ../../c-api/dict.rst:235 #: ../../c-api/dict.rst:237 msgid "" "Update or merge into dictionary *a*, from the key-value pairs in *seq2*. " "*seq2* must be an iterable object producing iterable objects of length 2, " Expand All @@ -238,49 +239,49 @@ msgid "" "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" #: ../../c-api/dict.rst:249 #: ../../c-api/dict.rst:251 msgid "" "Register *callback* as a dictionary watcher. Return a non-negative integer " "id which must be passed to future calls to :c:func:`PyDict_Watch`. In case " "of error (e.g. no more watcher IDs available), return ``-1`` and set an " "exception." msgstr "" #: ../../c-api/dict.rst:258 #: ../../c-api/dict.rst:260 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " "given *watcher_id* was never registered.)" msgstr "" #: ../../c-api/dict.rst:266 #: ../../c-api/dict.rst:268 msgid "" "Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" "func:`PyDict_AddWatcher` will be called when *dict* is modified or " "deallocated. Return ``0`` on success or ``-1`` on error." msgstr "" #: ../../c-api/dict.rst:274 #: ../../c-api/dict.rst:276 msgid "" "Mark dictionary *dict* as no longer watched. The callback granted " "*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " "*dict* is modified or deallocated. The dict must previously have been " "watched by this watcher. Return ``0`` on success or ``-1`` on error." msgstr "" #: ../../c-api/dict.rst:283 #: ../../c-api/dict.rst:285 msgid "" "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " "``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " "``PyDict_EVENT_CLONED``, ``PyDict_EVENT_CLEARED``, or " "``PyDict_EVENT_DEALLOCATED``." msgstr "" #: ../../c-api/dict.rst:291 #: ../../c-api/dict.rst:293 msgid "Type of a dict watcher callback function." msgstr "" #: ../../c-api/dict.rst:293 #: ../../c-api/dict.rst:295 msgid "" "If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both " "*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED`` " Expand All @@ -289,22 +290,22 @@ msgid "" "dictionary and *new_value* will be ``NULL``." msgstr "" #: ../../c-api/dict.rst:299 #: ../../c-api/dict.rst:301 msgid "" "``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another " "dict is merged into it. To maintain efficiency of this operation, per-key " "``PyDict_EVENT_ADDED`` events are not issued in this case; instead a single " "``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." msgstr "" #: ../../c-api/dict.rst:305 #: ../../c-api/dict.rst:307 msgid "" "The callback may inspect but must not modify *dict*; doing so could have " "unpredictable effects, including infinite recursion. Do not trigger Python " "code execution in the callback, as it could modify the dict as a side effect." msgstr "" #: ../../c-api/dict.rst:309 #: ../../c-api/dict.rst:311 msgid "" "If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the " "callback to the about-to-be-destroyed dictionary will resurrect it and " Expand All @@ -313,20 +314,20 @@ msgid "" "again." msgstr "" #: ../../c-api/dict.rst:315 #: ../../c-api/dict.rst:317 msgid "" "Callbacks occur before the notified modification to *dict* takes place, so " "the prior state of *dict* can be inspected." msgstr "" #: ../../c-api/dict.rst:318 #: ../../c-api/dict.rst:320 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" #: ../../c-api/dict.rst:322 #: ../../c-api/dict.rst:324 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " Expand All @@ -347,10 +348,10 @@ msgstr "dictionary(字典)" msgid "PyUnicode_FromString()" msgstr "PyUnicode_FromString()" #: ../../c-api/dict.rst:162 #: ../../c-api/dict.rst:164 msgid "built-in function" msgstr "built-in function(內建函式)" #: ../../c-api/dict.rst:162 #: ../../c-api/dict.rst:164 msgid "len" msgstr "len"