From 28eee8196b7891a6f4bd757ddf498bad2e6de947 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 22 Nov 2025 00:15:32 +0000 Subject: [PATCH 01/13] sync with cpython 8d5cf98e --- c-api/type.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c-api/type.po b/c-api/type.po index 663b39a230..f5ecca5936 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-20 00:14+0000\n" +"POT-Creation-Date: 2025-11-22 00:14+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -762,8 +762,8 @@ msgstr "" #: ../../c-api/type.rst:640 msgid "" -"The field :c:member:`~PyTypeObject.tp_vectorcall` can now set using :c:data:" -"`Py_tp_vectorcall`. See the field's documentation for details." +"The field :c:member:`~PyTypeObject.tp_vectorcall` can now be set using :c:" +"data:`Py_tp_vectorcall`. See the field's documentation for details." msgstr "" #: ../../c-api/type.rst:647 From 7465ea95be2d38e45b5b7fa5378fa0d88c4bf688 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 23 Nov 2025 00:17:51 +0000 Subject: [PATCH 02/13] sync with cpython 061965c5 --- library/stdtypes.po | 778 ++++++++++++++++++++++---------------------- library/unittest.po | 524 +++++++++++++++-------------- 2 files changed, 648 insertions(+), 654 deletions(-) diff --git a/library/stdtypes.po b/library/stdtypes.po index d46b56f45d..9d6679c845 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-17 00:14+0000\n" +"POT-Creation-Date: 2025-11-23 00:16+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -6827,26 +6827,26 @@ msgstr "" msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " -"changed using methods like :meth:`~set.add` and :meth:`~set.remove`. Since " -"it is mutable, it has no hash value and cannot be used as either a " -"dictionary key or as an element of another set. The :class:`frozenset` type " -"is immutable and :term:`hashable` --- its contents cannot be altered after " -"it is created; it can therefore be used as a dictionary key or as an element " -"of another set." +"changed using methods like :meth:`add ` and :meth:`remove " +"`. Since it is mutable, it has no hash value and cannot be " +"used as either a dictionary key or as an element of another set. The :class:" +"`frozenset` type is immutable and :term:`hashable` --- its contents cannot " +"be altered after it is created; it can therefore be used as a dictionary key " +"or as an element of another set." msgstr "" -#: ../../library/stdtypes.rst:4740 +#: ../../library/stdtypes.rst:4741 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -#: ../../library/stdtypes.rst:4744 +#: ../../library/stdtypes.rst:4745 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4749 +#: ../../library/stdtypes.rst:4750 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -6854,92 +6854,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4755 +#: ../../library/stdtypes.rst:4756 msgid "Sets can be created by several means:" msgstr "集合可以以多種方式建立:" -#: ../../library/stdtypes.rst:4757 +#: ../../library/stdtypes.rst:4758 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4758 +#: ../../library/stdtypes.rst:4759 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4759 +#: ../../library/stdtypes.rst:4760 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4761 +#: ../../library/stdtypes.rst:4762 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4766 +#: ../../library/stdtypes.rst:4767 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4770 +#: ../../library/stdtypes.rst:4771 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4774 +#: ../../library/stdtypes.rst:4775 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4778 +#: ../../library/stdtypes.rst:4779 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." msgstr "" -#: ../../library/stdtypes.rst:4784 +#: ../../library/stdtypes.rst:4785 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4788 +#: ../../library/stdtypes.rst:4789 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4794 +#: ../../library/stdtypes.rst:4795 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4798 +#: ../../library/stdtypes.rst:4799 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4804 +#: ../../library/stdtypes.rst:4805 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4809 +#: ../../library/stdtypes.rst:4810 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4814 +#: ../../library/stdtypes.rst:4815 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4819 +#: ../../library/stdtypes.rst:4820 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4823 +#: ../../library/stdtypes.rst:4824 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4826 +#: ../../library/stdtypes.rst:4827 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -6949,7 +6949,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4833 +#: ../../library/stdtypes.rst:4834 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -6959,14 +6959,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4840 +#: ../../library/stdtypes.rst:4841 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " "returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" -#: ../../library/stdtypes.rst:4844 +#: ../../library/stdtypes.rst:4845 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -6974,71 +6974,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4849 +#: ../../library/stdtypes.rst:4850 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" -#: ../../library/stdtypes.rst:4852 +#: ../../library/stdtypes.rst:4853 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4854 +#: ../../library/stdtypes.rst:4855 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -#: ../../library/stdtypes.rst:4858 +#: ../../library/stdtypes.rst:4859 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4864 +#: ../../library/stdtypes.rst:4865 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4869 +#: ../../library/stdtypes.rst:4870 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4874 +#: ../../library/stdtypes.rst:4875 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4879 +#: ../../library/stdtypes.rst:4880 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4883 +#: ../../library/stdtypes.rst:4884 msgid "Add element *elem* to the set." msgstr "將元素 *elem* 加入集合。" -#: ../../library/stdtypes.rst:4887 +#: ../../library/stdtypes.rst:4888 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4892 +#: ../../library/stdtypes.rst:4893 msgid "Remove element *elem* from the set if it is present." msgstr "如果 *elem* 存在於集合中則將其移除。" -#: ../../library/stdtypes.rst:4896 +#: ../../library/stdtypes.rst:4897 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4901 +#: ../../library/stdtypes.rst:4902 msgid "Remove all elements from the set." msgstr "從集合中移除所有元素。" -#: ../../library/stdtypes.rst:4904 +#: ../../library/stdtypes.rst:4905 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -7046,18 +7046,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4909 +#: ../../library/stdtypes.rst:4910 msgid "" "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:" "`remove`, and :meth:`discard` methods may be a set. To support searching " "for an equivalent frozenset, a temporary one is created from *elem*." msgstr "" -#: ../../library/stdtypes.rst:4918 +#: ../../library/stdtypes.rst:4919 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4928 +#: ../../library/stdtypes.rst:4929 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -7066,7 +7066,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4934 +#: ../../library/stdtypes.rst:4935 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -7075,33 +7075,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4945 +#: ../../library/stdtypes.rst:4946 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4948 +#: ../../library/stdtypes.rst:4949 msgid "Dictionaries can be created by several means:" msgstr "字典可以用數種方式建立:" -#: ../../library/stdtypes.rst:4950 +#: ../../library/stdtypes.rst:4951 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4952 +#: ../../library/stdtypes.rst:4953 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4953 +#: ../../library/stdtypes.rst:4954 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4956 +#: ../../library/stdtypes.rst:4957 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it defines a ``keys()`` method, a " @@ -7114,7 +7114,7 @@ msgid "" "that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4967 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -7122,13 +7122,13 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4971 ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:4972 ../../library/stdtypes.rst:4990 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4975 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -7137,7 +7137,7 @@ msgid "" "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:4981 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -7157,13 +7157,13 @@ msgstr "" ">>> a == b == c == d == e == f\n" "True" -#: ../../library/stdtypes.rst:4992 +#: ../../library/stdtypes.rst:4993 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:4996 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7195,33 +7195,33 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5011 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:5014 +#: ../../library/stdtypes.rst:5015 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:5019 +#: ../../library/stdtypes.rst:5020 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5023 +#: ../../library/stdtypes.rst:5024 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5027 +#: ../../library/stdtypes.rst:5028 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:5032 +#: ../../library/stdtypes.rst:5033 msgid "" "If a subclass of dict defines a method :meth:`~object.__missing__` and *key* " "is not present, the ``d[key]`` operation calls that method with the key " @@ -7232,7 +7232,7 @@ msgid "" "__missing__` must be a method; it cannot be an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:5040 +#: ../../library/stdtypes.rst:5041 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -7256,51 +7256,51 @@ msgstr "" ">>> c['red']\n" "1" -#: ../../library/stdtypes.rst:5051 +#: ../../library/stdtypes.rst:5052 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different :meth:`!__missing__` method is used by :class:" "`collections.defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:5058 +#: ../../library/stdtypes.rst:5059 msgid "Set ``d[key]`` to *value*." msgstr "將 ``d[key]`` 設為 *value*。" -#: ../../library/stdtypes.rst:5062 +#: ../../library/stdtypes.rst:5063 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "從 *d* 中移除 ``d[key]``。若 *key* 不在對映中則引發 :exc:`KeyError`。" -#: ../../library/stdtypes.rst:5067 +#: ../../library/stdtypes.rst:5068 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "若 *d* 有鍵 *key* 則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/stdtypes.rst:5071 +#: ../../library/stdtypes.rst:5072 msgid "Equivalent to ``not key in d``." msgstr "等價於 ``not key in d``。" -#: ../../library/stdtypes.rst:5075 +#: ../../library/stdtypes.rst:5076 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5080 +#: ../../library/stdtypes.rst:5081 msgid "Remove all items from the dictionary." msgstr "從字典中移除所有項目。" -#: ../../library/stdtypes.rst:5084 +#: ../../library/stdtypes.rst:5085 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5088 +#: ../../library/stdtypes.rst:5089 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:5090 +#: ../../library/stdtypes.rst:5091 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -7309,70 +7309,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:5098 +#: ../../library/stdtypes.rst:5099 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " "raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:5104 +#: ../../library/stdtypes.rst:5105 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5109 +#: ../../library/stdtypes.rst:5110 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:5115 +#: ../../library/stdtypes.rst:5116 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" "exc:`KeyError` is raised." msgstr "" -#: ../../library/stdtypes.rst:5121 +#: ../../library/stdtypes.rst:5122 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -#: ../../library/stdtypes.rst:5124 +#: ../../library/stdtypes.rst:5125 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" "`popitem` raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:5128 +#: ../../library/stdtypes.rst:5129 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:5134 +#: ../../library/stdtypes.rst:5135 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5141 +#: ../../library/stdtypes.rst:5142 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" -#: ../../library/stdtypes.rst:5149 +#: ../../library/stdtypes.rst:5150 msgid "" "Update the dictionary with the key/value pairs from *mapping* or *iterable* " "and *kwargs*, overwriting existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:5152 +#: ../../library/stdtypes.rst:5153 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -7381,20 +7381,20 @@ msgid "" "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:5160 +#: ../../library/stdtypes.rst:5161 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5163 +#: ../../library/stdtypes.rst:5164 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:5167 +#: ../../library/stdtypes.rst:5168 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -7404,25 +7404,25 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:5173 +#: ../../library/stdtypes.rst:5174 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:5181 +#: ../../library/stdtypes.rst:5182 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:5187 +#: ../../library/stdtypes.rst:5188 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:5189 +#: ../../library/stdtypes.rst:5190 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7444,21 +7444,21 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:5199 +#: ../../library/stdtypes.rst:5200 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5204 +#: ../../library/stdtypes.rst:5205 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:5211 +#: ../../library/stdtypes.rst:5212 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:5213 +#: ../../library/stdtypes.rst:5214 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -7466,23 +7466,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:5218 +#: ../../library/stdtypes.rst:5219 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:5223 +#: ../../library/stdtypes.rst:5224 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5227 +#: ../../library/stdtypes.rst:5228 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5230 +#: ../../library/stdtypes.rst:5231 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -7490,39 +7490,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:5235 +#: ../../library/stdtypes.rst:5236 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:5238 +#: ../../library/stdtypes.rst:5239 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:5243 +#: ../../library/stdtypes.rst:5244 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:5248 +#: ../../library/stdtypes.rst:5249 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5252 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5256 +#: ../../library/stdtypes.rst:5257 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:5261 +#: ../../library/stdtypes.rst:5262 msgid "" "Keys views are set-like since their entries are unique and :term:`hashable`. " "Items views also have set-like operations since the (key, value) pairs are " @@ -7536,11 +7536,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:5273 +#: ../../library/stdtypes.rst:5274 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:5275 +#: ../../library/stdtypes.rst:5276 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -7581,11 +7581,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:5317 +#: ../../library/stdtypes.rst:5318 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:5324 +#: ../../library/stdtypes.rst:5325 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -7596,7 +7596,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:5332 +#: ../../library/stdtypes.rst:5333 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -7607,7 +7607,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:5337 +#: ../../library/stdtypes.rst:5338 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -7616,7 +7616,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:5341 +#: ../../library/stdtypes.rst:5342 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -7630,7 +7630,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的目前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:5351 +#: ../../library/stdtypes.rst:5352 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -7642,7 +7642,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:5356 +#: ../../library/stdtypes.rst:5357 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -7657,7 +7657,7 @@ msgstr "" "(propagate)。執行此方法期間發生的例外會取代 :keyword:`!with` 陳述式主體中發生" "的任何例外。" -#: ../../library/stdtypes.rst:5363 +#: ../../library/stdtypes.rst:5364 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -7669,7 +7669,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:5369 +#: ../../library/stdtypes.rst:5370 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -7681,7 +7681,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:5375 +#: ../../library/stdtypes.rst:5376 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -7696,7 +7696,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5383 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -7708,7 +7708,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:5391 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -7716,7 +7716,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" "ref:`聯合 (Union) `" -#: ../../library/stdtypes.rst:5395 +#: ../../library/stdtypes.rst:5396 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -7724,11 +7724,11 @@ msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" -#: ../../library/stdtypes.rst:5402 +#: ../../library/stdtypes.rst:5403 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:5408 +#: ../../library/stdtypes.rst:5409 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -7744,7 +7744,7 @@ msgstr "" "立的。``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使" "用。" -#: ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5419 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -7752,7 +7752,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:5421 +#: ../../library/stdtypes.rst:5422 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -7760,7 +7760,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:5424 +#: ../../library/stdtypes.rst:5425 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -7772,7 +7772,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:5430 +#: ../../library/stdtypes.rst:5431 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -7784,7 +7784,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 `\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:5436 +#: ../../library/stdtypes.rst:5437 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -7796,7 +7796,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:5442 +#: ../../library/stdtypes.rst:5443 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -7809,7 +7809,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match ` 物件。" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5449 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -7818,7 +7818,7 @@ msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" -#: ../../library/stdtypes.rst:5454 +#: ../../library/stdtypes.rst:5455 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -7828,7 +7828,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:5459 +#: ../../library/stdtypes.rst:5460 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -7836,7 +7836,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:5462 +#: ../../library/stdtypes.rst:5463 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -7847,7 +7847,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:5467 +#: ../../library/stdtypes.rst:5468 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -7855,7 +7855,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:5470 +#: ../../library/stdtypes.rst:5471 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -7863,7 +7863,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:5473 +#: ../../library/stdtypes.rst:5474 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -7875,7 +7875,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:5478 +#: ../../library/stdtypes.rst:5479 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -7887,7 +7887,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:5484 +#: ../../library/stdtypes.rst:5485 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -7897,13 +7897,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:5488 +#: ../../library/stdtypes.rst:5489 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5491 +#: ../../library/stdtypes.rst:5492 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -7921,13 +7921,13 @@ msgstr "" ">>> type(l)\n" "" -#: ../../library/stdtypes.rst:5499 +#: ../../library/stdtypes.rst:5500 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5501 +#: ../../library/stdtypes.rst:5502 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -7941,7 +7941,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5507 +#: ../../library/stdtypes.rst:5508 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -7949,7 +7949,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5510 +#: ../../library/stdtypes.rst:5511 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -7961,7 +7961,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5515 +#: ../../library/stdtypes.rst:5516 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -7971,7 +7971,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5519 +#: ../../library/stdtypes.rst:5520 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -7983,253 +7983,253 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5526 +#: ../../library/stdtypes.rst:5527 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5528 +#: ../../library/stdtypes.rst:5529 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5531 +#: ../../library/stdtypes.rst:5532 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5532 +#: ../../library/stdtypes.rst:5533 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5533 +#: ../../library/stdtypes.rst:5534 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5534 +#: ../../library/stdtypes.rst:5535 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5535 +#: ../../library/stdtypes.rst:5536 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5536 +#: ../../library/stdtypes.rst:5537 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5537 +#: ../../library/stdtypes.rst:5538 msgid ":class:`asyncio.Future`" msgstr ":class:`asyncio.Future`" -#: ../../library/stdtypes.rst:5538 +#: ../../library/stdtypes.rst:5539 msgid ":class:`asyncio.Task`" msgstr ":class:`asyncio.Task`" -#: ../../library/stdtypes.rst:5539 +#: ../../library/stdtypes.rst:5540 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5540 +#: ../../library/stdtypes.rst:5541 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5541 +#: ../../library/stdtypes.rst:5542 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5542 +#: ../../library/stdtypes.rst:5543 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5543 +#: ../../library/stdtypes.rst:5544 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5545 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5545 +#: ../../library/stdtypes.rst:5546 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5546 +#: ../../library/stdtypes.rst:5547 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5547 +#: ../../library/stdtypes.rst:5548 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5548 +#: ../../library/stdtypes.rst:5549 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5550 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5550 +#: ../../library/stdtypes.rst:5551 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5552 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5553 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5554 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5554 +#: ../../library/stdtypes.rst:5555 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5555 +#: ../../library/stdtypes.rst:5556 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5556 +#: ../../library/stdtypes.rst:5557 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5557 +#: ../../library/stdtypes.rst:5558 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5558 +#: ../../library/stdtypes.rst:5559 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5559 +#: ../../library/stdtypes.rst:5560 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5560 +#: ../../library/stdtypes.rst:5561 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5561 +#: ../../library/stdtypes.rst:5562 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5562 +#: ../../library/stdtypes.rst:5563 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5563 +#: ../../library/stdtypes.rst:5564 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5564 +#: ../../library/stdtypes.rst:5565 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5565 +#: ../../library/stdtypes.rst:5566 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5566 +#: ../../library/stdtypes.rst:5567 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5568 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5568 +#: ../../library/stdtypes.rst:5569 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5569 +#: ../../library/stdtypes.rst:5570 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5570 +#: ../../library/stdtypes.rst:5571 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5571 +#: ../../library/stdtypes.rst:5572 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5572 +#: ../../library/stdtypes.rst:5573 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5573 +#: ../../library/stdtypes.rst:5574 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5574 +#: ../../library/stdtypes.rst:5575 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5575 +#: ../../library/stdtypes.rst:5576 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5577 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5577 +#: ../../library/stdtypes.rst:5578 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5578 +#: ../../library/stdtypes.rst:5579 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5579 +#: ../../library/stdtypes.rst:5580 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5580 +#: ../../library/stdtypes.rst:5581 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5581 +#: ../../library/stdtypes.rst:5582 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5583 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5583 +#: ../../library/stdtypes.rst:5584 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5584 +#: ../../library/stdtypes.rst:5585 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5585 +#: ../../library/stdtypes.rst:5586 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5586 +#: ../../library/stdtypes.rst:5587 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5591 +#: ../../library/stdtypes.rst:5592 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5594 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5597 +#: ../../library/stdtypes.rst:5598 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5599 +#: ../../library/stdtypes.rst:5600 msgid "" ">>> list[int].__origin__\n" "" @@ -8237,7 +8237,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5605 +#: ../../library/stdtypes.rst:5606 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " @@ -8246,7 +8246,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5610 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -8254,7 +8254,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5615 +#: ../../library/stdtypes.rst:5616 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -8262,7 +8262,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5618 +#: ../../library/stdtypes.rst:5619 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -8276,7 +8276,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5626 +#: ../../library/stdtypes.rst:5627 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -8286,7 +8286,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5633 +#: ../../library/stdtypes.rst:5634 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -8294,19 +8294,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5641 +#: ../../library/stdtypes.rst:5642 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5642 +#: ../../library/stdtypes.rst:5643 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5644 +#: ../../library/stdtypes.rst:5645 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5645 +#: ../../library/stdtypes.rst:5646 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -8315,7 +8315,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5649 +#: ../../library/stdtypes.rst:5650 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -8323,18 +8323,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:5650 +#: ../../library/stdtypes.rst:5651 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" "有關如何實作可以在 runtime 參數化並能被靜態型別檢查器理解的泛型類別的文件。" -#: ../../library/stdtypes.rst:5659 +#: ../../library/stdtypes.rst:5660 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5665 +#: ../../library/stdtypes.rst:5666 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -8347,7 +8347,7 @@ msgstr "" "釋 (type annotation) `。與下標 :data:`typing.Union` 相比,聯合型" "別運算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5672 +#: ../../library/stdtypes.rst:5673 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -8358,7 +8358,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5677 +#: ../../library/stdtypes.rst:5678 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -8366,7 +8366,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:5682 +#: ../../library/stdtypes.rst:5683 msgid "" "The ``|`` operand cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -8379,40 +8379,40 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:5690 +#: ../../library/stdtypes.rst:5691 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:5692 +#: ../../library/stdtypes.rst:5693 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:5694 +#: ../../library/stdtypes.rst:5695 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:5696 +#: ../../library/stdtypes.rst:5697 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:5698 +#: ../../library/stdtypes.rst:5699 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:5700 +#: ../../library/stdtypes.rst:5701 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:5702 +#: ../../library/stdtypes.rst:5703 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:5704 +#: ../../library/stdtypes.rst:5705 msgid "It creates instances of :class:`typing.Union`::" msgstr "它會建立 :class:`types.UnionType` 的實例: ::" -#: ../../library/stdtypes.rst:5706 +#: ../../library/stdtypes.rst:5707 msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" @@ -8420,21 +8420,21 @@ msgstr "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" -#: ../../library/stdtypes.rst:5709 +#: ../../library/stdtypes.rst:5710 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:5711 +#: ../../library/stdtypes.rst:5712 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:5716 +#: ../../library/stdtypes.rst:5717 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:5719 +#: ../../library/stdtypes.rst:5720 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -8442,14 +8442,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:5722 +#: ../../library/stdtypes.rst:5723 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:5725 +#: ../../library/stdtypes.rst:5726 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -8459,7 +8459,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:5732 +#: ../../library/stdtypes.rst:5733 msgid "" "The user-exposed type for the union object can be accessed from :class:" "`typing.Union` and used for :func:`isinstance` checks::" @@ -8467,7 +8467,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`types." "UnionType` 存取並用於 :func:`isinstance` 檢查: ::" -#: ../../library/stdtypes.rst:5735 +#: ../../library/stdtypes.rst:5736 msgid "" ">>> import typing\n" ">>> isinstance(int | str, typing.Union)\n" @@ -8485,7 +8485,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" -#: ../../library/stdtypes.rst:5744 +#: ../../library/stdtypes.rst:5745 msgid "" "The :meth:`!__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`!__or__`, the Union may " @@ -8494,7 +8494,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:5748 +#: ../../library/stdtypes.rst:5749 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -8520,32 +8520,32 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:5764 +#: ../../library/stdtypes.rst:5765 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:5770 +#: ../../library/stdtypes.rst:5771 msgid "" "Union objects are now instances of :class:`typing.Union`. Previously, they " "were instances of :class:`types.UnionType`, which remains an alias for :" "class:`typing.Union`." msgstr "" -#: ../../library/stdtypes.rst:5777 +#: ../../library/stdtypes.rst:5778 msgid "Other Built-in Types" msgstr "其他內建型別" -#: ../../library/stdtypes.rst:5779 +#: ../../library/stdtypes.rst:5780 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5786 +#: ../../library/stdtypes.rst:5787 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5788 +#: ../../library/stdtypes.rst:5789 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -8556,7 +8556,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5795 +#: ../../library/stdtypes.rst:5796 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -8567,32 +8567,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5803 +#: ../../library/stdtypes.rst:5804 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5811 +#: ../../library/stdtypes.rst:5812 msgid "Classes and Class Instances" msgstr "類別與類別實例" -#: ../../library/stdtypes.rst:5813 +#: ../../library/stdtypes.rst:5814 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "請見 :ref:`objects` 和 :ref:`class`。" -#: ../../library/stdtypes.rst:5819 +#: ../../library/stdtypes.rst:5820 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5821 +#: ../../library/stdtypes.rst:5822 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:5824 +#: ../../library/stdtypes.rst:5825 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -8600,15 +8600,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5828 +#: ../../library/stdtypes.rst:5829 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:5834 +#: ../../library/stdtypes.rst:5835 msgid "Methods" msgstr "方法" -#: ../../library/stdtypes.rst:5838 +#: ../../library/stdtypes.rst:5839 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -8616,7 +8616,7 @@ msgid "" "methods>`. Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:5844 +#: ../../library/stdtypes.rst:5845 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :ref:" @@ -8629,7 +8629,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5855 +#: ../../library/stdtypes.rst:5856 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -8640,7 +8640,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:5863 +#: ../../library/stdtypes.rst:5864 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -8668,15 +8668,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:5878 +#: ../../library/stdtypes.rst:5879 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:5886 +#: ../../library/stdtypes.rst:5887 msgid "Code Objects" msgstr "程式碼物件" -#: ../../library/stdtypes.rst:5892 +#: ../../library/stdtypes.rst:5893 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -8686,7 +8686,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5899 +#: ../../library/stdtypes.rst:5900 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -8695,21 +8695,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:5906 +#: ../../library/stdtypes.rst:5907 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5909 +#: ../../library/stdtypes.rst:5910 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:5915 +#: ../../library/stdtypes.rst:5916 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5921 +#: ../../library/stdtypes.rst:5922 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -8717,30 +8717,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5926 +#: ../../library/stdtypes.rst:5927 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5932 +#: ../../library/stdtypes.rst:5933 msgid "The Null Object" msgstr "Null 物件" -#: ../../library/stdtypes.rst:5934 +#: ../../library/stdtypes.rst:5935 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5938 +#: ../../library/stdtypes.rst:5939 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:5945 +#: ../../library/stdtypes.rst:5946 msgid "The Ellipsis Object" msgstr "Ellipsis 物件" -#: ../../library/stdtypes.rst:5947 +#: ../../library/stdtypes.rst:5948 msgid "" "This object is commonly used to indicate that something is omitted. It " "supports no special operations. There is exactly one ellipsis object, " @@ -8748,63 +8748,63 @@ msgid "" "the :const:`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5952 +#: ../../library/stdtypes.rst:5953 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:5954 +#: ../../library/stdtypes.rst:5955 msgid "" "In typical use, ``...`` as the ``Ellipsis`` object appears in a few " "different places, for instance:" msgstr "" -#: ../../library/stdtypes.rst:5957 +#: ../../library/stdtypes.rst:5958 msgid "" "In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." msgstr "" -#: ../../library/stdtypes.rst:5960 +#: ../../library/stdtypes.rst:5961 msgid "" "As the body of a function instead of a :ref:`pass statement `." msgstr "" -#: ../../library/stdtypes.rst:5962 +#: ../../library/stdtypes.rst:5963 msgid "" "In third-party libraries, such as `Numpy's slicing and striding `_." msgstr "" -#: ../../library/stdtypes.rst:5965 +#: ../../library/stdtypes.rst:5966 msgid "" "Python also uses three dots in ways that are not ``Ellipsis`` objects, for " "instance:" msgstr "" -#: ../../library/stdtypes.rst:5967 +#: ../../library/stdtypes.rst:5968 msgid "" "Doctest's :const:`ELLIPSIS `, as a pattern for missing " "content." msgstr "" -#: ../../library/stdtypes.rst:5969 +#: ../../library/stdtypes.rst:5970 msgid "" "The default Python prompt of the :term:`interactive` shell when partial " "input is incomplete." msgstr "" -#: ../../library/stdtypes.rst:5971 +#: ../../library/stdtypes.rst:5972 msgid "" "Lastly, the Python documentation often uses three dots in conventional " "English usage to mean omitted content, even in code examples that also use " "them as the ``Ellipsis``." msgstr "" -#: ../../library/stdtypes.rst:5979 +#: ../../library/stdtypes.rst:5980 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:5981 +#: ../../library/stdtypes.rst:5982 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -8812,64 +8812,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5986 +#: ../../library/stdtypes.rst:5987 msgid "It is written as :code:`NotImplemented`." msgstr "它被寫為 :code:`NotImplemented`。" -#: ../../library/stdtypes.rst:5992 +#: ../../library/stdtypes.rst:5993 msgid "Internal Objects" msgstr "內部物件" -#: ../../library/stdtypes.rst:5994 +#: ../../library/stdtypes.rst:5995 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:6002 +#: ../../library/stdtypes.rst:6003 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:6004 +#: ../../library/stdtypes.rst:6005 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:6011 +#: ../../library/stdtypes.rst:6012 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:6017 +#: ../../library/stdtypes.rst:6018 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:6025 +#: ../../library/stdtypes.rst:6026 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:6030 +#: ../../library/stdtypes.rst:6031 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:6035 +#: ../../library/stdtypes.rst:6036 msgid "" "The :ref:`type parameters ` of generic classes, functions, and :" "ref:`type aliases `. For classes and functions that are not " "generic, this will be an empty tuple." msgstr "" -#: ../../library/stdtypes.rst:6045 +#: ../../library/stdtypes.rst:6046 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:6047 +#: ../../library/stdtypes.rst:6048 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -8877,7 +8877,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:6052 +#: ../../library/stdtypes.rst:6053 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -8887,24 +8887,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:6059 +#: ../../library/stdtypes.rst:6060 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:6061 +#: ../../library/stdtypes.rst:6062 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:6065 +#: ../../library/stdtypes.rst:6066 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:6067 +#: ../../library/stdtypes.rst:6068 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -8928,7 +8928,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:6087 +#: ../../library/stdtypes.rst:6088 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -8936,11 +8936,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:6092 +#: ../../library/stdtypes.rst:6093 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:6094 +#: ../../library/stdtypes.rst:6095 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -8958,84 +8958,84 @@ msgstr "" "... '571186405732').to_bytes(53, 'big')\n" "..." -#: ../../library/stdtypes.rst:6107 +#: ../../library/stdtypes.rst:6108 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:6109 +#: ../../library/stdtypes.rst:6110 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:6112 +#: ../../library/stdtypes.rst:6113 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:6113 +#: ../../library/stdtypes.rst:6114 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:6114 +#: ../../library/stdtypes.rst:6115 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:6115 +#: ../../library/stdtypes.rst:6116 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:6116 +#: ../../library/stdtypes.rst:6117 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:6119 +#: ../../library/stdtypes.rst:6120 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:6121 +#: ../../library/stdtypes.rst:6122 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:6122 +#: ../../library/stdtypes.rst:6123 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:6123 +#: ../../library/stdtypes.rst:6124 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:6124 +#: ../../library/stdtypes.rst:6125 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:6125 +#: ../../library/stdtypes.rst:6126 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:6126 +#: ../../library/stdtypes.rst:6127 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:6129 +#: ../../library/stdtypes.rst:6130 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:6131 +#: ../../library/stdtypes.rst:6132 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:6134 +#: ../../library/stdtypes.rst:6135 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:6137 +#: ../../library/stdtypes.rst:6138 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -9043,7 +9043,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:6139 +#: ../../library/stdtypes.rst:6140 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -9052,38 +9052,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:6145 +#: ../../library/stdtypes.rst:6146 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:6148 +#: ../../library/stdtypes.rst:6149 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:6152 +#: ../../library/stdtypes.rst:6153 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:6154 +#: ../../library/stdtypes.rst:6155 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:6156 +#: ../../library/stdtypes.rst:6157 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:6163 +#: ../../library/stdtypes.rst:6164 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -9095,7 +9095,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:6172 +#: ../../library/stdtypes.rst:6173 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -9103,11 +9103,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:6178 +#: ../../library/stdtypes.rst:6179 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:6180 +#: ../../library/stdtypes.rst:6181 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -9115,11 +9115,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:6185 +#: ../../library/stdtypes.rst:6186 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:6187 +#: ../../library/stdtypes.rst:6188 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -9141,38 +9141,38 @@ msgstr "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" -#: ../../library/stdtypes.rst:6197 +#: ../../library/stdtypes.rst:6198 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:6201 +#: ../../library/stdtypes.rst:6202 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:6202 +#: ../../library/stdtypes.rst:6203 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:6205 +#: ../../library/stdtypes.rst:6206 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:6208 +#: ../../library/stdtypes.rst:6209 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:6210 +#: ../../library/stdtypes.rst:6211 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:6213 +#: ../../library/stdtypes.rst:6214 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -9185,13 +9185,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:322 #: ../../library/stdtypes.rst:399 ../../library/stdtypes.rst:992 #: ../../library/stdtypes.rst:1179 ../../library/stdtypes.rst:1201 -#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4920 -#: ../../library/stdtypes.rst:5917 +#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:5918 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1216 -#: ../../library/stdtypes.rst:4920 +#: ../../library/stdtypes.rst:4921 msgid "statement" msgstr "statement(陳述式)" @@ -9315,9 +9315,9 @@ msgstr "is not" #: ../../library/stdtypes.rst:1610 ../../library/stdtypes.rst:1740 #: ../../library/stdtypes.rst:2950 ../../library/stdtypes.rst:2969 #: ../../library/stdtypes.rst:3082 ../../library/stdtypes.rst:4718 -#: ../../library/stdtypes.rst:4920 ../../library/stdtypes.rst:5404 -#: ../../library/stdtypes.rst:5661 ../../library/stdtypes.rst:5836 -#: ../../library/stdtypes.rst:5881 +#: ../../library/stdtypes.rst:4921 ../../library/stdtypes.rst:5405 +#: ../../library/stdtypes.rst:5662 ../../library/stdtypes.rst:5837 +#: ../../library/stdtypes.rst:5882 msgid "object" msgstr "object(物件)" @@ -9409,9 +9409,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:992 -#: ../../library/stdtypes.rst:1179 ../../library/stdtypes.rst:4920 -#: ../../library/stdtypes.rst:5888 ../../library/stdtypes.rst:5902 -#: ../../library/stdtypes.rst:5917 +#: ../../library/stdtypes.rst:1179 ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:5889 ../../library/stdtypes.rst:5903 +#: ../../library/stdtypes.rst:5918 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -9469,7 +9469,7 @@ msgstr "**" #: ../../library/stdtypes.rst:322 ../../library/stdtypes.rst:399 #: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:1216 -#: ../../library/stdtypes.rst:4920 +#: ../../library/stdtypes.rst:4921 msgid "operations on" msgstr "operations on(操作於)" @@ -9478,7 +9478,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:341 ../../library/stdtypes.rst:1808 -#: ../../library/stdtypes.rst:2950 ../../library/stdtypes.rst:5917 +#: ../../library/stdtypes.rst:2950 ../../library/stdtypes.rst:5918 msgid "module" msgstr "模組" @@ -9546,7 +9546,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:889 ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:889 ../../library/stdtypes.rst:5320 msgid "protocol" msgstr "protocol(協定)" @@ -9572,7 +9572,7 @@ msgstr "container(容器)" msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:4920 +#: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:4921 msgid "len" msgstr "len" @@ -9647,8 +9647,8 @@ msgstr "list(串列)" msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4920 -#: ../../library/stdtypes.rst:5661 ../../library/stdtypes.rst:5917 +#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:5662 ../../library/stdtypes.rst:5918 msgid "type" msgstr "type(型別)" @@ -9656,7 +9656,7 @@ msgstr "type(型別)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4920 +#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4921 msgid "del" msgstr "del" @@ -9854,90 +9854,90 @@ msgstr "interpolation(插值)" msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:4920 +#: ../../library/stdtypes.rst:4921 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:4920 +#: ../../library/stdtypes.rst:4921 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:5031 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5320 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5320 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5320 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:5392 +#: ../../library/stdtypes.rst:5393 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:5392 +#: ../../library/stdtypes.rst:5393 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5405 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5405 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5405 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5661 +#: ../../library/stdtypes.rst:5662 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5661 +#: ../../library/stdtypes.rst:5662 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5836 +#: ../../library/stdtypes.rst:5837 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5881 +#: ../../library/stdtypes.rst:5882 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5881 +#: ../../library/stdtypes.rst:5882 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5888 +#: ../../library/stdtypes.rst:5889 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5888 +#: ../../library/stdtypes.rst:5889 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:5902 +#: ../../library/stdtypes.rst:5903 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5902 +#: ../../library/stdtypes.rst:5903 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5941 +#: ../../library/stdtypes.rst:5942 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5941 +#: ../../library/stdtypes.rst:5942 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號字面值)" diff --git a/library/unittest.po b/library/unittest.po index 88d0e389c3..c9ff803736 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-23 00:16+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,8 +34,8 @@ msgid "" "(If you are already familiar with the basic concepts of testing, you might " "want to skip to :ref:`the list of assert methods `.)" msgstr "" -"(假如你已經熟悉相關基礎的測試概念,你可能會希望跳過以下段落,直接參" -"考 :ref:`assert 方法清單 `。)" +"(假如你已經熟悉相關基礎的測試概念,你可能會希望跳過以下段落,直接參考 :ref:" +"`assert 方法清單 `。)" #: ../../library/unittest.rst:19 msgid "" @@ -120,11 +120,11 @@ msgstr "另一個執行測試的模組,但使用不一樣的測試方法與規 #: ../../library/unittest.rst:54 msgid "" -"`Simple Smalltalk Testing: With Patterns `_" +"`Simple Smalltalk Testing: With Patterns `_" msgstr "" -"`Simple Smalltalk Testing: With Patterns `_" +"`Simple Smalltalk Testing: With Patterns `_" #: ../../library/unittest.rst:55 msgid "" @@ -240,17 +240,17 @@ msgstr "" #: ../../library/unittest.rst:117 msgid "" "The crux of each test is a call to :meth:`~TestCase.assertEqual` to check " -"for an expected result; :meth:`~TestCase.assertTrue` " -"or :meth:`~TestCase.assertFalse` to verify a condition; " -"or :meth:`~TestCase.assertRaises` to verify that a specific exception gets " -"raised. These methods are used instead of the :keyword:`assert` statement " -"so the test runner can accumulate all test results and produce a report." -msgstr "" -"每個測試的關鍵為呼叫 :meth:`~TestCase.assertEqual` 來確認是否為期望的結" -"果; :meth:`~TestCase.assertTrue` 或是 :meth:`~TestCase.assertFalse` 用來驗證" -"一個條件式; :meth:`~TestCase.assertRaises` 用來驗證是否觸發一個特定的 " -"exception。使用這些物件方法來取代 :keyword:`assert` 陳述句,將能使 test " -"runner 收集所有的測試結果並產生一個報表。" +"for an expected result; :meth:`~TestCase.assertTrue` or :meth:`~TestCase." +"assertFalse` to verify a condition; or :meth:`~TestCase.assertRaises` to " +"verify that a specific exception gets raised. These methods are used " +"instead of the :keyword:`assert` statement so the test runner can accumulate " +"all test results and produce a report." +msgstr "" +"每個測試的關鍵為呼叫 :meth:`~TestCase.assertEqual` 來確認是否為期望的結果; :" +"meth:`~TestCase.assertTrue` 或是 :meth:`~TestCase.assertFalse` 用來驗證一個條" +"件式; :meth:`~TestCase.assertRaises` 用來驗證是否觸發一個特定的 exception。" +"使用這些物件方法來取代 :keyword:`assert` 陳述句,將能使 test runner 收集所有" +"的測試結果並產生一個報表。" #: ../../library/unittest.rst:124 msgid "" @@ -285,9 +285,9 @@ msgstr "" #: ../../library/unittest.rst:138 msgid "" -"Passing the ``-v`` option to your test script will " -"instruct :func:`unittest.main` to enable a higher level of verbosity, and " -"produce the following output::" +"Passing the ``-v`` option to your test script will instruct :func:`unittest." +"main` to enable a higher level of verbosity, and produce the following " +"output::" msgstr "" "在測試時加入 ``-v`` 選項將指示 :func:`unittest.main` 提高 verbosity 層級,產" "生以下的輸出: ::" @@ -370,8 +370,8 @@ msgid "" "importable as a module you should execute the file directly instead." msgstr "" "這允許你使用 shell 檔案名稱補完功能 (filename completion) 來指定測試模組。給" -"定的檔案路徑必須亦能被當作模組 import。此路徑轉換為模組名稱的方式為移除 " -"'.py' 並將路徑分隔符 (path separator) 轉換成 '.'。 假如你的測試檔案無法被 " +"定的檔案路徑必須亦能被當作模組 import。此路徑轉換為模組名稱的方式為移除 '." +"py' 並將路徑分隔符 (path separator) 轉換成 '.'。 假如你的測試檔案無法被 " "import 成模組,你應該直接執行該測試檔案。" #: ../../library/unittest.rst:184 @@ -473,8 +473,8 @@ msgstr "" #: ../../library/unittest.rst:242 msgid "" "For example, ``-k foo`` matches ``foo_tests.SomeTest.test_something``, " -"``bar_tests.SomeTest.test_foo``, but not " -"``bar_tests.FooTest.test_something``." +"``bar_tests.SomeTest.test_foo``, but not ``bar_tests.FooTest." +"test_something``." msgstr "" #: ../../library/unittest.rst:247 @@ -515,15 +515,15 @@ msgstr "Test Discovery(測試探索)" #: ../../library/unittest.rst:275 msgid "" "Unittest supports simple test discovery. In order to be compatible with test " -"discovery, all of the test files must be :ref:`modules ` " -"or :ref:`packages ` importable from the top-level directory of " -"the project (this means that their filenames must be valid :ref:`identifiers " +"discovery, all of the test files must be :ref:`modules ` or :" +"ref:`packages ` importable from the top-level directory of the " +"project (this means that their filenames must be valid :ref:`identifiers " "`)." msgstr "" "單元測試支援簡單的 test discovery(測試探索)。為了相容於測試探索,所有的測試" "檔案都要是\\ :ref:`模組 `\\ 或是\\ :ref:`套件 `," -"並能從專案的最上層目錄中 import(代表它們的檔案名稱必須是有效" -"的 :ref:`identifiers `\\ )。" +"並能從專案的最上層目錄中 import(代表它們的檔案名稱必須是有效的 :ref:" +"`identifiers `\\ )。" #: ../../library/unittest.rst:281 msgid "" @@ -632,8 +632,8 @@ msgstr "" msgid "" "Test discovery dropped the :term:`namespace packages ` " "support. It has been broken since Python 3.7. Start directory and its " -"subdirectories containing tests must be regular package that have " -"``__init__.py`` file." +"subdirectories containing tests must be regular package that have ``__init__." +"py`` file." msgstr "" #: ../../library/unittest.rst:353 @@ -656,10 +656,10 @@ msgstr "" #: ../../library/unittest.rst:367 msgid "" "The basic building blocks of unit testing are :dfn:`test cases` --- single " -"scenarios that must be set up and checked for correctness. " -"In :mod:`unittest`, test cases are represented by :class:`unittest.TestCase` " -"instances. To make your own test cases you must write subclasses " -"of :class:`TestCase` or use :class:`FunctionTestCase`." +"scenarios that must be set up and checked for correctness. In :mod:" +"`unittest`, test cases are represented by :class:`unittest.TestCase` " +"instances. To make your own test cases you must write subclasses of :class:" +"`TestCase` or use :class:`FunctionTestCase`." msgstr "" #: ../../library/unittest.rst:373 @@ -704,9 +704,9 @@ msgstr "" #: ../../library/unittest.rst:394 msgid "" "Tests can be numerous, and their set-up can be repetitive. Luckily, we can " -"factor out set-up code by implementing a method " -"called :meth:`~TestCase.setUp`, which the testing framework will " -"automatically call for every single test we run::" +"factor out set-up code by implementing a method called :meth:`~TestCase." +"setUp`, which the testing framework will automatically call for every single " +"test we run::" msgstr "" #: ../../library/unittest.rst:399 @@ -790,19 +790,19 @@ msgstr "" msgid "" "Such a working environment for the testing code is called a :dfn:`test " "fixture`. A new TestCase instance is created as a unique test fixture used " -"to execute each individual test method. " -"Thus :meth:`~TestCase.setUp`, :meth:`~TestCase.tearDown`, " -"and :meth:`~TestCase.__init__` will be called once per test." +"to execute each individual test method. Thus :meth:`~TestCase.setUp`, :meth:" +"`~TestCase.tearDown`, and :meth:`!TestCase.__init__` will be called once per " +"test." msgstr "" #: ../../library/unittest.rst:444 msgid "" "It is recommended that you use TestCase implementations to group tests " "together according to the features they test. :mod:`unittest` provides a " -"mechanism for this: the :dfn:`test suite`, represented " -"by :mod:`unittest`'s :class:`TestSuite` class. In most cases, " -"calling :func:`unittest.main` will do the right thing and collect all the " -"module's test cases for you and execute them." +"mechanism for this: the :dfn:`test suite`, represented by :mod:`unittest`'s :" +"class:`TestSuite` class. In most cases, calling :func:`unittest.main` will " +"do the right thing and collect all the module's test cases for you and " +"execute them." msgstr "" #: ../../library/unittest.rst:451 @@ -935,11 +935,10 @@ msgstr "" #: ../../library/unittest.rst:520 msgid "" -"In some cases, the existing tests may have been written using " -"the :mod:`doctest` module. If so, :mod:`doctest` provides " -"a :class:`DocTestSuite` class that can automatically " -"build :class:`unittest.TestSuite` instances from the " -"existing :mod:`doctest`\\ -based tests." +"In some cases, the existing tests may have been written using the :mod:" +"`doctest` module. If so, :mod:`doctest` provides a :class:`~doctest." +"DocTestSuite` class that can automatically build :class:`unittest.TestSuite` " +"instances from the existing :mod:`doctest`\\ -based tests." msgstr "" #: ../../library/unittest.rst:529 @@ -956,10 +955,10 @@ msgstr "" #: ../../library/unittest.rst:538 msgid "" -"Skipping a test is simply a matter of using " -"the :func:`skip` :term:`decorator` or one of its conditional variants, " -"calling :meth:`TestCase.skipTest` within a :meth:`~TestCase.setUp` or test " -"method, or raising :exc:`SkipTest` directly." +"Skipping a test is simply a matter of using the :func:`skip` :term:" +"`decorator` or one of its conditional variants, calling :meth:`TestCase." +"skipTest` within a :meth:`~TestCase.setUp` or test method, or raising :exc:" +"`SkipTest` directly." msgstr "" #: ../../library/unittest.rst:542 @@ -1107,11 +1106,10 @@ msgstr "" #: ../../library/unittest.rst:634 msgid "" -"Skipped tests will not have :meth:`~TestCase.setUp` " -"or :meth:`~TestCase.tearDown` run around them. Skipped classes will not " -"have :meth:`~TestCase.setUpClass` or :meth:`~TestCase.tearDownClass` run. " -"Skipped modules will not have :func:`setUpModule` or :func:`tearDownModule` " -"run." +"Skipped tests will not have :meth:`~TestCase.setUp` or :meth:`~TestCase." +"tearDown` run around them. Skipped classes will not have :meth:`~TestCase." +"setUpClass` or :meth:`~TestCase.tearDownClass` run. Skipped modules will not " +"have :func:`setUpModule` or :func:`tearDownModule` run." msgstr "" #: ../../library/unittest.rst:642 @@ -1284,9 +1282,9 @@ msgstr "" #: ../../library/unittest.rst:748 msgid "" "Method called to prepare the test fixture. This is called immediately " -"before calling the test method; other than :exc:`AssertionError` " -"or :exc:`SkipTest`, any exception raised by this method will be considered " -"an error rather than a test failure. The default implementation does nothing." +"before calling the test method; other than :exc:`AssertionError` or :exc:" +"`SkipTest`, any exception raised by this method will be considered an error " +"rather than a test failure. The default implementation does nothing." msgstr "" #: ../../library/unittest.rst:756 @@ -1294,8 +1292,8 @@ msgid "" "Method called immediately after the test method has been called and the " "result recorded. This is called even if the test method raised an " "exception, so the implementation in subclasses may need to be particularly " -"careful about checking internal state. Any exception, other " -"than :exc:`AssertionError` or :exc:`SkipTest`, raised by this method will be " +"careful about checking internal state. Any exception, other than :exc:" +"`AssertionError` or :exc:`SkipTest`, raised by this method will be " "considered an additional error rather than a test failure (thus increasing " "the total number of reported errors). This method will only be called if " "the :meth:`setUp` succeeds, regardless of the outcome of the test method. " @@ -1552,9 +1550,9 @@ msgstr "``not issubclass(a, b)``" msgid "" "All the assert methods accept a *msg* argument that, if specified, is used " "as the error message on failure (see also :data:`longMessage`). Note that " -"the *msg* keyword argument can be passed " -"to :meth:`assertRaises`, :meth:`assertRaisesRegex`, :meth:`assertWarns`, :meth:`assertWarnsRegex` " -"only when they are used as a context manager." +"the *msg* keyword argument can be passed to :meth:`assertRaises`, :meth:" +"`assertRaisesRegex`, :meth:`assertWarns`, :meth:`assertWarnsRegex` only when " +"they are used as a context manager." msgstr "" #: ../../library/unittest.rst:901 @@ -1644,11 +1642,11 @@ msgstr "``fun(*args, **kwds)`` 會引發 *exc*" #: ../../library/unittest.rst:989 msgid "" -":meth:`assertRaisesRegex(exc, r, fun, *args, **kwds) " -"`" +":meth:`assertRaisesRegex(exc, r, fun, *args, **kwds) `" msgstr "" -":meth:`assertRaisesRegex(exc, r, fun, *args, **kwds) " -"`" +":meth:`assertRaisesRegex(exc, r, fun, *args, **kwds) `" #: ../../library/unittest.rst:989 msgid "``fun(*args, **kwds)`` raises *exc* and the message matches regex *r*" @@ -1664,8 +1662,8 @@ msgstr "``fun(*args, **kwds)`` 會引發 *warn*" #: ../../library/unittest.rst:995 msgid "" -":meth:`assertWarnsRegex(warn, r, fun, *args, **kwds) " -"`" +":meth:`assertWarnsRegex(warn, r, fun, *args, **kwds) `" msgstr "" #: ../../library/unittest.rst:995 @@ -1703,11 +1701,11 @@ msgstr "3.10" #: ../../library/unittest.rst:1008 msgid "" "Test that an exception is raised when *callable* is called with any " -"positional or keyword arguments that are also passed " -"to :meth:`assertRaises`. The test passes if *exception* is raised, is an " -"error if another exception is raised, or fails if no exception is raised. To " -"catch any of a group of exceptions, a tuple containing the exception classes " -"may be passed as *exception*." +"positional or keyword arguments that are also passed to :meth:" +"`assertRaises`. The test passes if *exception* is raised, is an error if " +"another exception is raised, or fails if no exception is raised. To catch " +"any of a group of exceptions, a tuple containing the exception classes may " +"be passed as *exception*." msgstr "" #: ../../library/unittest.rst:1015 @@ -1733,9 +1731,9 @@ msgstr "" #: ../../library/unittest.rst:1025 msgid "" -"The context manager will store the caught exception object in " -"its :attr:`exception` attribute. This can be useful if the intention is to " -"perform additional checks on the exception raised::" +"The context manager will store the caught exception object in its :attr:`!" +"exception` attribute. This can be useful if the intention is to perform " +"additional checks on the exception raised::" msgstr "" #: ../../library/unittest.rst:1029 @@ -1757,7 +1755,8 @@ msgid "Added the ability to use :meth:`assertRaises` as a context manager." msgstr "新增 :meth:`assertRaises` 可作為情境管理器使用的能力。" #: ../../library/unittest.rst:1038 -msgid "Added the :attr:`exception` attribute." +#, fuzzy +msgid "Added the :attr:`!exception` attribute." msgstr "新增 :attr:`exception` 屬性。" #: ../../library/unittest.rst:1041 ../../library/unittest.rst:1067 @@ -1769,8 +1768,8 @@ msgstr "新增作為情境管理器使用時的 *msg* 引數。" msgid "" "Like :meth:`assertRaises` but also tests that *regex* matches on the string " "representation of the raised exception. *regex* may be a regular expression " -"object or a string containing a regular expression suitable for use " -"by :func:`re.search`. Examples::" +"object or a string containing a regular expression suitable for use by :func:" +"`re.search`. Examples::" msgstr "" #: ../../library/unittest.rst:1053 @@ -1804,10 +1803,10 @@ msgstr "重新命名為 :meth:`assertRaisesRegex`。" #: ../../library/unittest.rst:1074 msgid "" "Test that a warning is triggered when *callable* is called with any " -"positional or keyword arguments that are also passed " -"to :meth:`assertWarns`. The test passes if *warning* is triggered and fails " -"if it isn't. Any exception is an error. To catch any of a group of " -"warnings, a tuple containing the warning classes may be passed as *warnings*." +"positional or keyword arguments that are also passed to :meth:" +"`assertWarns`. The test passes if *warning* is triggered and fails if it " +"isn't. Any exception is an error. To catch any of a group of warnings, a " +"tuple containing the warning classes may be passed as *warnings*." msgstr "" #: ../../library/unittest.rst:1081 @@ -1833,11 +1832,10 @@ msgstr "" #: ../../library/unittest.rst:1091 msgid "" -"The context manager will store the caught warning object in " -"its :attr:`warning` attribute, and the source line which triggered the " -"warnings in the :attr:`filename` and :attr:`lineno` attributes. This can be " -"useful if the intention is to perform additional checks on the warning " -"caught::" +"The context manager will store the caught warning object in its :attr:`!" +"warning` attribute, and the source line which triggered the warnings in the :" +"attr:`!filename` and :attr:`!lineno` attributes. This can be useful if the " +"intention is to perform additional checks on the warning caught::" msgstr "" #: ../../library/unittest.rst:1097 @@ -1864,8 +1862,8 @@ msgstr "" msgid "" "Like :meth:`assertWarns` but also tests that *regex* matches on the message " "of the triggered warning. *regex* may be a regular expression object or a " -"string containing a regular expression suitable for use " -"by :func:`re.search`. Example::" +"string containing a regular expression suitable for use by :func:`re." +"search`. Example::" msgstr "" #: ../../library/unittest.rst:1120 @@ -1894,9 +1892,9 @@ msgstr "" #: ../../library/unittest.rst:1140 msgid "" -"If given, *logger* should be a :class:`logging.Logger` object or " -"a :class:`str` giving the name of a logger. The default is the root logger, " -"which will catch all messages that were not blocked by a non-propagating " +"If given, *logger* should be a :class:`logging.Logger` object or a :class:" +"`str` giving the name of a logger. The default is the root logger, which " +"will catch all messages that were not blocked by a non-propagating " "descendent logger." msgstr "" @@ -1956,9 +1954,9 @@ msgstr "" #: ../../library/unittest.rst:1182 msgid "" -"If given, *logger* should be a :class:`logging.Logger` object or " -"a :class:`str` giving the name of a logger. The default is the root logger, " -"which will catch all messages." +"If given, *logger* should be a :class:`logging.Logger` object or a :class:" +"`str` giving the name of a logger. The default is the root logger, which " +"will catch all messages." msgstr "" #: ../../library/unittest.rst:1190 @@ -2098,8 +2096,8 @@ msgid "" "Test that *first* and *second* are approximately (or not approximately) " "equal by computing the difference, rounding to the given number of decimal " "*places* (default 7), and comparing to zero. Note that these methods round " -"the values to the given number of *decimal places* (i.e. like " -"the :func:`round` function) and not *significant digits*." +"the values to the given number of *decimal places* (i.e. like the :func:" +"`round` function) and not *significant digits*." msgstr "" #: ../../library/unittest.rst:1257 @@ -2148,8 +2146,8 @@ msgstr "以 ``assertRegexpMatches`` 為名新增。" #: ../../library/unittest.rst:1293 msgid "" -"The method ``assertRegexpMatches()`` has been renamed " -"to :meth:`.assertRegex`." +"The method ``assertRegexpMatches()`` has been renamed to :meth:`." +"assertRegex`." msgstr "``assertRegexpMatches()`` 方法已重新命名為 :meth:`.assertRegex`。" #: ../../library/unittest.rst:1296 @@ -2200,17 +2198,17 @@ msgid "" "Registers a type-specific method called by :meth:`assertEqual` to check if " "two objects of exactly the same *typeobj* (not subclasses) compare equal. " "*function* must take two positional arguments and a third msg=None keyword " -"argument just as :meth:`assertEqual` does. It must " -"raise :data:`self.failureException(msg) ` when inequality " -"between the first two parameters is detected -- possibly providing useful " -"information and explaining the inequalities in details in the error message." +"argument just as :meth:`assertEqual` does. It must raise :data:`self." +"failureException(msg) ` when inequality between the first " +"two parameters is detected -- possibly providing useful information and " +"explaining the inequalities in details in the error message." msgstr "" #: ../../library/unittest.rst:1363 msgid "" -"The list of type-specific methods automatically used " -"by :meth:`~TestCase.assertEqual` are summarized in the following table. " -"Note that it's usually not necessary to invoke these methods directly." +"The list of type-specific methods automatically used by :meth:`~TestCase." +"assertEqual` are summarized in the following table. Note that it's usually " +"not necessary to invoke these methods directly." msgstr "" #: ../../library/unittest.rst:1368 @@ -2304,8 +2302,8 @@ msgstr "" #: ../../library/unittest.rst:1433 msgid "" -"Fails if either of *first* or *second* does not have " -"a :meth:`set.difference` method." +"Fails if either of *first* or *second* does not have a :meth:`~frozenset." +"difference` method." msgstr "" #: ../../library/unittest.rst:1441 @@ -2331,8 +2329,8 @@ msgid "" "This class attribute gives the exception raised by the test method. If a " "test framework needs to use a specialized exception, possibly to carry " "additional information, it must subclass this exception in order to \"play " -"fair\" with the framework. The initial value of this attribute " -"is :exc:`AssertionError`." +"fair\" with the framework. The initial value of this attribute is :exc:" +"`AssertionError`." msgstr "" #: ../../library/unittest.rst:1472 @@ -2360,8 +2358,8 @@ msgid "" "This attribute controls the maximum length of diffs output by assert methods " "that report diffs on failure. It defaults to 80*8 characters. Assert methods " "affected by this attribute are :meth:`assertSequenceEqual` (including all " -"the sequence comparison methods that delegate to " -"it), :meth:`assertDictEqual` and :meth:`assertMultiLineEqual`." +"the sequence comparison methods that delegate to it), :meth:" +"`assertDictEqual` and :meth:`assertMultiLineEqual`." msgstr "" #: ../../library/unittest.rst:1496 @@ -2378,8 +2376,8 @@ msgstr "" #: ../../library/unittest.rst:1508 msgid "" -"Return the number of tests represented by this test object. " -"For :class:`TestCase` instances, this will always be ``1``." +"Return the number of tests represented by this test object. For :class:" +"`TestCase` instances, this will always be ``1``." msgstr "" #: ../../library/unittest.rst:1514 @@ -2391,9 +2389,9 @@ msgstr "" #: ../../library/unittest.rst:1518 msgid "" -"For :class:`TestCase` instances, this will always be an instance " -"of :class:`TestResult`; subclasses of :class:`TestCase` should override this " -"as necessary." +"For :class:`TestCase` instances, this will always be an instance of :class:" +"`TestResult`; subclasses of :class:`TestCase` should override this as " +"necessary." msgstr "" #: ../../library/unittest.rst:1525 @@ -2413,8 +2411,8 @@ msgstr "" msgid "" "In 3.1 this was changed to add the test name to the short description even " "in the presence of a docstring. This caused compatibility issues with " -"unittest extensions and adding the test name was moved to " -"the :class:`TextTestResult` in Python 3.2." +"unittest extensions and adding the test name was moved to the :class:" +"`TextTestResult` in Python 3.2." msgstr "" #: ../../library/unittest.rst:1545 @@ -2434,23 +2432,22 @@ msgstr "" #: ../../library/unittest.rst:1559 msgid "" -"Enter the supplied :term:`context manager`. If successful, also add " -"its :meth:`~object.__exit__` method as a cleanup function " -"by :meth:`addCleanup` and return the result of the :meth:`~object.__enter__` " -"method." +"Enter the supplied :term:`context manager`. If successful, also add its :" +"meth:`~object.__exit__` method as a cleanup function by :meth:`addCleanup` " +"and return the result of the :meth:`~object.__enter__` method." msgstr "" #: ../../library/unittest.rst:1569 msgid "" -"This method is called unconditionally after :meth:`tearDown`, or " -"after :meth:`setUp` if :meth:`setUp` raises an exception." +"This method is called unconditionally after :meth:`tearDown`, or after :meth:" +"`setUp` if :meth:`setUp` raises an exception." msgstr "" #: ../../library/unittest.rst:1572 msgid "" -"It is responsible for calling all the cleanup functions added " -"by :meth:`addCleanup`. If you need cleanup functions to be called *prior* " -"to :meth:`tearDown` then you can call :meth:`doCleanups` yourself." +"It is responsible for calling all the cleanup functions added by :meth:" +"`addCleanup`. If you need cleanup functions to be called *prior* to :meth:" +"`tearDown` then you can call :meth:`doCleanups` yourself." msgstr "" #: ../../library/unittest.rst:1577 @@ -2476,24 +2473,23 @@ msgstr "" #: ../../library/unittest.rst:1599 msgid "" -"Enter the supplied :term:`context manager`. If successful, also add " -"its :meth:`~object.__exit__` method as a cleanup function " -"by :meth:`addClassCleanup` and return the result of " -"the :meth:`~object.__enter__` method." +"Enter the supplied :term:`context manager`. If successful, also add its :" +"meth:`~object.__exit__` method as a cleanup function by :meth:" +"`addClassCleanup` and return the result of the :meth:`~object.__enter__` " +"method." msgstr "" #: ../../library/unittest.rst:1609 msgid "" -"This method is called unconditionally after :meth:`tearDownClass`, or " -"after :meth:`setUpClass` if :meth:`setUpClass` raises an exception." +"This method is called unconditionally after :meth:`tearDownClass`, or after :" +"meth:`setUpClass` if :meth:`setUpClass` raises an exception." msgstr "" #: ../../library/unittest.rst:1612 msgid "" -"It is responsible for calling all the cleanup functions added " -"by :meth:`addClassCleanup`. If you need cleanup functions to be called " -"*prior* to :meth:`tearDownClass` then you can call :meth:`doClassCleanups` " -"yourself." +"It is responsible for calling all the cleanup functions added by :meth:" +"`addClassCleanup`. If you need cleanup functions to be called *prior* to :" +"meth:`tearDownClass` then you can call :meth:`doClassCleanups` yourself." msgstr "" #: ../../library/unittest.rst:1617 @@ -2516,18 +2512,18 @@ msgstr "" #: ../../library/unittest.rst:1641 msgid "" -"Method called to prepare the test fixture. This is called " -"after :meth:`setUp`. This is called immediately before calling the test " -"method; other than :exc:`AssertionError` or :exc:`SkipTest`, any exception " -"raised by this method will be considered an error rather than a test " -"failure. The default implementation does nothing." +"Method called to prepare the test fixture. This is called after :meth:" +"`TestCase.setUp`. This is called immediately before calling the test method; " +"other than :exc:`AssertionError` or :exc:`SkipTest`, any exception raised by " +"this method will be considered an error rather than a test failure. The " +"default implementation does nothing." msgstr "" #: ../../library/unittest.rst:1650 msgid "" "Method called immediately after the test method has been called and the " -"result recorded. This is called before :meth:`tearDown`. This is called " -"even if the test method raised an exception, so the implementation in " +"result recorded. This is called before :meth:`~TestCase.tearDown`. This is " +"called even if the test method raised an exception, so the implementation in " "subclasses may need to be particularly careful about checking internal " "state. Any exception, other than :exc:`AssertionError` or :exc:`SkipTest`, " "raised by this method will be considered an additional error rather than a " @@ -2543,17 +2539,17 @@ msgstr "" #: ../../library/unittest.rst:1667 msgid "" "Enter the supplied :term:`asynchronous context manager`. If successful, " -"also add its :meth:`~object.__aexit__` method as a cleanup function " -"by :meth:`addAsyncCleanup` and return the result of " -"the :meth:`~object.__aenter__` method." +"also add its :meth:`~object.__aexit__` method as a cleanup function by :meth:" +"`addAsyncCleanup` and return the result of the :meth:`~object.__aenter__` " +"method." msgstr "" #: ../../library/unittest.rst:1677 msgid "" -"Sets up a new event loop to run the test, collecting the result into " -"the :class:`TestResult` object passed as *result*. If *result* is omitted " -"or ``None``, a temporary result object is created (by calling " -"the :meth:`defaultTestResult` method) and used. The result object is " +"Sets up a new event loop to run the test, collecting the result into the :" +"class:`TestResult` object passed as *result*. If *result* is omitted or " +"``None``, a temporary result object is created (by calling the :meth:" +"`~TestCase.defaultTestResult` method) and used. The result object is " "returned to :meth:`run`'s caller. At the end of the test all the tasks in " "the event loop are cancelled." msgstr "" @@ -2581,8 +2577,8 @@ msgid "" "\n" " async def test_response(self):\n" " events.append(\"test_response\")\n" -" response = await self._async_connection.get(\"https://" -"example.com\")\n" +" response = await self._async_connection.get(\"https://example." +"com\")\n" " self.assertEqual(response.status_code, 200)\n" " self.addAsyncCleanup(self.on_cleanup)\n" "\n" @@ -2616,8 +2612,8 @@ msgstr "" "\n" " async def test_response(self):\n" " events.append(\"test_response\")\n" -" response = await self._async_connection.get(\"https://" -"example.com\")\n" +" response = await self._async_connection.get(\"https://example." +"com\")\n" " self.assertEqual(response.status_code, 200)\n" " self.addAsyncCleanup(self.on_cleanup)\n" "\n" @@ -2646,8 +2642,8 @@ msgid "" "This class implements the portion of the :class:`TestCase` interface which " "allows the test runner to drive the test, but does not provide the methods " "which test code can use to check and report errors. This is used to create " -"test cases using legacy test code, allowing it to be integrated into " -"a :mod:`unittest`-based test framework." +"test cases using legacy test code, allowing it to be integrated into a :mod:" +"`unittest`-based test framework." msgstr "" #: ../../library/unittest.rst:1736 @@ -2684,8 +2680,8 @@ msgstr "" #: ../../library/unittest.rst:1762 msgid "" -"Add all the tests from an iterable of :class:`TestCase` " -"and :class:`TestSuite` instances to this test suite." +"Add all the tests from an iterable of :class:`TestCase` and :class:" +"`TestSuite` instances to this test suite." msgstr "" #: ../../library/unittest.rst:1765 @@ -2701,9 +2697,8 @@ msgstr "" #: ../../library/unittest.rst:1773 msgid "" "Run the tests associated with this suite, collecting the result into the " -"test result object passed as *result*. Note that " -"unlike :meth:`TestCase.run`, :meth:`TestSuite.run` requires the result " -"object to be passed in." +"test result object passed as *result*. Note that unlike :meth:`TestCase." +"run`, :meth:`TestSuite.run` requires the result object to be passed in." msgstr "" #: ../../library/unittest.rst:1781 @@ -2728,7 +2723,7 @@ msgid "" "repeated iterations before :meth:`TestSuite.run` must be the same for each " "call iteration. After :meth:`TestSuite.run`, callers should not rely on the " "tests returned by this method unless the caller uses a subclass that " -"overrides :meth:`TestSuite._removeTestAtIndex` to preserve test references." +"overrides :meth:`!TestSuite._removeTestAtIndex` to preserve test references." msgstr "" #: ../../library/unittest.rst:1804 @@ -2740,15 +2735,16 @@ msgstr "" #: ../../library/unittest.rst:1809 msgid "" -"In earlier versions the :class:`TestSuite` held references to " -"each :class:`TestCase` after :meth:`TestSuite.run`. Subclasses can restore " -"that behavior by overriding :meth:`TestSuite._removeTestAtIndex`." +"In earlier versions the :class:`TestSuite` held references to each :class:" +"`TestCase` after :meth:`TestSuite.run`. Subclasses can restore that behavior " +"by overriding :meth:`!TestSuite._removeTestAtIndex`." msgstr "" #: ../../library/unittest.rst:1814 msgid "" "In the typical usage of a :class:`TestSuite` object, the :meth:`run` method " -"is invoked by a :class:`TestRunner` rather than by the end-user test harness." +"is invoked by a :class:`!TestRunner` rather than by the end-user test " +"harness." msgstr "" #: ../../library/unittest.rst:1819 @@ -2759,9 +2755,9 @@ msgstr "" msgid "" "The :class:`TestLoader` class is used to create test suites from classes and " "modules. Normally, there is no need to create an instance of this class; " -"the :mod:`unittest` module provides an instance that can be shared " -"as :data:`unittest.defaultTestLoader`. Using a subclass or instance, " -"however, allows customization of some configurable properties." +"the :mod:`unittest` module provides an instance that can be shared as :data:" +"`unittest.defaultTestLoader`. Using a subclass or instance, however, allows " +"customization of some configurable properties." msgstr "" #: ../../library/unittest.rst:1829 @@ -2782,17 +2778,17 @@ msgstr "" #: ../../library/unittest.rst:1848 msgid "" -"Return a suite of all test cases contained in the :class:`TestCase`\\ " -"-derived :class:`testCaseClass`." +"Return a suite of all test cases contained in the :class:`TestCase`\\ -" +"derived :class:`!testCaseClass`." msgstr "" #: ../../library/unittest.rst:1851 msgid "" -"A test case instance is created for each method named " -"by :meth:`getTestCaseNames`. By default these are the method names beginning " -"with ``test``. If :meth:`getTestCaseNames` returns no methods, but " -"the :meth:`runTest` method is implemented, a single test case is created for " -"that method instead." +"A test case instance is created for each method named by :meth:" +"`getTestCaseNames`. By default these are the method names beginning with " +"``test``. If :meth:`getTestCaseNames` returns no methods, but the :meth:`!" +"runTest` method is implemented, a single test case is created for that " +"method instead." msgstr "" #: ../../library/unittest.rst:1860 @@ -2839,23 +2835,23 @@ msgstr "" #: ../../library/unittest.rst:1893 msgid "" "The specifier *name* is a \"dotted name\" that may resolve either to a " -"module, a test case class, a test method within a test case class, " -"a :class:`TestSuite` instance, or a callable object which returns " -"a :class:`TestCase` or :class:`TestSuite` instance. These checks are " -"applied in the order listed here; that is, a method on a possible test case " -"class will be picked up as \"a test method within a test case class\", " -"rather than \"a callable object\"." +"module, a test case class, a test method within a test case class, a :class:" +"`TestSuite` instance, or a callable object which returns a :class:`TestCase` " +"or :class:`TestSuite` instance. These checks are applied in the order " +"listed here; that is, a method on a possible test case class will be picked " +"up as \"a test method within a test case class\", rather than \"a callable " +"object\"." msgstr "" #: ../../library/unittest.rst:1901 msgid "" -"For example, if you have a module :mod:`SampleTests` containing " -"a :class:`TestCase`\\ -derived class :class:`SampleTestCase` with three test " -"methods (:meth:`test_one`, :meth:`test_two`, and :meth:`test_three`), the " +"For example, if you have a module :mod:`!SampleTests` containing a :class:" +"`TestCase`\\ -derived class :class:`!SampleTestCase` with three test methods " +"(:meth:`!test_one`, :meth:`!test_two`, and :meth:`!test_three`), the " "specifier ``'SampleTests.SampleTestCase'`` would cause this method to return " "a suite which will run all three test methods. Using the specifier " "``'SampleTests.SampleTestCase.test_two'`` would cause it to return a test " -"suite which will run only the :meth:`test_two` test method. The specifier " +"suite which will run only the :meth:`!test_two` test method. The specifier " "can refer to modules and packages which have not been imported; they will be " "imported as a side-effect." msgstr "" @@ -2997,15 +2993,15 @@ msgstr "" #: ../../library/unittest.rst:2013 msgid "" -"Function to be used to compare method names when sorting them " -"in :meth:`getTestCaseNames` and all the ``loadTestsFrom*`` methods." +"Function to be used to compare method names when sorting them in :meth:" +"`getTestCaseNames` and all the ``loadTestsFrom*`` methods." msgstr "" #: ../../library/unittest.rst:2019 msgid "" "Callable object that constructs a test suite from a list of tests. No " -"methods on the resulting object are needed. The default value is " -"the :class:`TestSuite` class." +"methods on the resulting object are needed. The default value is the :class:" +"`TestSuite` class." msgstr "" #: ../../library/unittest.rst:2023 ../../library/unittest.rst:2036 @@ -3035,18 +3031,18 @@ msgstr "" #: ../../library/unittest.rst:2046 msgid "" -"A :class:`TestResult` object stores the results of a set of tests. " -"The :class:`TestCase` and :class:`TestSuite` classes ensure that results are " +"A :class:`TestResult` object stores the results of a set of tests. The :" +"class:`TestCase` and :class:`TestSuite` classes ensure that results are " "properly recorded; test authors do not need to worry about recording the " "outcome of tests." msgstr "" #: ../../library/unittest.rst:2051 msgid "" -"Testing frameworks built on top of :mod:`unittest` may want access to " -"the :class:`TestResult` object generated by running a set of tests for " -"reporting purposes; a :class:`TestResult` instance is returned by " -"the :meth:`TestRunner.run` method for this purpose." +"Testing frameworks built on top of :mod:`unittest` may want access to the :" +"class:`TestResult` object generated by running a set of tests for reporting " +"purposes; a :class:`TestResult` instance is returned by the :meth:`!" +"TestRunner.run` method for this purpose." msgstr "" #: ../../library/unittest.rst:2056 @@ -3137,16 +3133,16 @@ msgstr "" #: ../../library/unittest.rst:2138 msgid "" "This method can be called to signal that the set of tests being run should " -"be aborted by setting the :attr:`shouldStop` attribute to " -"``True``. :class:`TestRunner` objects should respect this flag and return " -"without running any additional tests." +"be aborted by setting the :attr:`shouldStop` attribute to ``True``. :class:`!" +"TestRunner` objects should respect this flag and return without running any " +"additional tests." msgstr "" #: ../../library/unittest.rst:2143 msgid "" "For example, this feature is used by the :class:`TextTestRunner` class to " "stop the test framework when the user signals an interrupt from the " -"keyboard. Interactive tools which provide :class:`TestRunner` " +"keyboard. Interactive tools which provide :class:`!TestRunner` " "implementations can use this in a similar manner." msgstr "" @@ -3225,8 +3221,8 @@ msgstr "" #: ../../library/unittest.rst:2216 msgid "" -"Called when the test case *test* fails or errors, but was marked with " -"the :func:`expectedFailure` decorator." +"Called when the test case *test* fails or errors, but was marked with the :" +"func:`expectedFailure` decorator." msgstr "" #: ../../library/unittest.rst:2219 @@ -3244,8 +3240,8 @@ msgstr "" #: ../../library/unittest.rst:2229 msgid "" -"The default implementation appends the test to the " -"instance's :attr:`unexpectedSuccesses` attribute." +"The default implementation appends the test to the instance's :attr:" +"`unexpectedSuccesses` attribute." msgstr "" #: ../../library/unittest.rst:2235 @@ -3258,8 +3254,8 @@ msgstr "" #: ../../library/unittest.rst:2239 msgid "" "If *outcome* is :const:`None`, the subtest succeeded. Otherwise, it failed " -"with an exception where *outcome* is a tuple of the form returned " -"by :func:`sys.exc_info`: ``(type, value, traceback)``." +"with an exception where *outcome* is a tuple of the form returned by :func:" +"`sys.exc_info`: ``(type, value, traceback)``." msgstr "" #: ../../library/unittest.rst:2243 @@ -3276,8 +3272,8 @@ msgstr "" #: ../../library/unittest.rst:2257 msgid "" -"A concrete implementation of :class:`TestResult` used by " -"the :class:`TextTestRunner`. Subclasses should accept ``**kwargs`` to ensure " +"A concrete implementation of :class:`TestResult` used by the :class:" +"`TextTestRunner`. Subclasses should accept ``**kwargs`` to ensure " "compatibility as the interface changes." msgstr "" @@ -3305,12 +3301,12 @@ msgstr "" #: ../../library/unittest.rst:2284 msgid "" -"By default this runner " -"shows :exc:`DeprecationWarning`, :exc:`PendingDeprecationWarning`, :exc:`ResourceWarning` " -"and :exc:`ImportWarning` even if they are :ref:`ignored by default `. This behavior can be overridden using Python's :option:`!-Wd` " -"or :option:`!-Wa` options (see :ref:`Warning control `) " -"and leaving *warnings* to ``None``." +"By default this runner shows :exc:`DeprecationWarning`, :exc:" +"`PendingDeprecationWarning`, :exc:`ResourceWarning` and :exc:`ImportWarning` " +"even if they are :ref:`ignored by default `. This behavior " +"can be overridden using Python's :option:`!-Wd` or :option:`!-Wa` options " +"(see :ref:`Warning control `) and leaving *warnings* to " +"``None``." msgstr "" #: ../../library/unittest.rst:2292 @@ -3353,9 +3349,9 @@ msgstr "" #: ../../library/unittest.rst:2320 msgid "" "This method is the main public interface to the ``TextTestRunner``. This " -"method takes a :class:`TestSuite` or :class:`TestCase` instance. " -"A :class:`TestResult` is created by calling :func:`_makeResult` and the " -"test(s) are run and the results printed to stdout." +"method takes a :class:`TestSuite` or :class:`TestCase` instance. A :class:" +"`TestResult` is created by calling :func:`_makeResult` and the test(s) are " +"run and the results printed to stdout." msgstr "" #: ../../library/unittest.rst:2331 @@ -3482,8 +3478,8 @@ msgstr "" #: ../../library/unittest.rst:2403 msgid "" -"If a test module defines ``load_tests`` it will be called " -"by :meth:`TestLoader.loadTestsFromModule` with the following arguments::" +"If a test module defines ``load_tests`` it will be called by :meth:" +"`TestLoader.loadTestsFromModule` with the following arguments::" msgstr "" #: ../../library/unittest.rst:2406 ../../library/unittest.rst:2438 @@ -3511,8 +3507,8 @@ msgstr "" #: ../../library/unittest.rst:2419 msgid "" -"A typical ``load_tests`` function that loads tests from a specific set " -"of :class:`TestCase` classes may look like::" +"A typical ``load_tests`` function that loads tests from a specific set of :" +"class:`TestCase` classes may look like::" msgstr "" #: ../../library/unittest.rst:2422 @@ -3538,19 +3534,18 @@ msgstr "" #: ../../library/unittest.rst:2431 msgid "" "If discovery is started in a directory containing a package, either from the " -"command line or by calling :meth:`TestLoader.discover`, then the " -"package :file:`__init__.py` will be checked for ``load_tests``. If that " -"function does not exist, discovery will recurse into the package as though " -"it were just another directory. Otherwise, discovery of the package's tests " -"will be left up to ``load_tests`` which is called with the following " -"arguments::" +"command line or by calling :meth:`TestLoader.discover`, then the package :" +"file:`__init__.py` will be checked for ``load_tests``. If that function " +"does not exist, discovery will recurse into the package as though it were " +"just another directory. Otherwise, discovery of the package's tests will be " +"left up to ``load_tests`` which is called with the following arguments::" msgstr "" #: ../../library/unittest.rst:2440 msgid "" "This should return a :class:`TestSuite` representing all the tests from the " -"package. (``standard_tests`` will only contain tests collected " -"from :file:`__init__.py`.)" +"package. (``standard_tests`` will only contain tests collected from :file:" +"`__init__.py`.)" msgstr "" #: ../../library/unittest.rst:2444 @@ -3583,9 +3578,9 @@ msgstr "" #: ../../library/unittest.rst:2464 msgid "" "Class and module level fixtures are implemented in :class:`TestSuite`. When " -"the test suite encounters a test from a new class then :meth:`tearDownClass` " -"from the previous class (if there is one) is called, followed " -"by :meth:`setUpClass` from the new class." +"the test suite encounters a test from a new class then :meth:`~TestCase." +"tearDownClass` from the previous class (if there is one) is called, followed " +"by :meth:`~TestCase.setUpClass` from the new class." msgstr "" #: ../../library/unittest.rst:2469 @@ -3670,17 +3665,17 @@ msgstr "" #: ../../library/unittest.rst:2514 msgid "" "If you want the ``setUpClass`` and ``tearDownClass`` on base classes called " -"then you must call up to them yourself. The implementations " -"in :class:`TestCase` are empty." +"then you must call up to them yourself. The implementations in :class:" +"`TestCase` are empty." msgstr "" #: ../../library/unittest.rst:2518 msgid "" "If an exception is raised during a ``setUpClass`` then the tests in the " "class are not run and the ``tearDownClass`` is not run. Skipped classes will " -"not have ``setUpClass`` or ``tearDownClass`` run. If the exception is " -"a :exc:`SkipTest` exception then the class will be reported as having been " -"skipped instead of as an error." +"not have ``setUpClass`` or ``tearDownClass`` run. If the exception is a :exc:" +"`SkipTest` exception then the class will be reported as having been skipped " +"instead of as an error." msgstr "" #: ../../library/unittest.rst:2526 @@ -3724,8 +3719,8 @@ msgid "" "Add a function to be called after :func:`tearDownModule` to cleanup " "resources used during the test class. Functions will be called in reverse " "order to the order they are added (:abbr:`LIFO (last-in, first-out)`). They " -"are called with any arguments and keyword arguments passed " -"into :meth:`addModuleCleanup` when they are added." +"are called with any arguments and keyword arguments passed into :meth:" +"`addModuleCleanup` when they are added." msgstr "" #: ../../library/unittest.rst:2557 @@ -3736,10 +3731,10 @@ msgstr "" #: ../../library/unittest.rst:2565 msgid "" -"Enter the supplied :term:`context manager`. If successful, also add " -"its :meth:`~object.__exit__` method as a cleanup function " -"by :func:`addModuleCleanup` and return the result of " -"the :meth:`~object.__enter__` method." +"Enter the supplied :term:`context manager`. If successful, also add its :" +"meth:`~object.__exit__` method as a cleanup function by :func:" +"`addModuleCleanup` and return the result of the :meth:`~object.__enter__` " +"method." msgstr "" #: ../../library/unittest.rst:2575 @@ -3750,10 +3745,9 @@ msgstr "" #: ../../library/unittest.rst:2578 msgid "" -"It is responsible for calling all the cleanup functions added " -"by :func:`addModuleCleanup`. If you need cleanup functions to be called " -"*prior* to :func:`tearDownModule` then you can call :func:`doModuleCleanups` " -"yourself." +"It is responsible for calling all the cleanup functions added by :func:" +"`addModuleCleanup`. If you need cleanup functions to be called *prior* to :" +"func:`tearDownModule` then you can call :func:`doModuleCleanups` yourself." msgstr "" #: ../../library/unittest.rst:2583 @@ -3780,12 +3774,12 @@ msgstr "" msgid "" "The control-c handling signal handler attempts to remain compatible with " "code or tests that install their own :const:`signal.SIGINT` handler. If the " -"``unittest`` handler is called but *isn't* the " -"installed :const:`signal.SIGINT` handler, i.e. it has been replaced by the " -"system under test and delegated to, then it calls the default handler. This " -"will normally be the expected behavior by code that replaces an installed " -"handler and delegates to it. For individual tests that need ``unittest`` " -"control-c handling disabled the :func:`removeHandler` decorator can be used." +"``unittest`` handler is called but *isn't* the installed :const:`signal." +"SIGINT` handler, i.e. it has been replaced by the system under test and " +"delegated to, then it calls the default handler. This will normally be the " +"expected behavior by code that replaces an installed handler and delegates " +"to it. For individual tests that need ``unittest`` control-c handling " +"disabled the :func:`removeHandler` decorator can be used." msgstr "" #: ../../library/unittest.rst:2610 @@ -3817,9 +3811,9 @@ msgstr "" #: ../../library/unittest.rst:2633 msgid "" -"Remove a registered result. Once a result has been removed " -"then :meth:`~TestResult.stop` will no longer be called on that result object " -"in response to a control-c." +"Remove a registered result. Once a result has been removed then :meth:" +"`~TestResult.stop` will no longer be called on that result object in " +"response to a control-c." msgstr "" #: ../../library/unittest.rst:2640 From 14fc3ae051fb75516fef6ea2bc54c31cfaf82866 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 24 Nov 2025 00:17:10 +0000 Subject: [PATCH 03/13] sync with cpython 394db662 --- sphinx.po | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sphinx.po b/sphinx.po index 9a41dadd4c..928cc74982 100644 --- a/sphinx.po +++ b/sphinx.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2025-11-24 00:15+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -227,12 +227,13 @@ msgid "CPython implementation detail:" msgstr "CPython 實作細節:" #: ../../tools/templates/dummy.html:30 -msgid "" -"Deprecated since version {deprecated}, will be removed in version {removed}" +#, fuzzy +msgid "Deprecated since version %s, will be removed in version %s" msgstr "自從版本 {deprecated} 後不推薦使用,將會自版本 {removed} 中移除。" #: ../../tools/templates/dummy.html:31 -msgid "Deprecated since version {deprecated}, removed in version {removed}" +#, fuzzy +msgid "Deprecated since version %s, removed in version %s" msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" #: ../../tools/templates/dummy.html:35 From 5e66c1a944004ae06279b89f950a6ae205f4bdc0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 25 Nov 2025 00:14:54 +0000 Subject: [PATCH 04/13] sync with cpython 7ccdbbd0 --- c-api/import.po | 225 ++--- c-api/intro.po | 226 ++--- c-api/veryhigh.po | 40 +- extending/extending.po | 5 +- howto/unicode.po | 211 +++-- library/stdtypes.po | 2002 +++++++++++++++++++++------------------- 6 files changed, 1421 insertions(+), 1288 deletions(-) diff --git a/c-api/import.po b/c-api/import.po index 4537a6c00f..bea64933b6 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-25 00:13+0000\n" "PO-Revision-Date: 2025-11-11 14:06+0000\n" "Last-Translator: mattwang44@gmail.com\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,8 +25,8 @@ msgstr "引入模組" #: ../../c-api/import.rst:16 msgid "" -"This is a wrapper around :c:func:`PyImport_Import()` which takes " -"a :c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`." +"This is a wrapper around :c:func:`PyImport_Import()` which takes a :c:expr:" +"`const char *` as an argument instead of a :c:expr:`PyObject *`." msgstr "" "這是 :c:func:`PyImport_Import()` 的包裝器 (wrapper),它使用 :c:expr:`const " "char *` 作為引數,而不是 :c:expr:`PyObject *`。" @@ -43,7 +43,8 @@ msgid "" "needed anymore." msgstr "" "當引入鎖被其他執行緒持有時,這個函式過去會立即失敗。但在 Python 3.3 中,鎖機" -"制轉換成針對每個模組的鎖 (per-module lock) 來達到大多數目的,所以這個函式的特殊行為就不再需要了。" +"制轉換成針對每個模組的鎖 (per-module lock) 來達到大多數目的,所以這個函式的特" +"殊行為就不再需要了。" #: ../../c-api/import.rst:29 msgid "Use :c:func:`PyImport_ImportModule` instead." @@ -53,24 +54,24 @@ msgstr "請改用 :c:func:`PyImport_ImportModule`。" msgid "" "Import a module. This is best described by referring to the built-in Python " "function :func:`__import__`." -msgstr "引入一個模組。這最好透過參考 Python 內建函式 :func:`__import__` 來說明。" +msgstr "" +"引入一個模組。這最好透過參考 Python 內建函式 :func:`__import__` 來說明。" #: ../../c-api/import.rst:40 ../../c-api/import.rst:56 msgid "" "The return value is a new reference to the imported module or top-level " -"package, or ``NULL`` with an exception set on failure. Like " -"for :func:`__import__`, the return value when a submodule of a package was " -"requested is normally the top-level package, unless a non-empty *fromlist* " -"was given." +"package, or ``NULL`` with an exception set on failure. Like for :func:" +"`__import__`, the return value when a submodule of a package was requested " +"is normally the top-level package, unless a non-empty *fromlist* was given." msgstr "" -"回傳值是對引入的模組或頂層套件的新參照,或者是 ``NULL``,失敗時會設定例外。" -"就像 :func:`__import__` 一樣,當要求一個套件的子模組時,回傳值通常是頂層套" -"件,除非給定一個非空的 *fromlist*。" +"回傳值是對引入的模組或頂層套件的新參照,或者是 ``NULL``,失敗時會設定例外。就" +"像 :func:`__import__` 一樣,當要求一個套件的子模組時,回傳值通常是頂層套件," +"除非給定一個非空的 *fromlist*。" #: ../../c-api/import.rst:46 msgid "" -"Failing imports remove incomplete module objects, like " -"with :c:func:`PyImport_ImportModule`." +"Failing imports remove incomplete module objects, like with :c:func:" +"`PyImport_ImportModule`." msgstr "" "失敗的引入會移除不完整的模組物件,就像 :c:func:`PyImport_ImportModule` 一樣。" @@ -80,8 +81,8 @@ msgid "" "function :func:`__import__`, as the standard :func:`__import__` function " "calls this function directly." msgstr "" -"引入一個模組。這最好透過參考內建的 Python 函式 :func:`__import__` 來說明,因為" -"標準的 :func:`__import__` 函式會直接呼叫這個函式。" +"引入一個模組。這最好透過參考內建的 Python 函式 :func:`__import__` 來說明,因" +"為標準的 :func:`__import__` 函式會直接呼叫這個函式。" #: ../../c-api/import.rst:66 msgid "" @@ -148,10 +149,10 @@ msgstr "模組名稱 *name* 是以 UTF-8 解碼。" #: ../../c-api/import.rst:102 msgid "" "This function does not load or import the module; if the module wasn't " -"already loaded, you will get an empty module object. " -"Use :c:func:`PyImport_ImportModule` or one of its variants to import a " -"module. Package structures implied by a dotted name for *name* are not " -"created if not already present." +"already loaded, you will get an empty module object. Use :c:func:" +"`PyImport_ImportModule` or one of its variants to import a module. Package " +"structures implied by a dotted name for *name* are not created if not " +"already present." msgstr "" "這個函式不會載入或引入模組;如果模組尚未載入,你將會得到一個空的模組物件。使" "用 :c:func:`PyImport_ImportModule` 或其變體來引入一個模組。如果尚未存在,則不" @@ -180,19 +181,19 @@ msgid "" "function :func:`compile`, load the module. Return a new reference to the " "module object, or ``NULL`` with an exception set if an error occurred. " "*name* is removed from :data:`sys.modules` in error cases, even if *name* " -"was already in :data:`sys.modules` on entry " -"to :c:func:`PyImport_ExecCodeModule`. Leaving incompletely initialized " -"modules in :data:`sys.modules` is dangerous, as imports of such modules have " -"no way to know that the module object is an unknown (and probably damaged " -"with respect to the module author's intents) state." -msgstr "" -"給定一個模組名稱(可能為 ``package.module`` 的形式),以及一個從 Python 位元組" -"碼檔讀取或從內建函式 :func:`compile` 取得的程式碼物件,載入模組。回傳模組物件" -"的新參照,如果發生錯誤,則回傳 ``NULL`` 並設定例外。在出錯的情況下,*name* 會" -"從 :data:`sys.modules` 中移除,即使 *name* 在進" -"入 :c:func:`PyImport_ExecCodeModule` 時已經在 :data:`sys.modules` 中。" -"在 :data:`sys.modules` 中留下未完全初始化的模組是很危險的,因為這種模組的引入" -"無法知道模組物件處於未知狀態(且相對於模組作者的意圖,很可能已經損壞)。" +"was already in :data:`sys.modules` on entry to :c:func:" +"`PyImport_ExecCodeModule`. Leaving incompletely initialized modules in :" +"data:`sys.modules` is dangerous, as imports of such modules have no way to " +"know that the module object is an unknown (and probably damaged with respect " +"to the module author's intents) state." +msgstr "" +"給定一個模組名稱(可能為 ``package.module`` 的形式),以及一個從 Python 位元" +"組碼檔讀取或從內建函式 :func:`compile` 取得的程式碼物件,載入模組。回傳模組物" +"件的新參照,如果發生錯誤,則回傳 ``NULL`` 並設定例外。在出錯的情況下,*name* " +"會從 :data:`sys.modules` 中移除,即使 *name* 在進入 :c:func:" +"`PyImport_ExecCodeModule` 時已經在 :data:`sys.modules` 中。在 :data:`sys." +"modules` 中留下未完全初始化的模組是很危險的,因為這種模組的引入無法知道模組物" +"件處於未知狀態(且相對於模組作者的意圖,很可能已經損壞)。" #: ../../c-api/import.rst:139 msgid "" @@ -209,20 +210,19 @@ msgstr "" #: ../../c-api/import.rst:144 msgid "" "The module's :attr:`~module.__file__` attribute will be set to the code " -"object's :attr:`~codeobject.co_filename`. If " -"applicable, :attr:`~module.__cached__` will also be set." +"object's :attr:`~codeobject.co_filename`. If applicable, :attr:`~module." +"__cached__` will also be set." msgstr "" -"模組的 :attr:`~module.__file__` 屬性將會設定為程式碼物件" -"的 :attr:`~codeobject.co_filename`。如果適用,:attr:`~module.__cached__` 也會" -"被設定。" +"模組的 :attr:`~module.__file__` 屬性將會設定為程式碼物件的 :attr:" +"`~codeobject.co_filename`。如果適用,:attr:`~module.__cached__` 也會被設定。" #: ../../c-api/import.rst:148 msgid "" -"This function will reload the module if it was already imported. " -"See :c:func:`PyImport_ReloadModule` for the intended way to reload a module." +"This function will reload the module if it was already imported. See :c:" +"func:`PyImport_ReloadModule` for the intended way to reload a module." msgstr "" -"如果模組已經被引入,這個函式會重新載入模組。請參" -"閱 :c:func:`PyImport_ReloadModule` 以取得重新載入模組的預期方法。" +"如果模組已經被引入,這個函式會重新載入模組。請參閱 :c:func:" +"`PyImport_ReloadModule` 以取得重新載入模組的預期方法。" #: ../../c-api/import.rst:151 msgid "" @@ -234,11 +234,11 @@ msgstr "" #: ../../c-api/import.rst:154 msgid "" -"See also :c:func:`PyImport_ExecCodeModuleEx` " -"and :c:func:`PyImport_ExecCodeModuleWithPathnames`." +"See also :c:func:`PyImport_ExecCodeModuleEx` and :c:func:" +"`PyImport_ExecCodeModuleWithPathnames`." msgstr "" -"另請參閱 :c:func:`PyImport_ExecCodeModuleEx` " -"及 :c:func:`PyImport_ExecCodeModuleWithPathnames`。" +"另請參閱 :c:func:`PyImport_ExecCodeModuleEx` 及 :c:func:" +"`PyImport_ExecCodeModuleWithPathnames`。" #: ../../c-api/import.rst:157 msgid "" @@ -266,17 +266,17 @@ msgid "" "attribute of the module object is set to *cpathname* if it is non-``NULL``. " "Of the three functions, this is the preferred one to use." msgstr "" -"類似於 :c:func:`PyImport_ExecCodeModuleEx`,但是如果 *cpathname* 不" -"是 ``NULL``,模組物件的 :attr:`~module.__cached__` 屬性會被設定" -"為 *cpathname*。在這三個函式中,這是首選的函式。" +"類似於 :c:func:`PyImport_ExecCodeModuleEx`,但是如果 *cpathname* 不是 " +"``NULL``,模組物件的 :attr:`~module.__cached__` 屬性會被設定為 *cpathname*。" +"在這三個函式中,這是首選的函式。" #: ../../c-api/import.rst:179 msgid "" -"Setting :attr:`~module.__cached__` is deprecated. " -"See :class:`~importlib.machinery.ModuleSpec` for alternatives." +"Setting :attr:`~module.__cached__` is deprecated. See :class:`~importlib." +"machinery.ModuleSpec` for alternatives." msgstr "" -"設定 :attr:`~module.__cached__` 已被棄用。請參" -"閱 :class:`~importlib.machinery.ModuleSpec` 以取得替代方案。" +"設定 :attr:`~module.__cached__` 已被棄用。請參閱 :class:`~importlib." +"machinery.ModuleSpec` 以取得替代方案。" #: ../../c-api/import.rst:186 msgid "" @@ -286,16 +286,16 @@ msgid "" "set to ``NULL``." msgstr "" "類似於 :c:func:`PyImport_ExecCodeModuleObject`,但是 *name*、*pathname* 和 " -"*cpathname* 是 UTF-8 編碼的字串。如果 *pathname* 被設定為 ``NULL``,也會嘗試從 " -"*cpathname* 中找出 *pathname* 的值應該是什麼。" +"*cpathname* 是 UTF-8 編碼的字串。如果 *pathname* 被設定為 ``NULL``,也會嘗試" +"從 *cpathname* 中找出 *pathname* 的值應該是什麼。" #: ../../c-api/import.rst:192 msgid "" "Uses :func:`!imp.source_from_cache` in calculating the source path if only " "the bytecode path is provided." msgstr "" -"如果只提供了位元組碼路徑,則在計算原始碼路徑時使" -"用 :func:`!imp.source_from_cache`。" +"如果只提供了位元組碼路徑,則在計算原始碼路徑時使用 :func:`!imp." +"source_from_cache`。" #: ../../c-api/import.rst:195 msgid "No longer uses the removed :mod:`!imp` module." @@ -321,13 +321,13 @@ msgid "" "names. Keep in mind that the value at ``sys.implementation.cache_tag`` is " "authoritative and should be used instead of this function." msgstr "" -"回傳 :pep:`3147` 格式 Python 位元組碼檔名的魔術標籤字串。請記住," -"``sys.implementation.cache_tag`` 的值是權威的,應該使用它來取代這個函式。" +"回傳 :pep:`3147` 格式 Python 位元組碼檔名的魔術標籤字串。請記住,``sys." +"implementation.cache_tag`` 的值是權威的,應該使用它來取代這個函式。" #: ../../c-api/import.rst:219 msgid "" -"Return the dictionary used for the module administration (a.k.a. " -"``sys.modules``). Note that this is a per-interpreter variable." +"Return the dictionary used for the module administration (a.k.a. ``sys." +"modules``). Note that this is a per-interpreter variable." msgstr "" "回傳用於模組管理的字典(也稱為 ``sys.modules``)。請注意,這是一個針對每個直" "譯器的變數 (per-interpreter variable)。" @@ -338,8 +338,8 @@ msgid "" "not been imported yet then returns ``NULL`` but does not set an error. " "Returns ``NULL`` and sets an error if the lookup failed." msgstr "" -"回傳已以給定名稱引入的模組。如果模組尚未引入,則會回傳 ``NULL`` 但不會設" -"定錯誤。如果查找失敗,則回傳 ``NULL`` 並設定錯誤。" +"回傳已以給定名稱引入的模組。如果模組尚未引入,則會回傳 ``NULL`` 但不會設定錯" +"誤。如果查找失敗,則回傳 ``NULL`` 並設定錯誤。" #: ../../c-api/import.rst:232 msgid "" @@ -348,29 +348,28 @@ msgid "" "dict. If it wasn't yet cached, traverse :data:`sys.path_hooks` until a hook " "is found that can handle the path item. Return ``None`` if no hook could; " "this tells our caller that the :term:`path based finder` could not find a " -"finder for this path item. Cache the result " -"in :data:`sys.path_importer_cache`. Return a new reference to the finder " -"object." +"finder for this path item. Cache the result in :data:`sys." +"path_importer_cache`. Return a new reference to the finder object." msgstr "" -"回傳 :data:`sys.path`/:attr:`!pkg.__path__` 項 *path* 的查找器物件 (finder object)," -"可能的方式是從 :data:`sys.path_importer_cache` 字典取得。如果它還沒有被快取,就遍" -"歷 :data:`sys.path_hooks` 直到找到可以處理路徑項的掛勾。如果沒有掛勾可以處" -"理,則回傳 ``None``;這會告訴我們的呼叫者 :term:`path based finder` 找不到這" -"個路徑項的查找器。將結果快取到 :data:`sys.path_importer_cache`。回傳查找器物" -"件的新參照。" +"回傳 :data:`sys.path`/:attr:`!pkg.__path__` 項 *path* 的查找器物件 (finder " +"object),可能的方式是從 :data:`sys.path_importer_cache` 字典取得。如果它還沒" +"有被快取,就遍歷 :data:`sys.path_hooks` 直到找到可以處理路徑項的掛勾。如果沒" +"有掛勾可以處理,則回傳 ``None``;這會告訴我們的呼叫者 :term:`path based " +"finder` 找不到這個路徑項的查找器。將結果快取到 :data:`sys." +"path_importer_cache`。回傳查找器物件的新參照。" #: ../../c-api/import.rst:243 msgid "" "Load a frozen module named *name*. Return ``1`` for success, ``0`` if the " "module is not found, and ``-1`` with an exception set if the initialization " -"failed. To access the imported module on a successful load, " -"use :c:func:`PyImport_ImportModule`. (Note the misnomer --- this function " -"would reload the module if it was already imported.)" +"failed. To access the imported module on a successful load, use :c:func:" +"`PyImport_ImportModule`. (Note the misnomer --- this function would reload " +"the module if it was already imported.)" msgstr "" -"載入一個名為 *name* 的凍結模組。成功則回傳 ``1``,找不到模組則回傳 ``0``,初始" -"化失敗則回傳 ``-1`` 並設定例外。要在成功載入時存取引入的模組,請使" -"用 :c:func:`PyImport_ImportModule`。(請注意這個名稱並不恰當 --- 如果模組已經" -"被引入,這個函式會重新載入模組)。" +"載入一個名為 *name* 的凍結模組。成功則回傳 ``1``,找不到模組則回傳 ``0``,初" +"始化失敗則回傳 ``-1`` 並設定例外。要在成功載入時存取引入的模組,請使用 :c:" +"func:`PyImport_ImportModule`。(請注意這個名稱並不恰當 --- 如果模組已經被引" +"入,這個函式會重新載入模組)。" #: ../../c-api/import.rst:251 msgid "The ``__file__`` attribute is no longer set on the module." @@ -388,8 +387,8 @@ msgstr "" msgid "" "This is the structure type definition for frozen module descriptors, as " "generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the " -"Python source distribution). Its definition, found in :file:`Include/" -"import.h`, is::" +"Python source distribution). Its definition, found in :file:`Include/import." +"h`, is::" msgstr "" "這是由 :program:`freeze` 工具程式產生的凍結模組描述器的結構型別定義(請參閱 " "Python 原始碼發行版中的 :file:`Tools/freeze/`)。它的定義在 :file:`Include/" @@ -427,8 +426,8 @@ msgid "" "could play tricks with this to provide a dynamically created collection of " "frozen modules." msgstr "" -"這個指標會被初始化為指向一個 :c:struct:`_frozen` 記錄的陣列,以一個其成員都是 " -"``NULL`` 或 0 的記錄為結尾。當一個凍結的模組被引入時,它會在這個表格中被搜" +"這個指標會被初始化為指向一個 :c:struct:`_frozen` 記錄的陣列,以一個其成員都" +"是 ``NULL`` 或 0 的記錄為結尾。當一個凍結的模組被引入時,它會在這個表格中被搜" "尋。第三方程式碼可以利用這一點來提供一個動態建立的凍結模組集合。" #: ../../c-api/import.rst:291 @@ -442,8 +441,8 @@ msgid "" msgstr "" "新增單一模組到現有的內建模組表格。這是 :c:func:`PyImport_ExtendInittab` 的便" "利包裝器,如果表格無法擴充會回傳 ``-1``。新的模組可以用 *name* 的名稱引入,並" -"使用函式 *initfunc* 作為第一次嘗試引入時呼叫的初始化函式。這應該" -"在 :c:func:`Py_Initialize` 之前呼叫。" +"使用函式 *initfunc* 作為第一次嘗試引入時呼叫的初始化函式。這應該在 :c:func:" +"`Py_Initialize` 之前呼叫。" #: ../../c-api/import.rst:301 msgid "" @@ -467,18 +466,18 @@ msgstr "內建於直譯器中的模組的初始化函式。" #: ../../c-api/import.rst:318 msgid "" "Add a collection of modules to the table of built-in modules. The *newtab* " -"array must end with a sentinel entry which contains ``NULL`` for " -"the :c:member:`~_inittab.name` field; failure to provide the sentinel value " -"can result in a memory fault. Returns ``0`` on success or ``-1`` if " -"insufficient memory could be allocated to extend the internal table. In the " -"event of failure, no modules are added to the internal table. This must be " -"called before :c:func:`Py_Initialize`." -msgstr "" -"新增一個模組集合到內建模組表格。*newtab* 陣列必須以包含 ``NULL`` " -"的 :c:member:`~_inittab.name` 欄位的哨兵項目(sentinel entry)結尾;如果沒有" -"提供哨兵值,可能會導致記憶體錯誤。成功時會回傳 ``0``,如果沒有足夠的記憶體可" -"以分配來擴充內部表格則回傳 ``-1``。在失敗的情況下,沒有模組會被加入內部表格。" -"這個函式必須在 :c:func:`Py_Initialize` 之前呼叫。" +"array must end with a sentinel entry which contains ``NULL`` for the :c:" +"member:`~_inittab.name` field; failure to provide the sentinel value can " +"result in a memory fault. Returns ``0`` on success or ``-1`` if insufficient " +"memory could be allocated to extend the internal table. In the event of " +"failure, no modules are added to the internal table. This must be called " +"before :c:func:`Py_Initialize`." +msgstr "" +"新增一個模組集合到內建模組表格。*newtab* 陣列必須以包含 ``NULL`` 的 :c:" +"member:`~_inittab.name` 欄位的哨兵項目(sentinel entry)結尾;如果沒有提供哨" +"兵值,可能會導致記憶體錯誤。成功時會回傳 ``0``,如果沒有足夠的記憶體可以分配" +"來擴充內部表格則回傳 ``-1``。在失敗的情況下,沒有模組會被加入內部表格。這個函" +"式必須在 :c:func:`Py_Initialize` 之前呼叫。" #: ../../c-api/import.rst:325 msgid "" @@ -486,29 +485,39 @@ msgid "" "or :c:func:`PyImport_ExtendInittab` must be called before each Python " "initialization." msgstr "" -"如果 Python 被多次初始化,:c:func:`PyImport_AppendInittab` " -"或 :c:func:`PyImport_ExtendInittab` 必須在每次 Python 初始化之前被呼叫。" +"如果 Python 被多次初始化,:c:func:`PyImport_AppendInittab` 或 :c:func:" +"`PyImport_ExtendInittab` 必須在每次 Python 初始化之前被呼叫。" #: ../../c-api/import.rst:332 +#, fuzzy +msgid "" +"The table of built-in modules used by Python initialization. Do not use this " +"directly; use :c:func:`PyImport_AppendInittab` and :c:func:" +"`PyImport_ExtendInittab` instead." +msgstr "" +"如果 Python 被多次初始化,:c:func:`PyImport_AppendInittab` 或 :c:func:" +"`PyImport_ExtendInittab` 必須在每次 Python 初始化之前被呼叫。" + +#: ../../c-api/import.rst:339 msgid "Import the module *mod_name* and get its attribute *attr_name*." msgstr "引入模組 *mod_name* 並取得其屬性 *attr_name*。" -#: ../../c-api/import.rst:334 +#: ../../c-api/import.rst:341 msgid "Names must be Python :class:`str` objects." msgstr "名稱必須是 Python :class:`str` 物件。" -#: ../../c-api/import.rst:336 +#: ../../c-api/import.rst:343 msgid "" -"Helper function combining :c:func:`PyImport_Import` " -"and :c:func:`PyObject_GetAttr`. For example, it can raise :exc:`ImportError` " -"if the module is not found, and :exc:`AttributeError` if the attribute " -"doesn't exist." +"Helper function combining :c:func:`PyImport_Import` and :c:func:" +"`PyObject_GetAttr`. For example, it can raise :exc:`ImportError` if the " +"module is not found, and :exc:`AttributeError` if the attribute doesn't " +"exist." msgstr "" "結合 :c:func:`PyImport_Import` 和 :c:func:`PyObject_GetAttr` 的輔助函式。例" -"如,如果找不到模組,它會引發 :exc:`ImportError`,如果屬性不存在,則會引" -"發 :exc:`AttributeError`。" +"如,如果找不到模組,它會引發 :exc:`ImportError`,如果屬性不存在,則會引發 :" +"exc:`AttributeError`。" -#: ../../c-api/import.rst:345 +#: ../../c-api/import.rst:352 msgid "" "Similar to :c:func:`PyImport_ImportModuleAttr`, but names are UTF-8 encoded " "strings instead of Python :class:`str` objects." diff --git a/c-api/intro.po b/c-api/intro.po index 1eeb916ca0..6ac502b87c 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-20 00:14+0000\n" +"POT-Creation-Date: 2025-11-25 00:13+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -335,8 +335,8 @@ msgid "" "This is a :term:`soft deprecated` alias to :c:func:`!memcpy`. Use :c:func:`!" "memcpy` directly instead." msgstr "" -"這是 :c:func:`!memcpy` 的已\\ :term:`軟性棄用 `\\ 別名。請直接" -"使用 :c:func:`!memcpy`。" +"這是 :c:func:`!memcpy` 的已\\ :term:`軟性棄用 `\\ 別名。請直" +"接使用 :c:func:`!memcpy`。" #: ../../c-api/intro.rst:202 msgid "The macro is :term:`soft deprecated`." @@ -526,11 +526,31 @@ msgstr "" " \"to the tropics and subtropics of the " "Eastern Hemisphere.\");" +#: ../../c-api/intro.rst:327 +msgid "Compute the length of a statically allocated C array at compile time." +msgstr "" + #: ../../c-api/intro.rst:329 +msgid "" +"The *array* argument must be a C array with a size known at compile time. " +"Passing an array with an unknown size, such as a heap-allocated array, will " +"result in a compilation error on some compilers, or otherwise produce " +"incorrect results." +msgstr "" + +#: ../../c-api/intro.rst:334 +msgid "This is roughly equivalent to::" +msgstr "" + +#: ../../c-api/intro.rst:336 +msgid "sizeof(array) / sizeof((array)[0])" +msgstr "" + +#: ../../c-api/intro.rst:342 msgid "Objects, Types and Reference Counts" msgstr "物件、型別和參照計數" -#: ../../c-api/intro.rst:333 +#: ../../c-api/intro.rst:346 msgid "" "Most Python/C API functions have one or more arguments as well as a return " "value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data " @@ -553,7 +573,7 @@ msgstr "" "別物件;由於它們絕不能被釋放,因此它們通常是靜態 :c:type:`PyTypeObject` 物" "件。" -#: ../../c-api/intro.rst:344 +#: ../../c-api/intro.rst:357 msgid "" "All Python objects (even Python integers) have a :dfn:`type` and a :dfn:" "`reference count`. An object's type determines what kind of object it is (e." @@ -569,11 +589,11 @@ msgstr "" "`types`\\ )。對於每個眾所周知的型別,都有一個巨集來檢查物件是否屬於該型別;" "例如,若(且唯若)*a* 指向的物件是 Python list 時,``PyList_Check(a)`` 為真。" -#: ../../c-api/intro.rst:355 +#: ../../c-api/intro.rst:368 msgid "Reference Counts" msgstr "參照計數" -#: ../../c-api/intro.rst:357 +#: ../../c-api/intro.rst:370 msgid "" "The reference count is important because today's computers have a finite " "(and often severely limited) memory size; it counts how many different " @@ -596,7 +616,7 @@ msgstr "" "則可以依次為那些其他物件解除配置,依此類推。(此處相互參照物件的存在是個明顯" "的問題;目前,解決方案是「就不要那樣做」。)" -#: ../../c-api/intro.rst:374 +#: ../../c-api/intro.rst:387 msgid "" "Reference counts are always manipulated explicitly. The normal way is to " "use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. " @@ -624,7 +644,7 @@ msgstr "" "元會被使用(假設 ``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加" "是一個簡單的操作。" -#: ../../c-api/intro.rst:390 +#: ../../c-api/intro.rst:403 msgid "" "It is not necessary to hold a :term:`strong reference` (i.e. increment the " "reference count) for every local variable that contains a pointer to an " @@ -650,7 +670,7 @@ msgstr "" "種情況的一個重要情況是在從 Python 呼叫的擴充模組中作為引數傳遞給 C 函式的物" "件;呼叫機制保證在呼叫期間保持對每個參數的參照。" -#: ../../c-api/intro.rst:406 +#: ../../c-api/intro.rst:419 msgid "" "However, a common pitfall is to extract an object from a list and hold on to " "it for a while without taking a new reference. Some other operation might " @@ -666,7 +686,7 @@ msgstr "" "程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作都有潛" "在危險。" -#: ../../c-api/intro.rst:414 +#: ../../c-api/intro.rst:427 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " @@ -681,11 +701,11 @@ msgstr "" "計數)。這讓呼叫者有責任在處理完結果後呼叫 :c:func:`Py_DECREF`;這就成為第二" "本質。" -#: ../../c-api/intro.rst:425 +#: ../../c-api/intro.rst:438 msgid "Reference Count Details" msgstr "參照計數詳細資訊" -#: ../../c-api/intro.rst:427 +#: ../../c-api/intro.rst:440 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -710,7 +730,7 @@ msgstr "" "照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是\\ :term:`借用參" "照 `\\ 就不需要做任何事情。" -#: ../../c-api/intro.rst:440 +#: ../../c-api/intro.rst:453 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " @@ -722,7 +742,7 @@ msgstr "" "物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定" "它現在擁有該參照,並且你不再對它負責。" -#: ../../c-api/intro.rst:450 +#: ../../c-api/intro.rst:463 msgid "" "Few functions steal references; the two notable exceptions are :c:func:" "`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " @@ -739,7 +759,7 @@ msgstr "" "慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以" "如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):" -#: ../../c-api/intro.rst:458 +#: ../../c-api/intro.rst:471 msgid "" "PyObject *t;\n" "\n" @@ -755,7 +775,7 @@ msgstr "" "PyTuple_SetItem(t, 1, PyLong_FromLong(2L));\n" "PyTuple_SetItem(t, 2, PyUnicode_FromString(\"three\"));" -#: ../../c-api/intro.rst:465 +#: ../../c-api/intro.rst:478 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " "stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object " @@ -766,7 +786,7 @@ msgstr "" "`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將被竊取,請" "在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來取得另一個參照。" -#: ../../c-api/intro.rst:470 +#: ../../c-api/intro.rst:483 msgid "" "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " "items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to " @@ -778,7 +798,7 @@ msgstr "" "tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple 使" "用 :c:func:`PyTuple_SetItem`。" -#: ../../c-api/intro.rst:475 +#: ../../c-api/intro.rst:488 msgid "" "Equivalent code for populating a list can be written using :c:func:" "`PyList_New` and :c:func:`PyList_SetItem`." @@ -786,7 +806,7 @@ msgstr "" "可以使用 :c:func:`PyList_New` 和 :c:func:`PyList_SetItem` 編寫用於填充列表的" "等效程式碼。" -#: ../../c-api/intro.rst:478 +#: ../../c-api/intro.rst:491 msgid "" "However, in practice, you will rarely use these ways of creating and " "populating a tuple or list. There's a generic function, :c:func:" @@ -799,7 +819,7 @@ msgstr "" "string` 引導。例如上面的兩個程式碼可以用以下程式碼替換(它還負責了錯誤檢" "查): ::" -#: ../../c-api/intro.rst:484 +#: ../../c-api/intro.rst:497 msgid "" "PyObject *tuple, *list;\n" "\n" @@ -811,7 +831,7 @@ msgstr "" "tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n" "list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");" -#: ../../c-api/intro.rst:489 +#: ../../c-api/intro.rst:502 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " "items whose references you are only borrowing, like arguments that were " @@ -826,7 +846,7 @@ msgstr "" "穩健,因為你不取得新的一個參照就可以放棄參照(「讓它被竊取」)。例如,此函式" "將 list(實際上是任何可變序列)的所有項目設定於給定項目:" -#: ../../c-api/intro.rst:496 +#: ../../c-api/intro.rst:509 msgid "" "int\n" "set_all(PyObject *target, PyObject *item)\n" @@ -870,7 +890,7 @@ msgstr "" " return 0;\n" "}" -#: ../../c-api/intro.rst:519 +#: ../../c-api/intro.rst:532 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -888,7 +908,7 @@ msgstr "" "照的通用函式,如 :c:func:`PyObject_GetItem` 和 :c:func:`PySequence_GetItem`," "總是回傳一個新的參照(呼叫者成為參照的所有者)。" -#: ../../c-api/intro.rst:528 +#: ../../c-api/intro.rst:541 msgid "" "It is important to realize that whether you own a reference returned by a " "function depends on which function you call only --- *the plumage* (the type " @@ -904,7 +924,7 @@ msgstr "" "但如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中取得相同的項目(且恰" "好使用完全相同的引數),你確實會擁有對回傳物件的參照。" -#: ../../c-api/intro.rst:540 +#: ../../c-api/intro.rst:553 msgid "" "Here is an example of how you could write a function that computes the sum " "of the items in a list of integers; once using :c:func:`PyList_GetItem`, " @@ -913,7 +933,7 @@ msgstr "" "以下是一個範例,說明如何編寫函式來計算一個整數 list 中項目的總和;一次使用 :" "c:func:`PyList_GetItem`,一次使用 :c:func:`PySequence_GetItem`: ::" -#: ../../c-api/intro.rst:544 +#: ../../c-api/intro.rst:557 msgid "" "long\n" "sum_list(PyObject *list)\n" @@ -959,7 +979,7 @@ msgstr "" " return total;\n" "}" -#: ../../c-api/intro.rst:570 +#: ../../c-api/intro.rst:583 msgid "" "long\n" "sum_sequence(PyObject *sequence)\n" @@ -1017,11 +1037,11 @@ msgstr "" " return total;\n" "}" -#: ../../c-api/intro.rst:604 +#: ../../c-api/intro.rst:617 msgid "Types" msgstr "型別" -#: ../../c-api/intro.rst:606 +#: ../../c-api/intro.rst:619 msgid "" "There are few other data types that play a significant role in the Python/C " "API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" @@ -1036,7 +1056,7 @@ msgstr "" "一些結構型別被用於描述用於列出模組所匯出的函式或新物件型別的資料屬性的靜態" "表,其他則用於描述複數的值。這些將與使用它們的函式一起討論。" -#: ../../c-api/intro.rst:616 +#: ../../c-api/intro.rst:629 msgid "" "A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " "C99 doesn't define such a thing directly (size_t is an unsigned integral " @@ -1047,11 +1067,11 @@ msgstr "" "有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參閱 :pep:" "`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。" -#: ../../c-api/intro.rst:625 +#: ../../c-api/intro.rst:638 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:627 +#: ../../c-api/intro.rst:640 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -1063,7 +1083,7 @@ msgstr "" "給呼叫者,然後傳遞給呼叫者的呼叫者,依此類推,直到它們到達頂層直譯器,在那裡" "它們透過堆疊回溯 (stack trace) 回報給使用者。" -#: ../../c-api/intro.rst:635 +#: ../../c-api/intro.rst:648 msgid "" "For C programmers, however, error checking always has to be explicit. All " "functions in the Python/C API can raise exceptions, unless an explicit claim " @@ -1085,7 +1105,7 @@ msgstr "" "確的錯誤指示器或者有不明確的回傳值,而需要使用 :c:func:`PyErr_Occurred` 明確" "測試錯誤。這些例外都會被明確地記錄於文件。" -#: ../../c-api/intro.rst:650 +#: ../../c-api/intro.rst:663 msgid "" "Exception state is maintained in per-thread storage (this is equivalent to " "using global storage in an unthreaded application). A thread can be in one " @@ -1104,7 +1124,7 @@ msgstr "" "func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :" "c:func:`PyErr_Clear` 是用來清除例外狀態。" -#: ../../c-api/intro.rst:660 +#: ../../c-api/intro.rst:673 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " @@ -1123,7 +1143,7 @@ msgstr "" "達 Python 位元組碼直譯器的主迴圈,該迴圈負責將它傳遞給 ``sys.exc_info()`` 和" "其系列函式。" -#: ../../c-api/intro.rst:672 +#: ../../c-api/intro.rst:685 msgid "" "Note that starting with Python 1.5, the preferred, thread-safe way to access " "the exception state from Python code is to call the function :func:`sys." @@ -1143,7 +1163,7 @@ msgstr "" "式碼中的常見錯誤,這些錯誤是由看似無辜的函式覆蓋了正在處理的例外而引起的;它" "還替回溯中被堆疊框 (stack frame) 參照的物件減少了通常不需要的生命週期延長。" -#: ../../c-api/intro.rst:683 +#: ../../c-api/intro.rst:696 msgid "" "As a general principle, a function that calls another function to perform " "some task should check whether the called function raised an exception, and " @@ -1158,7 +1178,7 @@ msgstr "" "並回傳一個錯誤指示符,但它\\ *不應該*\\ 設定另一個例外 --- 這將覆蓋剛剛引發的" "例外,並丟失關於錯誤確切原因的重要資訊。" -#: ../../c-api/intro.rst:692 +#: ../../c-api/intro.rst:705 msgid "" "A simple example of detecting exceptions and passing them on is shown in " "the :c:func:`!sum_sequence` example above. It so happens that this example " @@ -1170,7 +1190,7 @@ msgstr "" "巧這個例子在檢測到錯誤時不需要清理任何擁有的參照。以下範例函式展示了一些錯誤" "清理。首先,為了提醒你為什麼喜歡 Python,我們展示了等效的 Python 程式碼: ::" -#: ../../c-api/intro.rst:698 +#: ../../c-api/intro.rst:711 msgid "" "def incr_item(dict, key):\n" " try:\n" @@ -1186,11 +1206,11 @@ msgstr "" " item = 0\n" " dict[key] = item + 1" -#: ../../c-api/intro.rst:707 +#: ../../c-api/intro.rst:720 msgid "Here is the corresponding C code, in all its glory::" msgstr "這是相應的 C 程式碼:" -#: ../../c-api/intro.rst:709 +#: ../../c-api/intro.rst:722 msgid "" "int\n" "incr_item(PyObject *dict, PyObject *key)\n" @@ -1236,7 +1256,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/intro.rst:759 +#: ../../c-api/intro.rst:772 msgid "" "This example represents an endorsed use of the ``goto`` statement in C! It " "illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:" @@ -1255,11 +1275,11 @@ msgstr "" "於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣地,回傳值" "被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成功。" -#: ../../c-api/intro.rst:773 +#: ../../c-api/intro.rst:786 msgid "Embedding Python" msgstr "嵌入式Python" -#: ../../c-api/intro.rst:775 +#: ../../c-api/intro.rst:788 msgid "" "The one important task that only embedders (as opposed to extension writers) " "of the Python interpreter have to worry about is the initialization, and " @@ -1269,7 +1289,7 @@ msgstr "" "只有 Python 直譯器的嵌入者(而不是擴充編寫者)需要擔心的一項重要任務是 " "Python 直譯器的初始化與完成階段。直譯器的大部分功能只能在直譯器初始化後使用。" -#: ../../c-api/intro.rst:788 +#: ../../c-api/intro.rst:801 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -1280,7 +1300,7 @@ msgstr "" "立基礎模組 :mod:`builtins`、:mod:`__main__` 和 :mod:`sys`。它還會初始化模組搜" "索路徑 (``sys.path``)。" -#: ../../c-api/intro.rst:793 +#: ../../c-api/intro.rst:806 msgid "" ":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys." "argv``). If this variable is needed by Python code that will be executed " @@ -1292,7 +1312,7 @@ msgstr "" "`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請見 :ref:`Python 初始化" "配置 `。" -#: ../../c-api/intro.rst:798 +#: ../../c-api/intro.rst:811 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -1310,7 +1330,7 @@ msgstr "" "file:`python` 的可執行檔案,並在其父目錄中查找一個名為 :file:`lib/python{X.Y}" "` 的目錄的相對位置。" -#: ../../c-api/intro.rst:807 +#: ../../c-api/intro.rst:820 msgid "" "For instance, if the Python executable is found in :file:`/usr/local/bin/" "python`, it will assume that the libraries are in :file:`/usr/local/lib/" @@ -1327,7 +1347,7 @@ msgstr "" "`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入額外的目" "錄。" -#: ../../c-api/intro.rst:821 +#: ../../c-api/intro.rst:834 msgid "" "The embedding application can steer the search by setting :c:member:" "`PyConfig.program_name` *before* calling :c:func:`Py_InitializeFromConfig`. " @@ -1344,7 +1364,7 @@ msgstr "" "func:`Py_GetExecPrefix` 和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :" "file:`Modules/getpath.c`)。" -#: ../../c-api/intro.rst:832 +#: ../../c-api/intro.rst:845 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " "application may want to start over (make another call to :c:func:" @@ -1365,11 +1385,11 @@ msgstr "" "`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例如目前無法釋" "放被擴充模組所分配的記憶體。" -#: ../../c-api/intro.rst:846 +#: ../../c-api/intro.rst:859 msgid "Debugging Builds" msgstr "除錯建置" -#: ../../c-api/intro.rst:848 +#: ../../c-api/intro.rst:861 msgid "" "Python can be built with several macros to enable extra checks of the " "interpreter and extension modules. These checks tend to add a large amount " @@ -1378,7 +1398,7 @@ msgstr "" "Python 可以在建置時使用多個巨集來啟用對直譯器和擴充模組的額外檢查,這些檢查往" "往會在執行環境 (runtime) 增加大量開銷 (overhead),因此預設情況下不啟用它們。" -#: ../../c-api/intro.rst:852 +#: ../../c-api/intro.rst:865 msgid "" "A full list of the various types of debugging builds is in the file :file:" "`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are " @@ -1391,7 +1411,7 @@ msgstr "" "錯構置的完整列表,為支援追蹤參照計數、為記憶體分配器除錯或對主直譯器迴圈進行" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" -#: ../../c-api/intro.rst:860 +#: ../../c-api/intro.rst:873 msgid "" "Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `." @@ -1415,7 +1435,7 @@ msgstr "" "除了下面描述的參照計數除錯之外,還會執行額外的檢查,請參閱 :ref:`Python 除錯" "建置 `。" -#: ../../c-api/intro.rst:871 +#: ../../c-api/intro.rst:884 msgid "" "Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" "`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " @@ -1430,7 +1450,7 @@ msgstr "" "linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下," "這發生在直譯器運行的每個陳述句之後。)" -#: ../../c-api/intro.rst:878 +#: ../../c-api/intro.rst:891 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." @@ -1438,11 +1458,11 @@ msgstr "" "有關更多詳細資訊,請參閱 Python 原始碼發布版中的 :file:`Misc/SpecialBuilds." "txt`。" -#: ../../c-api/intro.rst:885 +#: ../../c-api/intro.rst:898 msgid "Recommended third party tools" msgstr "建議的第三方工具" -#: ../../c-api/intro.rst:887 +#: ../../c-api/intro.rst:900 msgid "" "The following third party tools offer both simpler and more sophisticated " "approaches to creating C, C++ and Rust extensions for Python:" @@ -1450,39 +1470,39 @@ msgstr "" "以下第三方工具提供了更簡單且更細緻的方法來為 Python 建立 C、C++ 和 Rust 擴充" "模組:" -#: ../../c-api/intro.rst:890 +#: ../../c-api/intro.rst:903 msgid "`Cython `_" msgstr "`Cython `_" -#: ../../c-api/intro.rst:891 +#: ../../c-api/intro.rst:904 msgid "`cffi `_" msgstr "`cffi `_" -#: ../../c-api/intro.rst:892 +#: ../../c-api/intro.rst:905 msgid "`HPy `_" msgstr "`HPy `_" -#: ../../c-api/intro.rst:893 +#: ../../c-api/intro.rst:906 msgid "`nanobind `_ (C++)" msgstr "`nanobind `_ (C++)" -#: ../../c-api/intro.rst:894 +#: ../../c-api/intro.rst:907 msgid "`Numba `_" msgstr "`Numba `_" -#: ../../c-api/intro.rst:895 +#: ../../c-api/intro.rst:908 msgid "`pybind11 `_ (C++)" msgstr "`pybind11 `_ (C++)" -#: ../../c-api/intro.rst:896 +#: ../../c-api/intro.rst:909 msgid "`PyO3 `_ (Rust)" msgstr "`PyO3 `_ (Rust)" -#: ../../c-api/intro.rst:897 +#: ../../c-api/intro.rst:910 msgid "`SWIG `_" msgstr "`SWIG `_" -#: ../../c-api/intro.rst:899 +#: ../../c-api/intro.rst:912 msgid "" "Using tools such as these can help avoid writing code that is tightly bound " "to a particular version of CPython, avoid reference counting errors, and " @@ -1493,7 +1513,7 @@ msgid "" "sources." msgstr "" -#: ../../c-api/intro.rst:906 +#: ../../c-api/intro.rst:919 msgid "" "These projects are not supported by the same people who maintain Python, and " "issues need to be raised with the projects directly. Remember to check that " @@ -1501,139 +1521,139 @@ msgid "" "outdated." msgstr "" -#: ../../c-api/intro.rst:913 +#: ../../c-api/intro.rst:926 msgid "" "`Python Packaging User Guide: Binary Extensions `_" msgstr "" -#: ../../c-api/intro.rst:914 +#: ../../c-api/intro.rst:927 msgid "" "The Python Packaging User Guide not only covers several available tools that " "simplify the creation of binary extensions, but also discusses the various " "reasons why creating an extension module may be desirable in the first place." msgstr "" -#: ../../c-api/intro.rst:331 +#: ../../c-api/intro.rst:344 msgid "object" msgstr "object(物件)" -#: ../../c-api/intro.rst:331 +#: ../../c-api/intro.rst:344 msgid "type" msgstr "type(型別)" -#: ../../c-api/intro.rst:370 +#: ../../c-api/intro.rst:383 msgid "Py_INCREF (C function)" msgstr "Py_INCREF(C 函式)" -#: ../../c-api/intro.rst:370 +#: ../../c-api/intro.rst:383 msgid "Py_DECREF (C function)" msgstr "Py_DECREF(C 函式)" -#: ../../c-api/intro.rst:446 +#: ../../c-api/intro.rst:459 msgid "PyList_SetItem (C function)" msgstr "PyList_SetItem(C 函式)" -#: ../../c-api/intro.rst:446 +#: ../../c-api/intro.rst:459 msgid "PyTuple_SetItem (C function)" msgstr "PyTuple_SetItem(C 函式)" -#: ../../c-api/intro.rst:517 +#: ../../c-api/intro.rst:530 msgid "set_all()" msgstr "set_all()" -#: ../../c-api/intro.rst:536 +#: ../../c-api/intro.rst:549 msgid "PyList_GetItem (C function)" msgstr "PyList_GetItem(C 函式)" -#: ../../c-api/intro.rst:536 +#: ../../c-api/intro.rst:549 msgid "PySequence_GetItem (C function)" msgstr "PySequence_GetItem(C 函式)" -#: ../../c-api/intro.rst:566 +#: ../../c-api/intro.rst:579 msgid "sum_list()" msgstr "sum_list()" -#: ../../c-api/intro.rst:598 ../../c-api/intro.rst:690 +#: ../../c-api/intro.rst:611 ../../c-api/intro.rst:703 msgid "sum_sequence()" msgstr "sum_sequence()" -#: ../../c-api/intro.rst:633 +#: ../../c-api/intro.rst:646 msgid "PyErr_Occurred (C function)" msgstr "PyErr_Occurred(C 函式)" -#: ../../c-api/intro.rst:646 +#: ../../c-api/intro.rst:659 msgid "PyErr_SetString (C function)" msgstr "PyErr_SetString(C 函式)" -#: ../../c-api/intro.rst:646 ../../c-api/intro.rst:754 +#: ../../c-api/intro.rst:659 ../../c-api/intro.rst:767 msgid "PyErr_Clear (C function)" msgstr "PyErr_Clear(C 函式)" -#: ../../c-api/intro.rst:670 +#: ../../c-api/intro.rst:683 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../c-api/intro.rst:705 ../../c-api/intro.rst:752 +#: ../../c-api/intro.rst:718 ../../c-api/intro.rst:765 msgid "incr_item()" msgstr "incr_item()" -#: ../../c-api/intro.rst:754 +#: ../../c-api/intro.rst:767 msgid "PyErr_ExceptionMatches (C function)" msgstr "PyErr_ExceptionMatches(C 函式)" -#: ../../c-api/intro.rst:754 +#: ../../c-api/intro.rst:767 msgid "Py_XDECREF (C function)" msgstr "Py_XDECREF(C 函式)" -#: ../../c-api/intro.rst:780 +#: ../../c-api/intro.rst:793 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/intro.rst:780 +#: ../../c-api/intro.rst:793 msgid "module" msgstr "module(模組)" -#: ../../c-api/intro.rst:780 +#: ../../c-api/intro.rst:793 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/intro.rst:780 +#: ../../c-api/intro.rst:793 msgid "__main__" msgstr "__main__" -#: ../../c-api/intro.rst:780 +#: ../../c-api/intro.rst:793 msgid "sys" msgstr "sys" -#: ../../c-api/intro.rst:780 +#: ../../c-api/intro.rst:793 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/intro.rst:780 +#: ../../c-api/intro.rst:793 msgid "path" msgstr "path(路徑)" -#: ../../c-api/intro.rst:780 +#: ../../c-api/intro.rst:793 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/intro.rst:815 +#: ../../c-api/intro.rst:828 msgid "Py_GetPath (C function)" msgstr "Py_GetPath(C 函式)" -#: ../../c-api/intro.rst:815 +#: ../../c-api/intro.rst:828 msgid "Py_GetPrefix (C function)" msgstr "Py_GetPrefix(C 函式)" -#: ../../c-api/intro.rst:815 +#: ../../c-api/intro.rst:828 msgid "Py_GetExecPrefix (C function)" msgstr "Py_GetExecPrefix(C 函式)" -#: ../../c-api/intro.rst:815 +#: ../../c-api/intro.rst:828 msgid "Py_GetProgramFullPath (C function)" msgstr "Py_GetProgramFullPath(C 函式)" -#: ../../c-api/intro.rst:830 +#: ../../c-api/intro.rst:843 msgid "Py_IsInitialized (C function)" msgstr "Py_IsInitialized(C 函式)" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 1a89a75ec3..870e4814c5 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-13 00:15+0000\n" +"POT-Creation-Date: 2025-11-25 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -438,6 +438,44 @@ msgstr ":py:class:`ast.FunctionType`" msgid ":pep:`484`" msgstr ":pep:`484`" +#: ../../c-api/veryhigh.rst:402 +msgid "Stack Effects" +msgstr "" + +#: ../../c-api/veryhigh.rst:405 +msgid ":py:func:`dis.stack_effect`" +msgstr "" + +#: ../../c-api/veryhigh.rst:410 +msgid "Sentinel value representing an invalid stack effect." +msgstr "" + +#: ../../c-api/veryhigh.rst:412 +msgid "This is currently equivalent to ``INT_MAX``." +msgstr "" + +#: ../../c-api/veryhigh.rst:419 +msgid "Compute the stack effect of *opcode* with argument *oparg*." +msgstr "" + +#: ../../c-api/veryhigh.rst:421 ../../c-api/veryhigh.rst:435 +msgid "" +"On success, this function returns the stack effect; on failure, this " +"returns :c:macro:`PY_INVALID_STACK_EFFECT`." +msgstr "" + +#: ../../c-api/veryhigh.rst:429 +msgid "" +"Similar to :c:func:`PyCompile_OpcodeStackEffect`, but don't include the " +"stack effect of jumping if *jump* is zero." +msgstr "" + +#: ../../c-api/veryhigh.rst:432 +msgid "" +"If *jump* is ``0``, this will not include the stack effect of jumping, but " +"if *jump* is ``1`` or ``-1``, this will include it." +msgstr "" + #: ../../c-api/veryhigh.rst:360 ../../c-api/veryhigh.rst:368 #: ../../c-api/veryhigh.rst:377 ../../c-api/veryhigh.rst:386 msgid "Py_CompileString (C function)" diff --git a/extending/extending.po b/extending/extending.po index ec9327dda4..b7bfe713bf 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2025-11-25 00:13+0000\n" "PO-Revision-Date: 2025-02-17 14:34+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -857,9 +857,10 @@ msgid "" msgstr "" #: ../../extending/extending.rst:428 +#, fuzzy msgid "" "When embedding Python, the :c:func:`!PyInit_spam` function is not called " -"automatically unless there's an entry in the :c:data:`!PyImport_Inittab` " +"automatically unless there's an entry in the :c:data:`PyImport_Inittab` " "table. To add the module to the initialization table, use :c:func:" "`PyImport_AppendInittab`, optionally followed by an import of the module::" msgstr "" diff --git a/howto/unicode.po b/howto/unicode.po index ebe70ac614..2a9e35df0e 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-19 00:13+0000\n" +"POT-Creation-Date: 2025-11-25 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,10 +78,10 @@ msgstr "" msgid "" "The Unicode standard describes how characters are represented by **code " "points**. A code point value is an integer in the range 0 to 0x10FFFF " -"(about 1.1 million values, the `actual number assigned `_ is less than that). In the " -"standard and in this document, a code point is written using the notation " -"``U+265E`` to mean the character with value ``0x265e`` (9,822 in decimal)." +"(about 1.1 million values, the `actual number assigned `_ is less than that). In the standard and in " +"this document, a code point is written using the notation ``U+265E`` to mean " +"the character with value ``0x265e`` (9,822 in decimal)." msgstr "" #: ../../howto/unicode.rst:50 @@ -270,8 +270,8 @@ msgid "" "varies depending on the hardware on which the string was encoded." msgstr "" -#: ../../howto/unicode.rst:158 ../../howto/unicode.rst:514 -#: ../../howto/unicode.rst:735 +#: ../../howto/unicode.rst:158 ../../howto/unicode.rst:516 +#: ../../howto/unicode.rst:737 msgid "References" msgstr "" @@ -300,8 +300,8 @@ msgstr "" #: ../../howto/unicode.rst:173 msgid "" -"Another `good introductory article `_ was " "written by Joel Spolsky. If this introduction didn't make things clear to " "you, you should try reading this alternate article before continuing." @@ -472,10 +472,10 @@ msgstr "" #: ../../howto/unicode.rst:272 msgid "" -"The *errors* parameter is the same as the parameter of " -"the :meth:`~bytes.decode` method but supports a few more possible handlers. " -"As well as ``'strict'``, ``'ignore'``, and ``'replace'`` (which in this case " -"inserts a question mark instead of the unencodable character), there is also " +"The *errors* parameter is the same as the parameter of the :meth:`~bytes." +"decode` method but supports a few more possible handlers. As well as " +"``'strict'``, ``'ignore'``, and ``'replace'`` (which in this case inserts a " +"question mark instead of the unencodable character), there is also " "``'xmlcharrefreplace'`` (inserts an XML character reference), " "``backslashreplace`` (inserts a ``\\uNNNN`` escape sequence) and " "``namereplace`` (inserts a ``\\N{...}`` escape sequence)." @@ -617,11 +617,11 @@ msgid "" "as already mentioned. See also :pep:`263` for more information." msgstr "" -#: ../../howto/unicode.rst:356 +#: ../../howto/unicode.rst:358 msgid "Unicode Properties" msgstr "" -#: ../../howto/unicode.rst:358 +#: ../../howto/unicode.rst:360 msgid "" "The Unicode specification includes a database of information about code " "points. For each defined code point, the information includes the " @@ -631,13 +631,13 @@ msgid "" "related properties, such as how to use the code point in bidirectional text." msgstr "" -#: ../../howto/unicode.rst:366 +#: ../../howto/unicode.rst:368 msgid "" "The following program displays some information about several characters, " "and prints the numeric value of one particular character::" msgstr "" -#: ../../howto/unicode.rst:369 +#: ../../howto/unicode.rst:371 msgid "" "import unicodedata\n" "\n" @@ -651,11 +651,11 @@ msgid "" "print(unicodedata.numeric(u[1]))" msgstr "" -#: ../../howto/unicode.rst:380 +#: ../../howto/unicode.rst:382 msgid "When run, this prints:" msgstr "" -#: ../../howto/unicode.rst:382 +#: ../../howto/unicode.rst:384 msgid "" "0 00e9 Ll LATIN SMALL LETTER E WITH ACUTE\n" "1 0bf2 No TAMIL NUMBER ONE THOUSAND\n" @@ -671,7 +671,7 @@ msgstr "" "4 33af So SQUARE RAD OVER S SQUARED\n" "1000.0" -#: ../../howto/unicode.rst:391 +#: ../../howto/unicode.rst:393 msgid "" "The category codes are abbreviations describing the nature of the character. " "These are grouped into categories such as \"Letter\", \"Number\", " @@ -679,16 +679,16 @@ msgid "" "subcategories. To take the codes from the above output, ``'Ll'`` means " "'Letter, lowercase', ``'No'`` means \"Number, other\", ``'Mn'`` is \"Mark, " "nonspacing\", and ``'So'`` is \"Symbol, other\". See `the General Category " -"Values section of the Unicode Character Database documentation `_ for a list of " -"category codes." +"Values section of the Unicode Character Database documentation `_ for a list of category " +"codes." msgstr "" -#: ../../howto/unicode.rst:402 +#: ../../howto/unicode.rst:404 msgid "Comparing Strings" msgstr "" -#: ../../howto/unicode.rst:404 +#: ../../howto/unicode.rst:406 msgid "" "Unicode adds some complication to comparing strings, because the same set of " "characters can be represented by different sequences of code points. For " @@ -698,7 +698,7 @@ msgid "" "when printed, but one is a string of length 1 and the other is of length 2." msgstr "" -#: ../../howto/unicode.rst:412 +#: ../../howto/unicode.rst:414 msgid "" "One tool for a case-insensitive comparison is the :meth:`~str.casefold` " "string method that converts a string to a case-insensitive form following an " @@ -707,7 +707,7 @@ msgid "" "which becomes the pair of lowercase letters 'ss'." msgstr "" -#: ../../howto/unicode.rst:421 +#: ../../howto/unicode.rst:423 msgid "" ">>> street = 'Gürzenichstraße'\n" ">>> street.casefold()\n" @@ -717,17 +717,17 @@ msgstr "" ">>> street.casefold()\n" "'gürzenichstrasse'" -#: ../../howto/unicode.rst:425 +#: ../../howto/unicode.rst:427 msgid "" -"A second tool is the :mod:`unicodedata` " -"module's :func:`~unicodedata.normalize` function that converts strings to " -"one of several normal forms, where letters followed by a combining character " -"are replaced with single characters. :func:`~unicodedata.normalize` can be " -"used to perform string comparisons that won't falsely report inequality if " -"two strings use combining characters differently:" +"A second tool is the :mod:`unicodedata` module's :func:`~unicodedata." +"normalize` function that converts strings to one of several normal forms, " +"where letters followed by a combining character are replaced with single " +"characters. :func:`~unicodedata.normalize` can be used to perform string " +"comparisons that won't falsely report inequality if two strings use " +"combining characters differently:" msgstr "" -#: ../../howto/unicode.rst:434 +#: ../../howto/unicode.rst:436 msgid "" "import unicodedata\n" "\n" @@ -759,11 +759,11 @@ msgstr "" "print('length of second string=', len(multiple_chars))\n" "print(compare_strs(single_char, multiple_chars))" -#: ../../howto/unicode.rst:448 +#: ../../howto/unicode.rst:450 msgid "When run, this outputs:" msgstr "" -#: ../../howto/unicode.rst:450 +#: ../../howto/unicode.rst:452 msgid "" "$ python compare-strs.py\n" "length of first string= 1\n" @@ -775,18 +775,18 @@ msgstr "" "length of second string= 2\n" "True" -#: ../../howto/unicode.rst:457 +#: ../../howto/unicode.rst:459 msgid "" "The first argument to the :func:`~unicodedata.normalize` function is a " "string giving the desired normalization form, which can be one of 'NFC', " "'NFKC', 'NFD', and 'NFKD'." msgstr "" -#: ../../howto/unicode.rst:461 +#: ../../howto/unicode.rst:463 msgid "The Unicode Standard also specifies how to do caseless comparisons::" msgstr "" -#: ../../howto/unicode.rst:463 +#: ../../howto/unicode.rst:465 msgid "" "import unicodedata\n" "\n" @@ -804,7 +804,7 @@ msgid "" "print(compare_caseless(single_char, multiple_chars))" msgstr "" -#: ../../howto/unicode.rst:477 +#: ../../howto/unicode.rst:479 msgid "" "This will print ``True``. (Why is :func:`!NFD` invoked twice? Because " "there are a few characters that make :meth:`~str.casefold` return a non-" @@ -812,11 +812,11 @@ msgid "" "3.13 of the Unicode Standard for a discussion and an example.)" msgstr "" -#: ../../howto/unicode.rst:484 +#: ../../howto/unicode.rst:486 msgid "Unicode Regular Expressions" msgstr "" -#: ../../howto/unicode.rst:486 +#: ../../howto/unicode.rst:488 msgid "" "The regular expressions supported by the :mod:`re` module can be provided " "either as bytes or strings. Some of the special character sequences such as " @@ -826,13 +826,13 @@ msgid "" "in the ``'Nd'`` category." msgstr "" -#: ../../howto/unicode.rst:493 +#: ../../howto/unicode.rst:495 msgid "" "The string in this example has the number 57 written in both Thai and Arabic " "numerals::" msgstr "" -#: ../../howto/unicode.rst:496 +#: ../../howto/unicode.rst:498 msgid "" "import re\n" "p = re.compile(r'\\d+')\n" @@ -848,52 +848,51 @@ msgstr "" "m = p.search(s)\n" "print(repr(m.group()))" -#: ../../howto/unicode.rst:503 +#: ../../howto/unicode.rst:505 msgid "" "When executed, ``\\d+`` will match the Thai numerals and print them out. If " "you supply the :const:`re.ASCII` flag to :func:`~re.compile`, ``\\d+`` will " "match the substring \"57\" instead." msgstr "" -#: ../../howto/unicode.rst:507 +#: ../../howto/unicode.rst:509 msgid "" "Similarly, ``\\w`` matches a wide variety of Unicode characters but only " "``[a-zA-Z0-9_]`` in bytes or if :const:`re.ASCII` is supplied, and ``\\s`` " "will match either Unicode whitespace characters or ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../howto/unicode.rst:518 +#: ../../howto/unicode.rst:520 msgid "Some good alternative discussions of Python's Unicode support are:" msgstr "" -#: ../../howto/unicode.rst:520 +#: ../../howto/unicode.rst:522 msgid "" -"`Processing Text Files in Python 3 `_, " -"by Nick Coghlan." +"`Processing Text Files in Python 3 `_, by Nick Coghlan." msgstr "" -#: ../../howto/unicode.rst:521 +#: ../../howto/unicode.rst:523 msgid "" "`Pragmatic Unicode `_, a PyCon " "2012 presentation by Ned Batchelder." msgstr "" -#: ../../howto/unicode.rst:523 +#: ../../howto/unicode.rst:525 msgid "" -"The :class:`str` type is described in the Python library reference " -"at :ref:`textseq`." +"The :class:`str` type is described in the Python library reference at :ref:" +"`textseq`." msgstr "" -#: ../../howto/unicode.rst:526 +#: ../../howto/unicode.rst:528 msgid "The documentation for the :mod:`unicodedata` module." msgstr ":mod:`unicodedata` 模組的文件。" -#: ../../howto/unicode.rst:528 +#: ../../howto/unicode.rst:530 msgid "The documentation for the :mod:`codecs` module." msgstr ":mod:`codecs` 模組的文件。" -#: ../../howto/unicode.rst:530 +#: ../../howto/unicode.rst:532 msgid "" "Marc-André Lemburg gave `a presentation titled \"Python and Unicode\" (PDF " "slides) `_ at " @@ -902,18 +901,18 @@ msgid "" "``unicode`` and literals start with ``u``)." msgstr "" -#: ../../howto/unicode.rst:538 +#: ../../howto/unicode.rst:540 msgid "Reading and Writing Unicode Data" msgstr "" -#: ../../howto/unicode.rst:540 +#: ../../howto/unicode.rst:542 msgid "" "Once you've written some code that works with Unicode data, the next problem " "is input/output. How do you get Unicode strings into your program, and how " "do you convert Unicode into a form suitable for storage or transmission?" msgstr "" -#: ../../howto/unicode.rst:544 +#: ../../howto/unicode.rst:546 msgid "" "It's possible that you may not need to do anything depending on your input " "sources and output destinations; you should check whether the libraries used " @@ -922,7 +921,7 @@ msgid "" "valued columns and can return Unicode values from an SQL query." msgstr "" -#: ../../howto/unicode.rst:550 +#: ../../howto/unicode.rst:552 msgid "" "Unicode data is usually converted to a particular encoding before it gets " "written to disk or sent over a socket. It's possible to do all the work " @@ -931,7 +930,7 @@ msgid "" "recommended." msgstr "" -#: ../../howto/unicode.rst:555 +#: ../../howto/unicode.rst:557 msgid "" "One problem is the multi-byte nature of encodings; one Unicode character can " "be represented by several bytes. If you want to read the file in arbitrary-" @@ -945,7 +944,7 @@ msgid "" "version in memory.)" msgstr "" -#: ../../howto/unicode.rst:565 +#: ../../howto/unicode.rst:567 msgid "" "The solution would be to use the low-level decoding interface to catch the " "case of partial coding sequences. The work of implementing this has already " @@ -953,15 +952,15 @@ msgid "" "object that assumes the file's contents are in a specified encoding and " "accepts Unicode parameters for methods such as :meth:`~io.TextIOBase.read` " "and :meth:`~io.TextIOBase.write`. This works through :func:`open`\\'s " -"*encoding* and *errors* parameters which are interpreted just like those " -"in :meth:`str.encode` and :meth:`bytes.decode`." +"*encoding* and *errors* parameters which are interpreted just like those in :" +"meth:`str.encode` and :meth:`bytes.decode`." msgstr "" -#: ../../howto/unicode.rst:574 +#: ../../howto/unicode.rst:576 msgid "Reading Unicode from a file is therefore simple::" msgstr "" -#: ../../howto/unicode.rst:576 +#: ../../howto/unicode.rst:578 msgid "" "with open('unicode.txt', encoding='utf-8') as f:\n" " for line in f:\n" @@ -971,13 +970,13 @@ msgstr "" " for line in f:\n" " print(repr(line))" -#: ../../howto/unicode.rst:580 +#: ../../howto/unicode.rst:582 msgid "" "It's also possible to open files in update mode, allowing both reading and " "writing::" msgstr "" -#: ../../howto/unicode.rst:583 +#: ../../howto/unicode.rst:585 msgid "" "with open('test', encoding='utf-8', mode='w+') as f:\n" " f.write('\\u4500 blah blah blah\\n')\n" @@ -989,7 +988,7 @@ msgstr "" " f.seek(0)\n" " print(repr(f.readline()[:1]))" -#: ../../howto/unicode.rst:588 +#: ../../howto/unicode.rst:590 msgid "" "The Unicode character ``U+FEFF`` is used as a byte-order mark (BOM), and is " "often written as the first character of a file in order to assist with " @@ -1002,7 +1001,7 @@ msgid "" "the BOM." msgstr "" -#: ../../howto/unicode.rst:597 +#: ../../howto/unicode.rst:599 msgid "" "In some areas, it is also convention to use a \"BOM\" at the start of UTF-8 " "encoded files; the name is misleading since UTF-8 is not byte-order " @@ -1011,11 +1010,11 @@ msgid "" "if present." msgstr "" -#: ../../howto/unicode.rst:604 +#: ../../howto/unicode.rst:606 msgid "Unicode filenames" msgstr "" -#: ../../howto/unicode.rst:606 +#: ../../howto/unicode.rst:608 msgid "" "Most of the operating systems in common use today support filenames that " "contain arbitrary Unicode characters. Usually this is implemented by " @@ -1028,7 +1027,7 @@ msgid "" "encoding is again UTF-8." msgstr "" -#: ../../howto/unicode.rst:616 +#: ../../howto/unicode.rst:618 msgid "" "The :func:`sys.getfilesystemencoding` function returns the encoding to use " "on your current system, in case you want to do the encoding manually, but " @@ -1037,7 +1036,7 @@ msgid "" "and it will be automatically converted to the right encoding for you::" msgstr "" -#: ../../howto/unicode.rst:622 +#: ../../howto/unicode.rst:624 msgid "" "filename = 'filename\\u4500abc'\n" "with open(filename, 'w') as f:\n" @@ -1047,13 +1046,13 @@ msgstr "" "with open(filename, 'w') as f:\n" " f.write('blah\\n')" -#: ../../howto/unicode.rst:626 +#: ../../howto/unicode.rst:628 msgid "" "Functions in the :mod:`os` module such as :func:`os.stat` will also accept " "Unicode filenames." msgstr "" -#: ../../howto/unicode.rst:629 +#: ../../howto/unicode.rst:631 msgid "" "The :func:`os.listdir` function returns filenames, which raises an issue: " "should it return the Unicode version of filenames, or should it return bytes " @@ -1066,7 +1065,7 @@ msgid "" "error handler>` is UTF-8, running the following program::" msgstr "" -#: ../../howto/unicode.rst:639 +#: ../../howto/unicode.rst:641 msgid "" "fn = 'filename\\u4500abc'\n" "f = open(fn, 'w')\n" @@ -1084,11 +1083,11 @@ msgstr "" "print(os.listdir(b'.'))\n" "print(os.listdir('.'))" -#: ../../howto/unicode.rst:647 +#: ../../howto/unicode.rst:649 msgid "will produce the following output:" msgstr "" -#: ../../howto/unicode.rst:649 +#: ../../howto/unicode.rst:651 msgid "" "$ python listdir-test.py\n" "[b'filename\\xe4\\x94\\x80abc', ...]\n" @@ -1098,13 +1097,13 @@ msgstr "" "[b'filename\\xe4\\x94\\x80abc', ...]\n" "['filename\\u4500abc', ...]" -#: ../../howto/unicode.rst:655 +#: ../../howto/unicode.rst:657 msgid "" "The first list contains UTF-8-encoded filenames, and the second list " "contains the Unicode versions." msgstr "" -#: ../../howto/unicode.rst:658 +#: ../../howto/unicode.rst:660 msgid "" "Note that on most occasions, you should can just stick with using Unicode " "with these APIs. The bytes APIs should only be used on systems where " @@ -1112,27 +1111,27 @@ msgid "" "now." msgstr "" -#: ../../howto/unicode.rst:665 +#: ../../howto/unicode.rst:667 msgid "Tips for Writing Unicode-aware Programs" msgstr "" -#: ../../howto/unicode.rst:667 +#: ../../howto/unicode.rst:669 msgid "" "This section provides some suggestions on writing software that deals with " "Unicode." msgstr "" -#: ../../howto/unicode.rst:670 +#: ../../howto/unicode.rst:672 msgid "The most important tip is:" msgstr "" -#: ../../howto/unicode.rst:672 +#: ../../howto/unicode.rst:674 msgid "" "Software should only work with Unicode strings internally, decoding the " "input data as soon as possible and encoding the output only at the end." msgstr "" -#: ../../howto/unicode.rst:675 +#: ../../howto/unicode.rst:677 msgid "" "If you attempt to write processing functions that accept both Unicode and " "byte strings, you will find your program vulnerable to bugs wherever you " @@ -1141,7 +1140,7 @@ msgid "" "raised." msgstr "" -#: ../../howto/unicode.rst:680 +#: ../../howto/unicode.rst:682 msgid "" "When using data coming from a web browser or some other untrusted source, a " "common technique is to check for illegal characters in a string before using " @@ -1153,24 +1152,24 @@ msgid "" "then choose a clever way to hide malicious text in the encoded bytestream." msgstr "" -#: ../../howto/unicode.rst:691 +#: ../../howto/unicode.rst:693 msgid "Converting Between File Encodings" msgstr "" -#: ../../howto/unicode.rst:693 +#: ../../howto/unicode.rst:695 msgid "" "The :class:`~codecs.StreamRecoder` class can transparently convert between " "encodings, taking a stream that returns data in encoding #1 and behaving " "like a stream returning data in encoding #2." msgstr "" -#: ../../howto/unicode.rst:697 +#: ../../howto/unicode.rst:699 msgid "" "For example, if you have an input file *f* that's in Latin-1, you can wrap " "it with a :class:`~codecs.StreamRecoder` to return bytes encoded in UTF-8::" msgstr "" -#: ../../howto/unicode.rst:701 +#: ../../howto/unicode.rst:703 msgid "" "new_f = codecs.StreamRecoder(f,\n" " # en/decoder: used by read() to encode its results and\n" @@ -1181,11 +1180,11 @@ msgid "" " codecs.getreader('latin-1'), codecs.getwriter('latin-1') )" msgstr "" -#: ../../howto/unicode.rst:711 +#: ../../howto/unicode.rst:713 msgid "Files in an Unknown Encoding" msgstr "" -#: ../../howto/unicode.rst:713 +#: ../../howto/unicode.rst:715 msgid "" "What can you do if you need to make a change to a file, but don't know the " "file's encoding? If you know the encoding is ASCII-compatible and only want " @@ -1193,7 +1192,7 @@ msgid "" "``surrogateescape`` error handler::" msgstr "" -#: ../../howto/unicode.rst:718 +#: ../../howto/unicode.rst:720 msgid "" "with open(fname, 'r', encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" " data = f.read()\n" @@ -1213,7 +1212,7 @@ msgstr "" " encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" " f.write(data)" -#: ../../howto/unicode.rst:727 +#: ../../howto/unicode.rst:729 msgid "" "The ``surrogateescape`` error handler will decode any non-ASCII bytes as " "code points in a special range running from U+DC80 to U+DCFF. These code " @@ -1221,14 +1220,14 @@ msgid "" "error handler is used to encode the data and write it back out." msgstr "" -#: ../../howto/unicode.rst:737 +#: ../../howto/unicode.rst:739 msgid "" -"One section of `Mastering Python 3 Input/Output `_, a PyCon 2010 talk by David " +"One section of `Mastering Python 3 Input/Output `_, a PyCon 2010 talk by David " "Beazley, discusses text processing and binary data handling." msgstr "" -#: ../../howto/unicode.rst:741 +#: ../../howto/unicode.rst:743 msgid "" "The `PDF slides for Marc-André Lemburg's presentation \"Writing Unicode-" "aware Applications in Python\" `_ is a PyCon 2013 talk by Benjamin Peterson that " "discusses the internal Unicode representation in Python 3.3." msgstr "" -#: ../../howto/unicode.rst:754 +#: ../../howto/unicode.rst:756 msgid "Acknowledgements" msgstr "致謝" -#: ../../howto/unicode.rst:756 +#: ../../howto/unicode.rst:758 msgid "" "The initial draft of this document was written by Andrew Kuchling. It has " "since been revised further by Alexander Belopolsky, Georg Brandl, Andrew " "Kuchling, and Ezio Melotti." msgstr "" -#: ../../howto/unicode.rst:760 +#: ../../howto/unicode.rst:762 msgid "" "Thanks to the following people who have noted errors or offered suggestions " "on this article: Éric Araujo, Nicholas Bastin, Nick Coghlan, Marius " diff --git a/library/stdtypes.po b/library/stdtypes.po index 9d6679c845..561cd75a32 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-23 00:16+0000\n" +"POT-Creation-Date: 2025-11-25 00:13+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -135,8 +135,8 @@ msgstr "結果" #: ../../library/stdtypes.rst:86 ../../library/stdtypes.rst:282 #: ../../library/stdtypes.rst:422 ../../library/stdtypes.rst:1005 -#: ../../library/stdtypes.rst:1224 ../../library/stdtypes.rst:2856 -#: ../../library/stdtypes.rst:4116 +#: ../../library/stdtypes.rst:1224 ../../library/stdtypes.rst:2901 +#: ../../library/stdtypes.rst:4161 msgid "Notes" msgstr "註解" @@ -150,7 +150,7 @@ msgstr "假如 *x* 為真,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:88 ../../library/stdtypes.rst:1007 #: ../../library/stdtypes.rst:1010 ../../library/stdtypes.rst:1239 -#: ../../library/stdtypes.rst:2862 ../../library/stdtypes.rst:4122 +#: ../../library/stdtypes.rst:2907 ../../library/stdtypes.rst:4167 msgid "\\(1)" msgstr "\\(1)" @@ -164,8 +164,8 @@ msgstr "假如 *x* 為假,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:91 ../../library/stdtypes.rst:295 #: ../../library/stdtypes.rst:315 ../../library/stdtypes.rst:1250 -#: ../../library/stdtypes.rst:2866 ../../library/stdtypes.rst:2868 -#: ../../library/stdtypes.rst:4126 ../../library/stdtypes.rst:4128 +#: ../../library/stdtypes.rst:2911 ../../library/stdtypes.rst:2913 +#: ../../library/stdtypes.rst:4171 ../../library/stdtypes.rst:4173 msgid "\\(2)" msgstr "\\(2)" @@ -177,18 +177,18 @@ msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" msgstr "假如 *x* 為假,則 ``True``,否則 ``False``" -#: ../../library/stdtypes.rst:94 ../../library/stdtypes.rst:2870 -#: ../../library/stdtypes.rst:2872 ../../library/stdtypes.rst:2874 -#: ../../library/stdtypes.rst:2876 ../../library/stdtypes.rst:4130 -#: ../../library/stdtypes.rst:4132 ../../library/stdtypes.rst:4134 -#: ../../library/stdtypes.rst:4136 +#: ../../library/stdtypes.rst:94 ../../library/stdtypes.rst:2915 +#: ../../library/stdtypes.rst:2917 ../../library/stdtypes.rst:2919 +#: ../../library/stdtypes.rst:2921 ../../library/stdtypes.rst:4175 +#: ../../library/stdtypes.rst:4177 ../../library/stdtypes.rst:4179 +#: ../../library/stdtypes.rst:4181 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:103 ../../library/stdtypes.rst:326 #: ../../library/stdtypes.rst:440 ../../library/stdtypes.rst:1049 -#: ../../library/stdtypes.rst:1254 ../../library/stdtypes.rst:2902 -#: ../../library/stdtypes.rst:4166 +#: ../../library/stdtypes.rst:1254 ../../library/stdtypes.rst:2947 +#: ../../library/stdtypes.rst:4211 msgid "Notes:" msgstr "註解:" @@ -235,9 +235,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "這個表格統整所有比較運算:" -#: ../../library/stdtypes.rst:144 ../../library/stdtypes.rst:2687 -#: ../../library/stdtypes.rst:2833 ../../library/stdtypes.rst:2856 -#: ../../library/stdtypes.rst:4093 ../../library/stdtypes.rst:4116 +#: ../../library/stdtypes.rst:144 ../../library/stdtypes.rst:2732 +#: ../../library/stdtypes.rst:2878 ../../library/stdtypes.rst:2901 +#: ../../library/stdtypes.rst:4138 ../../library/stdtypes.rst:4161 msgid "Meaning" msgstr "含義" @@ -570,8 +570,8 @@ msgid "" "zero." msgstr "一個複數,其實部為 *re*,虛部為 *im*。*im* 預設為零。" -#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:2864 -#: ../../library/stdtypes.rst:4153 +#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:2909 +#: ../../library/stdtypes.rst:4198 msgid "\\(6)" msgstr "\\(6)" @@ -608,9 +608,9 @@ msgid "*x* to the power *y*" msgstr "*x* 的 *y* 次方" #: ../../library/stdtypes.rst:317 ../../library/stdtypes.rst:319 -#: ../../library/stdtypes.rst:2889 ../../library/stdtypes.rst:2892 -#: ../../library/stdtypes.rst:2895 ../../library/stdtypes.rst:4149 -#: ../../library/stdtypes.rst:4156 +#: ../../library/stdtypes.rst:2934 ../../library/stdtypes.rst:2937 +#: ../../library/stdtypes.rst:2940 ../../library/stdtypes.rst:4194 +#: ../../library/stdtypes.rst:4201 msgid "\\(5)" msgstr "\\(5)" @@ -768,9 +768,9 @@ msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "*x* 及 *y* 的位元 :dfn:`或`" #: ../../library/stdtypes.rst:424 ../../library/stdtypes.rst:427 -#: ../../library/stdtypes.rst:430 ../../library/stdtypes.rst:2878 -#: ../../library/stdtypes.rst:2882 ../../library/stdtypes.rst:4138 -#: ../../library/stdtypes.rst:4142 +#: ../../library/stdtypes.rst:430 ../../library/stdtypes.rst:2923 +#: ../../library/stdtypes.rst:2927 ../../library/stdtypes.rst:4183 +#: ../../library/stdtypes.rst:4187 msgid "\\(4)" msgstr "\\(4)" @@ -3085,7 +3085,7 @@ msgstr "" msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1891 ../../library/stdtypes.rst:3292 +#: ../../library/stdtypes.rst:1891 ../../library/stdtypes.rst:3337 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." @@ -3121,11 +3121,11 @@ msgstr "" ">>> encoded_str_to_bytes\n" "b'Python'" -#: ../../library/stdtypes.rst:1914 ../../library/stdtypes.rst:3311 +#: ../../library/stdtypes.rst:1914 ../../library/stdtypes.rst:3356 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1917 ../../library/stdtypes.rst:3314 +#: ../../library/stdtypes.rst:1917 ../../library/stdtypes.rst:3359 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." @@ -3244,16 +3244,26 @@ msgid "" "``{}``. Each replacement field contains either the numeric index of a " "positional argument, or the name of a keyword argument. Returns a copy of " "the string where each replacement field is replaced with the string value of " -"the corresponding argument." +"the corresponding argument. For example:" msgstr "" -#: ../../library/stdtypes.rst:2002 +#: ../../library/stdtypes.rst:1999 +msgid "" +">>> \"The sum of 1 + 2 is {0}\".format(1+2)\n" +"'The sum of 1 + 2 is 3'\n" +">>> \"The sum of {a} + {b} is {answer}\".format(answer=1+2, a=1, b=2)\n" +"'The sum of 1 + 2 is 3'\n" +">>> \"{1} expects the {0} Inquisition!\".format(\"Spanish\", \"Nobody\")\n" +"'Nobody expects the Spanish Inquisition!'" +msgstr "" + +#: ../../library/stdtypes.rst:2008 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." msgstr "" -#: ../../library/stdtypes.rst:2006 +#: ../../library/stdtypes.rst:2012 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -3264,26 +3274,26 @@ msgid "" "This temporary change affects other threads." msgstr "" -#: ../../library/stdtypes.rst:2015 +#: ../../library/stdtypes.rst:2021 msgid "" "When formatting a number with the ``n`` type, the function sets temporarily " "the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" -#: ../../library/stdtypes.rst:2023 +#: ../../library/stdtypes.rst:2029 msgid "" "Similar to ``str.format(**mapping)``, except that ``mapping`` is used " "directly and not copied to a :class:`dict`. This is useful if for example " "``mapping`` is a dict subclass:" msgstr "" -#: ../../library/stdtypes.rst:2039 +#: ../../library/stdtypes.rst:2045 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found." msgstr "" -#: ../../library/stdtypes.rst:2045 +#: ../../library/stdtypes.rst:2051 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -3291,7 +3301,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:2053 +#: ../../library/stdtypes.rst:2059 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -3300,26 +3310,64 @@ msgid "" "\"Lu\", \"Ll\", or \"Lo\". Note that this is different from the `Alphabetic " "property defined in the section 4.10 'Letters, Alphabetic, and Ideographic' " "of the Unicode Standard `_." +"spec/chapter-4/#G91002>`_. For example:" +msgstr "" + +#: ../../library/stdtypes.rst:2068 +msgid "" +">>> 'Letters and spaces'.isalpha()\n" +"False\n" +">>> 'LettersOnly'.isalpha()\n" +"True\n" +">>> 'µ'.isalpha() # non-ASCII characters can be considered alphabetical " +"too\n" +"True" msgstr "" -#: ../../library/stdtypes.rst:2064 +#: ../../library/stdtypes.rst:2077 +msgid "See :ref:`unicode-properties`." +msgstr "" + +#: ../../library/stdtypes.rst:2082 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range " -"U+0000-U+007F." +"U+0000-U+007F. For example:" +msgstr "" + +#: ../../library/stdtypes.rst:2086 +#, fuzzy +msgid "" +">>> 'ASCII characters'.isascii()\n" +"True\n" +">>> 'µ'.isascii()\n" +"False" msgstr "" +">>> b'ABCabc'.isalpha()\n" +"True\n" +">>> b'ABCabc1'.isalpha()\n" +"False" -#: ../../library/stdtypes.rst:2073 +#: ../../library/stdtypes.rst:2098 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " -"those that can be used to form numbers in base 10, e.g. U+0660, ARABIC-INDIC " -"DIGIT ZERO. Formally a decimal character is a character in the Unicode " -"General Category \"Nd\"." +"those that can be used to form numbers in base 10, such as U+0660, ARABIC-" +"INDIC DIGIT ZERO. Formally a decimal character is a character in the " +"Unicode General Category \"Nd\". For example:" +msgstr "" + +#: ../../library/stdtypes.rst:2105 +msgid "" +">>> '0123456789'.isdecimal()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdecimal() # Arabic-Indic digits zero to nine\n" +"True\n" +">>> 'alphabetic'.isdecimal()\n" +"False" msgstr "" -#: ../../library/stdtypes.rst:2083 +#: ../../library/stdtypes.rst:2117 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -3329,23 +3377,23 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:2093 +#: ../../library/stdtypes.rst:2127 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2130 msgid "" ":func:`keyword.iskeyword` can be used to test whether string ``s`` is a " "reserved identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:2099 +#: ../../library/stdtypes.rst:2133 msgid "Example: ::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2136 msgid "" ">>> from keyword import iskeyword\n" "\n" @@ -3361,13 +3409,13 @@ msgstr "" ">>> 'def'.isidentifier(), iskeyword('def')\n" "(True, True)" -#: ../../library/stdtypes.rst:2112 +#: ../../library/stdtypes.rst:2146 msgid "" "Return ``True`` if all cased characters [4]_ in the string are lowercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:2118 +#: ../../library/stdtypes.rst:2152 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -3377,13 +3425,13 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric." msgstr "" -#: ../../library/stdtypes.rst:2128 +#: ../../library/stdtypes.rst:2162 msgid "" "Return ``True`` if all characters in the string are printable, ``False`` if " "it contains at least one non-printable character." msgstr "" -#: ../../library/stdtypes.rst:2131 +#: ../../library/stdtypes.rst:2165 msgid "" "Here \"printable\" means the character is suitable for :func:`repr` to use " "in its output; \"non-printable\" means that :func:`repr` on built-in types " @@ -3391,7 +3439,7 @@ msgid "" "written to :data:`sys.stdout` or :data:`sys.stderr`." msgstr "" -#: ../../library/stdtypes.rst:2136 +#: ../../library/stdtypes.rst:2170 msgid "" "The printable characters are those which in the Unicode character database " "(see :mod:`unicodedata`) have a general category in group Letter, Mark, " @@ -3400,20 +3448,20 @@ msgid "" "C), except the ASCII space." msgstr "" -#: ../../library/stdtypes.rst:2145 +#: ../../library/stdtypes.rst:2179 msgid "" "Return ``True`` if there are only whitespace characters in the string and " "there is at least one character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:2148 +#: ../../library/stdtypes.rst:2182 msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" "`unicodedata`), either its general category is ``Zs`` (\"Separator, " "space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." msgstr "" -#: ../../library/stdtypes.rst:2156 +#: ../../library/stdtypes.rst:2190 msgid "" "Return ``True`` if the string is a titlecased string and there is at least " "one character, for example uppercase characters may only follow uncased " @@ -3421,11 +3469,11 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:2160 ../../library/stdtypes.rst:2694 +#: ../../library/stdtypes.rst:2194 ../../library/stdtypes.rst:2739 msgid "For example:" msgstr "舉例來說:" -#: ../../library/stdtypes.rst:2162 +#: ../../library/stdtypes.rst:2196 msgid "" ">>> 'Spam, Spam, Spam'.istitle()\n" "True\n" @@ -3441,45 +3489,58 @@ msgstr "" ">>> 'SPAM, SPAM, SPAM'.istitle()\n" "False" -#: ../../library/stdtypes.rst:2171 +#: ../../library/stdtypes.rst:2205 msgid "See also :meth:`title`." msgstr "另請參閱 :meth:`title`。" -#: ../../library/stdtypes.rst:2176 +#: ../../library/stdtypes.rst:2210 msgid "" "Return ``True`` if all cased characters [4]_ in the string are uppercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:2194 +#: ../../library/stdtypes.rst:2228 msgid "" "Return a string which is the concatenation of the strings in *iterable*. A :" "exc:`TypeError` will be raised if there are any non-string values in " "*iterable*, including :class:`bytes` objects. The separator between " -"elements is the string providing this method." +"elements is the string providing this method. For example:" +msgstr "" + +#: ../../library/stdtypes.rst:2233 +msgid "" +">>> ', '.join(['spam', 'spam', 'spam'])\n" +"'spam, spam, spam'\n" +">>> '-'.join('Python')\n" +"'P-y-t-h-o-n'" msgstr "" -#: ../../library/stdtypes.rst:2202 +#: ../../library/stdtypes.rst:2240 +#, fuzzy +msgid "See also :meth:`split`." +msgstr "另請參閱 :meth:`istitle`。" + +#: ../../library/stdtypes.rst:2245 msgid "" "Return the string left justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2209 +#: ../../library/stdtypes.rst:2252 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:2212 +#: ../../library/stdtypes.rst:2255 msgid "" "The lowercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2219 +#: ../../library/stdtypes.rst:2262 msgid "" "Return a copy of the string with leading characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -3488,7 +3549,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2224 +#: ../../library/stdtypes.rst:2267 msgid "" ">>> ' spacious '.lstrip()\n" "'spacious '\n" @@ -3500,13 +3561,13 @@ msgstr "" ">>> 'www.example.com'.lstrip('cmowz.')\n" "'example.com'" -#: ../../library/stdtypes.rst:2229 +#: ../../library/stdtypes.rst:2272 msgid "" "See :meth:`str.removeprefix` for a method that will remove a single prefix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2232 +#: ../../library/stdtypes.rst:2275 msgid "" ">>> 'Arthur: three!'.lstrip('Arthur: ')\n" "'ee!'\n" @@ -3518,13 +3579,13 @@ msgstr "" ">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" "'three!'" -#: ../../library/stdtypes.rst:2241 +#: ../../library/stdtypes.rst:2284 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:2243 +#: ../../library/stdtypes.rst:2286 msgid "" "If there is only one argument, it must be a dictionary mapping Unicode " "ordinals (integers) or characters (strings of length 1) to Unicode ordinals, " @@ -3532,7 +3593,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:2248 +#: ../../library/stdtypes.rst:2291 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in *from* will be mapped to the " @@ -3540,7 +3601,7 @@ msgid "" "must be a string, whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:2256 +#: ../../library/stdtypes.rst:2299 msgid "" "Split the string at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -3548,13 +3609,13 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:2264 +#: ../../library/stdtypes.rst:2307 msgid "" "If the string starts with the *prefix* string, return " "``string[len(prefix):]``. Otherwise, return a copy of the original string::" msgstr "" -#: ../../library/stdtypes.rst:2268 +#: ../../library/stdtypes.rst:2311 msgid "" ">>> 'TestHook'.removeprefix('Test')\n" "'Hook'\n" @@ -3566,14 +3627,14 @@ msgstr "" ">>> 'BaseTestCase'.removeprefix('Test')\n" "'BaseTestCase'" -#: ../../library/stdtypes.rst:2278 +#: ../../library/stdtypes.rst:2321 msgid "" "If the string ends with the *suffix* string and that *suffix* is not empty, " "return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " "string::" msgstr "" -#: ../../library/stdtypes.rst:2282 +#: ../../library/stdtypes.rst:2325 msgid "" ">>> 'MiscTests'.removesuffix('Tests')\n" "'Misc'\n" @@ -3585,7 +3646,7 @@ msgstr "" ">>> 'TmpDirMixin'.removesuffix('Tests')\n" "'TmpDirMixin'" -#: ../../library/stdtypes.rst:2292 +#: ../../library/stdtypes.rst:2335 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If *count* is given, only the first *count* occurrences are " @@ -3593,31 +3654,31 @@ msgid "" "replaced." msgstr "" -#: ../../library/stdtypes.rst:2296 +#: ../../library/stdtypes.rst:2339 msgid "*count* is now supported as a keyword argument." msgstr "*count* 現在作為關鍵字引數被支援。" -#: ../../library/stdtypes.rst:2302 +#: ../../library/stdtypes.rst:2345 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " "and *end* are interpreted as in slice notation. Return ``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2309 +#: ../../library/stdtypes.rst:2352 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:2315 +#: ../../library/stdtypes.rst:2358 msgid "" "Return the string right justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2322 +#: ../../library/stdtypes.rst:2365 msgid "" "Split the string at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -3625,7 +3686,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2330 +#: ../../library/stdtypes.rst:2373 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -3634,7 +3695,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2339 +#: ../../library/stdtypes.rst:2382 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -3643,7 +3704,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2344 +#: ../../library/stdtypes.rst:2387 msgid "" ">>> ' spacious '.rstrip()\n" "' spacious'\n" @@ -3655,13 +3716,13 @@ msgstr "" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" -#: ../../library/stdtypes.rst:2349 +#: ../../library/stdtypes.rst:2392 msgid "" "See :meth:`str.removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2352 +#: ../../library/stdtypes.rst:2395 msgid "" ">>> 'Monty Python'.rstrip(' Python')\n" "'M'\n" @@ -3673,7 +3734,7 @@ msgstr "" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" -#: ../../library/stdtypes.rst:2359 +#: ../../library/stdtypes.rst:2402 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " @@ -3682,7 +3743,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2365 +#: ../../library/stdtypes.rst:2408 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -3692,20 +3753,20 @@ msgid "" "``['']``." msgstr "" -#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:2390 -#: ../../library/stdtypes.rst:2402 ../../library/stdtypes.rst:2454 -#: ../../library/stdtypes.rst:2522 ../../library/stdtypes.rst:2592 -#: ../../library/stdtypes.rst:3627 ../../library/stdtypes.rst:3645 -#: ../../library/stdtypes.rst:3735 ../../library/stdtypes.rst:3751 -#: ../../library/stdtypes.rst:3776 ../../library/stdtypes.rst:3790 -#: ../../library/stdtypes.rst:3818 ../../library/stdtypes.rst:3832 -#: ../../library/stdtypes.rst:3850 ../../library/stdtypes.rst:3877 -#: ../../library/stdtypes.rst:3900 ../../library/stdtypes.rst:3927 -#: ../../library/stdtypes.rst:3969 ../../library/stdtypes.rst:3993 +#: ../../library/stdtypes.rst:2415 ../../library/stdtypes.rst:2433 +#: ../../library/stdtypes.rst:2445 ../../library/stdtypes.rst:2499 +#: ../../library/stdtypes.rst:2567 ../../library/stdtypes.rst:2637 +#: ../../library/stdtypes.rst:3672 ../../library/stdtypes.rst:3690 +#: ../../library/stdtypes.rst:3780 ../../library/stdtypes.rst:3796 +#: ../../library/stdtypes.rst:3821 ../../library/stdtypes.rst:3835 +#: ../../library/stdtypes.rst:3863 ../../library/stdtypes.rst:3877 +#: ../../library/stdtypes.rst:3895 ../../library/stdtypes.rst:3922 +#: ../../library/stdtypes.rst:3945 ../../library/stdtypes.rst:3972 +#: ../../library/stdtypes.rst:4014 ../../library/stdtypes.rst:4038 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/stdtypes.rst:2374 +#: ../../library/stdtypes.rst:2417 msgid "" ">>> '1,2,3'.split(',')\n" "['1', '2', '3']\n" @@ -3725,7 +3786,7 @@ msgstr "" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" -#: ../../library/stdtypes.rst:2383 +#: ../../library/stdtypes.rst:2426 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive whitespace are regarded as a single separator, " @@ -3735,7 +3796,7 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2392 +#: ../../library/stdtypes.rst:2435 msgid "" ">>> '1 2 3'.split()\n" "['1', '2', '3']\n" @@ -3751,13 +3812,13 @@ msgstr "" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" -#: ../../library/stdtypes.rst:2399 +#: ../../library/stdtypes.rst:2442 msgid "" "If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only " "leading runs of consecutive whitespace are considered." msgstr "" -#: ../../library/stdtypes.rst:2404 +#: ../../library/stdtypes.rst:2447 msgid "" ">>> \"\".split(None, 0)\n" "[]\n" @@ -3773,120 +3834,125 @@ msgstr "" ">>> \" foo \".split(maxsplit=0)\n" "['foo ']" -#: ../../library/stdtypes.rst:2417 +#: ../../library/stdtypes.rst:2454 +#, fuzzy +msgid "See also :meth:`join`." +msgstr "另請參閱 :meth:`title`。" + +#: ../../library/stdtypes.rst:2462 msgid "" "Return a list of the lines in the string, breaking at line boundaries. Line " "breaks are not included in the resulting list unless *keepends* is given and " "true." msgstr "" -#: ../../library/stdtypes.rst:2421 +#: ../../library/stdtypes.rst:2466 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2425 +#: ../../library/stdtypes.rst:2470 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2425 +#: ../../library/stdtypes.rst:2470 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2427 +#: ../../library/stdtypes.rst:2472 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2427 +#: ../../library/stdtypes.rst:2472 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2429 +#: ../../library/stdtypes.rst:2474 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2429 +#: ../../library/stdtypes.rst:2474 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2431 +#: ../../library/stdtypes.rst:2476 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2431 +#: ../../library/stdtypes.rst:2476 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2433 +#: ../../library/stdtypes.rst:2478 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2433 +#: ../../library/stdtypes.rst:2478 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2435 +#: ../../library/stdtypes.rst:2480 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2435 +#: ../../library/stdtypes.rst:2480 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2437 +#: ../../library/stdtypes.rst:2482 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2437 +#: ../../library/stdtypes.rst:2482 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2439 +#: ../../library/stdtypes.rst:2484 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2439 +#: ../../library/stdtypes.rst:2484 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2441 +#: ../../library/stdtypes.rst:2486 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2441 +#: ../../library/stdtypes.rst:2486 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2443 +#: ../../library/stdtypes.rst:2488 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2443 +#: ../../library/stdtypes.rst:2488 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2445 +#: ../../library/stdtypes.rst:2490 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2445 +#: ../../library/stdtypes.rst:2490 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2447 +#: ../../library/stdtypes.rst:2492 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2447 +#: ../../library/stdtypes.rst:2492 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2452 +#: ../../library/stdtypes.rst:2497 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2456 +#: ../../library/stdtypes.rst:2501 msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "['ab c', '', 'de fg', 'kl']\n" @@ -3898,14 +3964,14 @@ msgstr "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" -#: ../../library/stdtypes.rst:2461 +#: ../../library/stdtypes.rst:2506 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:2465 +#: ../../library/stdtypes.rst:2510 msgid "" ">>> \"\".splitlines()\n" "[]\n" @@ -3917,11 +3983,11 @@ msgstr "" ">>> \"One line\\n\".splitlines()\n" "['One line']" -#: ../../library/stdtypes.rst:2470 +#: ../../library/stdtypes.rst:2515 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2472 +#: ../../library/stdtypes.rst:2517 msgid "" ">>> ''.split('\\n')\n" "['']\n" @@ -3933,7 +3999,7 @@ msgstr "" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" -#: ../../library/stdtypes.rst:2480 +#: ../../library/stdtypes.rst:2525 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -3941,7 +4007,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2488 +#: ../../library/stdtypes.rst:2533 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -3950,7 +4016,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2494 +#: ../../library/stdtypes.rst:2539 msgid "" ">>> ' spacious '.strip()\n" "'spacious'\n" @@ -3962,7 +4028,7 @@ msgstr "" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" -#: ../../library/stdtypes.rst:2499 +#: ../../library/stdtypes.rst:2544 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -3970,7 +4036,7 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2505 +#: ../../library/stdtypes.rst:2550 msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" @@ -3980,20 +4046,20 @@ msgstr "" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" -#: ../../library/stdtypes.rst:2512 +#: ../../library/stdtypes.rst:2557 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. Note that it is not necessarily true that ``s.swapcase()." "swapcase() == s``." msgstr "" -#: ../../library/stdtypes.rst:2519 +#: ../../library/stdtypes.rst:2564 msgid "" "Return a titlecased version of the string where words start with an " "uppercase character and the remaining characters are lowercase." msgstr "" -#: ../../library/stdtypes.rst:2524 +#: ../../library/stdtypes.rst:2569 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" @@ -4001,7 +4067,7 @@ msgstr "" ">>> 'Hello world'.title()\n" "'Hello World'" -#: ../../library/stdtypes.rst:2527 ../../library/stdtypes.rst:3937 +#: ../../library/stdtypes.rst:2572 ../../library/stdtypes.rst:3982 msgid "" "The algorithm uses a simple language-independent definition of a word as " "groups of consecutive letters. The definition works in many contexts but it " @@ -4009,7 +4075,7 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2532 +#: ../../library/stdtypes.rst:2577 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" @@ -4017,19 +4083,19 @@ msgstr "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:2535 +#: ../../library/stdtypes.rst:2580 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2538 +#: ../../library/stdtypes.rst:2583 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2541 +#: ../../library/stdtypes.rst:2586 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -4049,11 +4115,11 @@ msgstr "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:2550 +#: ../../library/stdtypes.rst:2595 msgid "See also :meth:`istitle`." msgstr "另請參閱 :meth:`istitle`。" -#: ../../library/stdtypes.rst:2555 +#: ../../library/stdtypes.rst:2600 msgid "" "Return a copy of the string in which each character has been mapped through " "the given translation table. The table must be an object that implements " @@ -4065,19 +4131,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2564 +#: ../../library/stdtypes.rst:2609 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2567 +#: ../../library/stdtypes.rst:2612 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2573 +#: ../../library/stdtypes.rst:2618 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` " @@ -4086,14 +4152,14 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2579 +#: ../../library/stdtypes.rst:2624 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2586 +#: ../../library/stdtypes.rst:2631 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " @@ -4101,7 +4167,7 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2594 +#: ../../library/stdtypes.rst:2639 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" @@ -4113,27 +4179,27 @@ msgstr "" ">>> \"-42\".zfill(5)\n" "'-0042'" -#: ../../library/stdtypes.rst:2615 +#: ../../library/stdtypes.rst:2660 msgid "Formatted String Literals (f-strings)" msgstr "" -#: ../../library/stdtypes.rst:2618 +#: ../../library/stdtypes.rst:2663 msgid "" "The :keyword:`await` and :keyword:`async for` can be used in expressions " "within f-strings." msgstr "" -#: ../../library/stdtypes.rst:2621 +#: ../../library/stdtypes.rst:2666 msgid "Added the debugging operator (``=``)" msgstr "" -#: ../../library/stdtypes.rst:2623 +#: ../../library/stdtypes.rst:2668 msgid "" "Many restrictions on expressions within f-strings have been removed. " "Notably, nested strings, comments, and backslashes are now permitted." msgstr "" -#: ../../library/stdtypes.rst:2627 +#: ../../library/stdtypes.rst:2672 msgid "" "An :dfn:`f-string` (formally a :dfn:`formatted string literal`) is a string " "literal that is prefixed with ``f`` or ``F``. This type of string literal " @@ -4143,7 +4209,7 @@ msgid "" "into regular :class:`str` objects. For example:" msgstr "" -#: ../../library/stdtypes.rst:2635 +#: ../../library/stdtypes.rst:2680 msgid "" ">>> who = 'nobody'\n" ">>> nationality = 'Spanish'\n" @@ -4155,11 +4221,11 @@ msgstr "" ">>> f'{who.title()} expects the {nationality} Inquisition!'\n" "'Nobody expects the Spanish Inquisition!'" -#: ../../library/stdtypes.rst:2642 +#: ../../library/stdtypes.rst:2687 msgid "It is also possible to use a multi line f-string:" msgstr "" -#: ../../library/stdtypes.rst:2644 +#: ../../library/stdtypes.rst:2689 msgid "" ">>> f'''This is a string\n" "... on two lines'''\n" @@ -4169,13 +4235,13 @@ msgstr "" "... on two lines'''\n" "'This is a string\\non two lines'" -#: ../../library/stdtypes.rst:2650 +#: ../../library/stdtypes.rst:2695 msgid "" "A single opening curly bracket, ``'{'``, marks a *replacement field* that " "can contain any Python expression:" msgstr "" -#: ../../library/stdtypes.rst:2653 +#: ../../library/stdtypes.rst:2698 msgid "" ">>> nationality = 'Spanish'\n" ">>> f'The {nationality} Inquisition!'\n" @@ -4185,11 +4251,11 @@ msgstr "" ">>> f'The {nationality} Inquisition!'\n" "'The Spanish Inquisition!'" -#: ../../library/stdtypes.rst:2659 +#: ../../library/stdtypes.rst:2704 msgid "To include a literal ``{`` or ``}``, use a double bracket:" msgstr "" -#: ../../library/stdtypes.rst:2661 +#: ../../library/stdtypes.rst:2706 msgid "" ">>> x = 42\n" ">>> f'{{x}} is {x}'\n" @@ -4199,12 +4265,12 @@ msgstr "" ">>> f'{{x}} is {x}'\n" "'{x} is 42'" -#: ../../library/stdtypes.rst:2667 +#: ../../library/stdtypes.rst:2712 msgid "" "Functions can also be used, and :ref:`format specifiers `:" msgstr "" -#: ../../library/stdtypes.rst:2669 +#: ../../library/stdtypes.rst:2714 msgid "" ">>> from math import sqrt\n" ">>> f'√2 \\N{ALMOST EQUAL TO} {sqrt(2):.5f}'\n" @@ -4214,11 +4280,11 @@ msgstr "" ">>> f'√2 \\N{ALMOST EQUAL TO} {sqrt(2):.5f}'\n" "'√2 ≈ 1.41421'" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2720 msgid "Any non-string expression is converted using :func:`str`, by default:" msgstr "" -#: ../../library/stdtypes.rst:2677 +#: ../../library/stdtypes.rst:2722 msgid "" ">>> from fractions import Fraction\n" ">>> f'{Fraction(1, 3)}'\n" @@ -4228,42 +4294,42 @@ msgstr "" ">>> f'{Fraction(1, 3)}'\n" "'1/3'" -#: ../../library/stdtypes.rst:2683 +#: ../../library/stdtypes.rst:2728 msgid "" "To use an explicit conversion, use the ``!`` (exclamation mark) operator, " "followed by any of the valid formats, which are:" msgstr "" -#: ../../library/stdtypes.rst:2687 ../../library/stdtypes.rst:2856 -#: ../../library/stdtypes.rst:4116 +#: ../../library/stdtypes.rst:2732 ../../library/stdtypes.rst:2901 +#: ../../library/stdtypes.rst:4161 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2689 +#: ../../library/stdtypes.rst:2734 msgid "``!a``" msgstr "``!a``" -#: ../../library/stdtypes.rst:2689 +#: ../../library/stdtypes.rst:2734 msgid ":func:`ascii`" msgstr ":func:`ascii`" -#: ../../library/stdtypes.rst:2690 +#: ../../library/stdtypes.rst:2735 msgid "``!r``" msgstr "``!r``" -#: ../../library/stdtypes.rst:2690 +#: ../../library/stdtypes.rst:2735 msgid ":func:`repr`" msgstr ":func:`repr`" -#: ../../library/stdtypes.rst:2691 +#: ../../library/stdtypes.rst:2736 msgid "``!s``" msgstr "``!s``" -#: ../../library/stdtypes.rst:2691 +#: ../../library/stdtypes.rst:2736 msgid ":func:`str`" msgstr ":func:`str`" -#: ../../library/stdtypes.rst:2696 +#: ../../library/stdtypes.rst:2741 msgid "" ">>> from fractions import Fraction\n" ">>> f'{Fraction(1, 3)!s}'\n" @@ -4283,7 +4349,7 @@ msgstr "" ">>> print(f'{question!a}')\n" "'\\xbfD\\xf3nde est\\xe1 el Presidente?'" -#: ../../library/stdtypes.rst:2707 +#: ../../library/stdtypes.rst:2752 msgid "" "While debugging it may be helpful to see both the expression and its value, " "by using the equals sign (``=``) after the expression. This preserves spaces " @@ -4291,7 +4357,7 @@ msgid "" "debugging operator uses the :func:`repr` (``!r``) conversion. For example:" msgstr "" -#: ../../library/stdtypes.rst:2713 +#: ../../library/stdtypes.rst:2758 msgid "" ">>> from fractions import Fraction\n" ">>> calculation = Fraction(1, 3)\n" @@ -4311,7 +4377,7 @@ msgstr "" ">>> f'{calculation = !s}'\n" "'calculation = 1/3'" -#: ../../library/stdtypes.rst:2724 +#: ../../library/stdtypes.rst:2769 msgid "" "Once the output has been evaluated, it can be formatted using a :ref:`format " "specifier ` following a colon (``':'``). After the expression " @@ -4321,7 +4387,7 @@ msgid "" "used as the final value for the replacement field. For example:" msgstr "" -#: ../../library/stdtypes.rst:2732 +#: ../../library/stdtypes.rst:2777 msgid "" ">>> from fractions import Fraction\n" ">>> f'{Fraction(1, 7):.6f}'\n" @@ -4335,18 +4401,18 @@ msgstr "" ">>> f'{Fraction(1, 7):_^+10}'\n" "'___+1/7___'" -#: ../../library/stdtypes.rst:2744 +#: ../../library/stdtypes.rst:2789 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2757 +#: ../../library/stdtypes.rst:2802 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " "dictionaries correctly)." msgstr "" -#: ../../library/stdtypes.rst:2761 +#: ../../library/stdtypes.rst:2806 msgid "" "Using :ref:`formatted string literals `, the :meth:`str.format` " "interface, or :class:`string.Template` may help avoid these errors. Each of " @@ -4354,7 +4420,7 @@ msgid "" "flexibility, and/or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2766 +#: ../../library/stdtypes.rst:2811 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -4364,7 +4430,7 @@ msgid "" "function in the C language. For example:" msgstr "" -#: ../../library/stdtypes.rst:2773 +#: ../../library/stdtypes.rst:2818 msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." @@ -4372,7 +4438,7 @@ msgstr "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." -#: ../../library/stdtypes.rst:2778 +#: ../../library/stdtypes.rst:2823 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -4380,36 +4446,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2788 ../../library/stdtypes.rst:4048 +#: ../../library/stdtypes.rst:2833 ../../library/stdtypes.rst:4093 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2791 ../../library/stdtypes.rst:4051 +#: ../../library/stdtypes.rst:2836 ../../library/stdtypes.rst:4096 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2793 ../../library/stdtypes.rst:4053 +#: ../../library/stdtypes.rst:2838 ../../library/stdtypes.rst:4098 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2796 ../../library/stdtypes.rst:4056 +#: ../../library/stdtypes.rst:2841 ../../library/stdtypes.rst:4101 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2799 ../../library/stdtypes.rst:4059 +#: ../../library/stdtypes.rst:2844 ../../library/stdtypes.rst:4104 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is read from the next element of the tuple in *values*, and the " "object to convert comes after the minimum field width and optional precision." msgstr "" -#: ../../library/stdtypes.rst:2803 ../../library/stdtypes.rst:4063 +#: ../../library/stdtypes.rst:2848 ../../library/stdtypes.rst:4108 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -4417,15 +4483,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2808 ../../library/stdtypes.rst:4068 +#: ../../library/stdtypes.rst:2853 ../../library/stdtypes.rst:4113 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2810 ../../library/stdtypes.rst:4070 +#: ../../library/stdtypes.rst:2855 ../../library/stdtypes.rst:4115 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2812 +#: ../../library/stdtypes.rst:2857 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the string *must* include a parenthesised mapping key into that " @@ -4433,275 +4499,275 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2821 ../../library/stdtypes.rst:4081 +#: ../../library/stdtypes.rst:2866 ../../library/stdtypes.rst:4126 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2824 ../../library/stdtypes.rst:4084 +#: ../../library/stdtypes.rst:2869 ../../library/stdtypes.rst:4129 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2833 ../../library/stdtypes.rst:4093 +#: ../../library/stdtypes.rst:2878 ../../library/stdtypes.rst:4138 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2835 ../../library/stdtypes.rst:4095 +#: ../../library/stdtypes.rst:2880 ../../library/stdtypes.rst:4140 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2835 ../../library/stdtypes.rst:4095 +#: ../../library/stdtypes.rst:2880 ../../library/stdtypes.rst:4140 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2838 ../../library/stdtypes.rst:4098 +#: ../../library/stdtypes.rst:2883 ../../library/stdtypes.rst:4143 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2838 ../../library/stdtypes.rst:4098 +#: ../../library/stdtypes.rst:2883 ../../library/stdtypes.rst:4143 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2840 ../../library/stdtypes.rst:4100 +#: ../../library/stdtypes.rst:2885 ../../library/stdtypes.rst:4145 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2840 ../../library/stdtypes.rst:4100 +#: ../../library/stdtypes.rst:2885 ../../library/stdtypes.rst:4145 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2843 ../../library/stdtypes.rst:4103 +#: ../../library/stdtypes.rst:2888 ../../library/stdtypes.rst:4148 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2843 ../../library/stdtypes.rst:4103 +#: ../../library/stdtypes.rst:2888 ../../library/stdtypes.rst:4148 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2846 ../../library/stdtypes.rst:4106 +#: ../../library/stdtypes.rst:2891 ../../library/stdtypes.rst:4151 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2846 ../../library/stdtypes.rst:4106 +#: ../../library/stdtypes.rst:2891 ../../library/stdtypes.rst:4151 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2850 ../../library/stdtypes.rst:4110 +#: ../../library/stdtypes.rst:2895 ../../library/stdtypes.rst:4155 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" -#: ../../library/stdtypes.rst:2853 ../../library/stdtypes.rst:4113 +#: ../../library/stdtypes.rst:2898 ../../library/stdtypes.rst:4158 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2858 ../../library/stdtypes.rst:4118 +#: ../../library/stdtypes.rst:2903 ../../library/stdtypes.rst:4163 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2858 ../../library/stdtypes.rst:2860 -#: ../../library/stdtypes.rst:4118 ../../library/stdtypes.rst:4120 +#: ../../library/stdtypes.rst:2903 ../../library/stdtypes.rst:2905 +#: ../../library/stdtypes.rst:4163 ../../library/stdtypes.rst:4165 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2860 ../../library/stdtypes.rst:4120 +#: ../../library/stdtypes.rst:2905 ../../library/stdtypes.rst:4165 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2862 ../../library/stdtypes.rst:4122 +#: ../../library/stdtypes.rst:2907 ../../library/stdtypes.rst:4167 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2862 ../../library/stdtypes.rst:4122 +#: ../../library/stdtypes.rst:2907 ../../library/stdtypes.rst:4167 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2864 ../../library/stdtypes.rst:4124 +#: ../../library/stdtypes.rst:2909 ../../library/stdtypes.rst:4169 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2864 ../../library/stdtypes.rst:4124 +#: ../../library/stdtypes.rst:2909 ../../library/stdtypes.rst:4169 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2866 ../../library/stdtypes.rst:4126 +#: ../../library/stdtypes.rst:2911 ../../library/stdtypes.rst:4171 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2866 ../../library/stdtypes.rst:4126 +#: ../../library/stdtypes.rst:2911 ../../library/stdtypes.rst:4171 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2868 ../../library/stdtypes.rst:4128 +#: ../../library/stdtypes.rst:2913 ../../library/stdtypes.rst:4173 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2868 ../../library/stdtypes.rst:4128 +#: ../../library/stdtypes.rst:2913 ../../library/stdtypes.rst:4173 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2870 ../../library/stdtypes.rst:4130 +#: ../../library/stdtypes.rst:2915 ../../library/stdtypes.rst:4175 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2870 ../../library/stdtypes.rst:4130 +#: ../../library/stdtypes.rst:2915 ../../library/stdtypes.rst:4175 msgid "Floating-point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2872 ../../library/stdtypes.rst:4132 +#: ../../library/stdtypes.rst:2917 ../../library/stdtypes.rst:4177 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2872 ../../library/stdtypes.rst:4132 +#: ../../library/stdtypes.rst:2917 ../../library/stdtypes.rst:4177 msgid "Floating-point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2874 ../../library/stdtypes.rst:4134 +#: ../../library/stdtypes.rst:2919 ../../library/stdtypes.rst:4179 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2874 ../../library/stdtypes.rst:2876 -#: ../../library/stdtypes.rst:4134 ../../library/stdtypes.rst:4136 +#: ../../library/stdtypes.rst:2919 ../../library/stdtypes.rst:2921 +#: ../../library/stdtypes.rst:4179 ../../library/stdtypes.rst:4181 msgid "Floating-point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2876 ../../library/stdtypes.rst:4136 +#: ../../library/stdtypes.rst:2921 ../../library/stdtypes.rst:4181 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2878 ../../library/stdtypes.rst:4138 +#: ../../library/stdtypes.rst:2923 ../../library/stdtypes.rst:4183 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2878 ../../library/stdtypes.rst:4138 +#: ../../library/stdtypes.rst:2923 ../../library/stdtypes.rst:4183 msgid "" "Floating-point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2882 ../../library/stdtypes.rst:4142 +#: ../../library/stdtypes.rst:2927 ../../library/stdtypes.rst:4187 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2882 ../../library/stdtypes.rst:4142 +#: ../../library/stdtypes.rst:2927 ../../library/stdtypes.rst:4187 msgid "" "Floating-point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2886 ../../library/stdtypes.rst:4146 +#: ../../library/stdtypes.rst:2931 ../../library/stdtypes.rst:4191 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2886 +#: ../../library/stdtypes.rst:2931 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2889 ../../library/stdtypes.rst:4159 +#: ../../library/stdtypes.rst:2934 ../../library/stdtypes.rst:4204 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2889 +#: ../../library/stdtypes.rst:2934 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2892 ../../library/stdtypes.rst:4153 +#: ../../library/stdtypes.rst:2937 ../../library/stdtypes.rst:4198 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2892 +#: ../../library/stdtypes.rst:2937 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2895 ../../library/stdtypes.rst:4156 +#: ../../library/stdtypes.rst:2940 ../../library/stdtypes.rst:4201 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2895 +#: ../../library/stdtypes.rst:2940 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2898 ../../library/stdtypes.rst:4162 +#: ../../library/stdtypes.rst:2943 ../../library/stdtypes.rst:4207 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2898 ../../library/stdtypes.rst:4162 +#: ../../library/stdtypes.rst:2943 ../../library/stdtypes.rst:4207 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2905 ../../library/stdtypes.rst:4169 +#: ../../library/stdtypes.rst:2950 ../../library/stdtypes.rst:4214 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2909 ../../library/stdtypes.rst:4173 +#: ../../library/stdtypes.rst:2954 ../../library/stdtypes.rst:4218 msgid "" "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on " "whether the ``'x'`` or ``'X'`` format was used) to be inserted before the " "first digit." msgstr "" -#: ../../library/stdtypes.rst:2913 ../../library/stdtypes.rst:4177 +#: ../../library/stdtypes.rst:2958 ../../library/stdtypes.rst:4222 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2916 ../../library/stdtypes.rst:4180 +#: ../../library/stdtypes.rst:2961 ../../library/stdtypes.rst:4225 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2920 ../../library/stdtypes.rst:4184 +#: ../../library/stdtypes.rst:2965 ../../library/stdtypes.rst:4229 msgid "" "The alternate form causes the result to always contain a decimal point, and " "trailing zeroes are not removed as they would otherwise be." msgstr "" -#: ../../library/stdtypes.rst:2923 ../../library/stdtypes.rst:4187 +#: ../../library/stdtypes.rst:2968 ../../library/stdtypes.rst:4232 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2927 ../../library/stdtypes.rst:4191 +#: ../../library/stdtypes.rst:2972 ../../library/stdtypes.rst:4236 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2930 ../../library/stdtypes.rst:4200 +#: ../../library/stdtypes.rst:2975 ../../library/stdtypes.rst:4245 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`。" -#: ../../library/stdtypes.rst:2932 +#: ../../library/stdtypes.rst:2977 msgid "" "Since Python strings have an explicit length, ``%s`` conversions do not " "assume that ``'\\0'`` is the end of the string." msgstr "" -#: ../../library/stdtypes.rst:2937 +#: ../../library/stdtypes.rst:2982 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2948 +#: ../../library/stdtypes.rst:2993 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2956 +#: ../../library/stdtypes.rst:3001 msgid "" "The core built-in types for manipulating binary data are :class:`bytes` and :" "class:`bytearray`. They are supported by :class:`memoryview` which uses the :" @@ -4709,17 +4775,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2961 +#: ../../library/stdtypes.rst:3006 msgid "" "The :mod:`array` module supports efficient storage of basic data types like " "32-bit integers and IEEE754 double-precision floating values." msgstr "" -#: ../../library/stdtypes.rst:2967 +#: ../../library/stdtypes.rst:3012 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2971 +#: ../../library/stdtypes.rst:3016 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -4727,40 +4793,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2979 +#: ../../library/stdtypes.rst:3024 msgid "" "Firstly, the syntax for bytes literals is largely the same as that for " "string literals, except that a ``b`` prefix is added:" msgstr "" -#: ../../library/stdtypes.rst:2982 +#: ../../library/stdtypes.rst:3027 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2983 +#: ../../library/stdtypes.rst:3028 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:2984 +#: ../../library/stdtypes.rst:3029 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2986 +#: ../../library/stdtypes.rst:3031 msgid "" "Only ASCII characters are permitted in bytes literals (regardless of the " "declared source code encoding). Any binary values over 127 must be entered " "into bytes literals using the appropriate escape sequence." msgstr "" -#: ../../library/stdtypes.rst:2990 +#: ../../library/stdtypes.rst:3035 msgid "" "As with string literals, bytes literals may also use a ``r`` prefix to " "disable processing of escape sequences. See :ref:`strings` for more about " "the various forms of bytes literal, including supported escape sequences." msgstr "" -#: ../../library/stdtypes.rst:2994 +#: ../../library/stdtypes.rst:3039 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -4773,29 +4839,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:3004 +#: ../../library/stdtypes.rst:3049 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:3007 +#: ../../library/stdtypes.rst:3052 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:3008 +#: ../../library/stdtypes.rst:3053 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3009 +#: ../../library/stdtypes.rst:3054 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:3011 +#: ../../library/stdtypes.rst:3056 msgid "Also see the :ref:`bytes ` built-in." msgstr "另見內建的 :ref:`bytes `。" -#: ../../library/stdtypes.rst:3013 +#: ../../library/stdtypes.rst:3058 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -4803,38 +4869,38 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:3019 +#: ../../library/stdtypes.rst:3064 msgid "" "This :class:`bytes` class method returns a bytes object, decoding the given " "string object. The string must contain two hexadecimal digits per byte, " "with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:3026 +#: ../../library/stdtypes.rst:3071 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:3030 +#: ../../library/stdtypes.rst:3075 msgid "" ":meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like " "objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3034 +#: ../../library/stdtypes.rst:3079 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3040 ../../library/stdtypes.rst:3131 +#: ../../library/stdtypes.rst:3085 ../../library/stdtypes.rst:3176 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:3046 +#: ../../library/stdtypes.rst:3091 msgid "" "If you want to make the hex string easier to read, you can specify a single " "character separator *sep* parameter to include in the output. By default, " @@ -4843,13 +4909,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:3063 +#: ../../library/stdtypes.rst:3108 msgid "" ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters " "to insert separators between bytes in the hex output." msgstr "" -#: ../../library/stdtypes.rst:3067 +#: ../../library/stdtypes.rst:3112 msgid "" "Since bytes objects are sequences of integers (akin to a tuple), for a bytes " "object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " @@ -4857,58 +4923,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3072 +#: ../../library/stdtypes.rst:3117 msgid "" "The representation of bytes objects uses the literal format (``b'...'``) " "since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " "always convert a bytes object into a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:3080 +#: ../../library/stdtypes.rst:3125 msgid "Bytearray Objects" msgstr "Bytearray 物件" -#: ../../library/stdtypes.rst:3084 +#: ../../library/stdtypes.rst:3129 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:3090 +#: ../../library/stdtypes.rst:3135 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:3093 +#: ../../library/stdtypes.rst:3138 msgid "Creating an empty instance: ``bytearray()``" msgstr "建立一個空的實例:``bytearray()``" -#: ../../library/stdtypes.rst:3094 +#: ../../library/stdtypes.rst:3139 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:3095 +#: ../../library/stdtypes.rst:3140 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3096 +#: ../../library/stdtypes.rst:3141 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:3098 +#: ../../library/stdtypes.rst:3143 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " "operations described in :ref:`bytes-methods`." msgstr "" -#: ../../library/stdtypes.rst:3102 +#: ../../library/stdtypes.rst:3147 msgid "Also see the :ref:`bytearray ` built-in." msgstr "另見內建的 :ref:`bytearray `。" -#: ../../library/stdtypes.rst:3104 +#: ../../library/stdtypes.rst:3149 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -4916,64 +4982,64 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:3110 +#: ../../library/stdtypes.rst:3155 msgid "" "This :class:`bytearray` class method returns bytearray object, decoding the " "given string object. The string must contain two hexadecimal digits per " "byte, with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:3117 +#: ../../library/stdtypes.rst:3162 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:3121 +#: ../../library/stdtypes.rst:3166 msgid "" ":meth:`bytearray.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-" "like objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3125 +#: ../../library/stdtypes.rst:3170 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3139 +#: ../../library/stdtypes.rst:3184 msgid "" "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:3146 +#: ../../library/stdtypes.rst:3191 msgid "" "Resize the :class:`bytearray` to contain *size* bytes. *size* must be " "greater than or equal to 0." msgstr "" -#: ../../library/stdtypes.rst:3149 +#: ../../library/stdtypes.rst:3194 msgid "" "If the :class:`bytearray` needs to shrink, bytes beyond *size* are truncated." msgstr "" -#: ../../library/stdtypes.rst:3151 +#: ../../library/stdtypes.rst:3196 msgid "" "If the :class:`bytearray` needs to grow, all new bytes, those beyond *size*, " "will be set to null bytes." msgstr "" -#: ../../library/stdtypes.rst:3155 +#: ../../library/stdtypes.rst:3200 msgid "This is equivalent to:" msgstr "等同於:" -#: ../../library/stdtypes.rst:3163 +#: ../../library/stdtypes.rst:3208 msgid "Examples:" msgstr "範例:" -#: ../../library/stdtypes.rst:3176 +#: ../../library/stdtypes.rst:3221 msgid "" "Since bytearray objects are sequences of integers (akin to a list), for a " "bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be " @@ -4981,7 +5047,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3181 +#: ../../library/stdtypes.rst:3226 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -4989,11 +5055,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:3190 +#: ../../library/stdtypes.rst:3235 msgid "Bytes and Bytearray Operations" msgstr "Bytes 和 Bytearray 的操作" -#: ../../library/stdtypes.rst:3195 +#: ../../library/stdtypes.rst:3240 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -5002,14 +5068,14 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:3203 +#: ../../library/stdtypes.rst:3248 msgid "" "The methods on bytes and bytearray objects don't accept strings as their " "arguments, just as the methods on strings don't accept bytes as their " "arguments. For example, you have to write::" msgstr "" -#: ../../library/stdtypes.rst:3207 +#: ../../library/stdtypes.rst:3252 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" @@ -5017,11 +5083,11 @@ msgstr "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" -#: ../../library/stdtypes.rst:3210 +#: ../../library/stdtypes.rst:3255 msgid "and::" msgstr "和: ::" -#: ../../library/stdtypes.rst:3212 +#: ../../library/stdtypes.rst:3257 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" @@ -5029,60 +5095,60 @@ msgstr "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" -#: ../../library/stdtypes.rst:3215 +#: ../../library/stdtypes.rst:3260 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " "binary data. These restrictions are covered below." msgstr "" -#: ../../library/stdtypes.rst:3220 +#: ../../library/stdtypes.rst:3265 msgid "" "Using these ASCII based operations to manipulate binary data that is not " "stored in an ASCII based format may lead to data corruption." msgstr "" -#: ../../library/stdtypes.rst:3223 +#: ../../library/stdtypes.rst:3268 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:3229 +#: ../../library/stdtypes.rst:3274 msgid "" "Return the number of non-overlapping occurrences of subsequence *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:3233 ../../library/stdtypes.rst:3338 -#: ../../library/stdtypes.rst:3360 ../../library/stdtypes.rst:3426 -#: ../../library/stdtypes.rst:3439 +#: ../../library/stdtypes.rst:3278 ../../library/stdtypes.rst:3383 +#: ../../library/stdtypes.rst:3405 ../../library/stdtypes.rst:3471 +#: ../../library/stdtypes.rst:3484 msgid "" "The subsequence to search for may be any :term:`bytes-like object` or an " "integer in the range 0 to 255." msgstr "" -#: ../../library/stdtypes.rst:3236 +#: ../../library/stdtypes.rst:3281 msgid "" "If *sub* is empty, returns the number of empty slices between characters " "which is the length of the bytes object plus one." msgstr "" -#: ../../library/stdtypes.rst:3239 ../../library/stdtypes.rst:3350 -#: ../../library/stdtypes.rst:3363 ../../library/stdtypes.rst:3429 -#: ../../library/stdtypes.rst:3442 +#: ../../library/stdtypes.rst:3284 ../../library/stdtypes.rst:3395 +#: ../../library/stdtypes.rst:3408 ../../library/stdtypes.rst:3474 +#: ../../library/stdtypes.rst:3487 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:3246 +#: ../../library/stdtypes.rst:3291 msgid "" "If the binary data starts with the *prefix* string, return " "``bytes[len(prefix):]``. Otherwise, return a copy of the original binary " "data::" msgstr "" -#: ../../library/stdtypes.rst:3250 +#: ../../library/stdtypes.rst:3295 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" @@ -5094,32 +5160,32 @@ msgstr "" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" -#: ../../library/stdtypes.rst:3255 +#: ../../library/stdtypes.rst:3300 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "*prefix* 可以是任何的 :term:`bytes-like object`。" -#: ../../library/stdtypes.rst:3259 ../../library/stdtypes.rst:3281 -#: ../../library/stdtypes.rst:3414 ../../library/stdtypes.rst:3507 -#: ../../library/stdtypes.rst:3521 ../../library/stdtypes.rst:3551 -#: ../../library/stdtypes.rst:3565 ../../library/stdtypes.rst:3606 -#: ../../library/stdtypes.rst:3676 ../../library/stdtypes.rst:3694 -#: ../../library/stdtypes.rst:3722 ../../library/stdtypes.rst:3861 -#: ../../library/stdtypes.rst:3916 ../../library/stdtypes.rst:3959 -#: ../../library/stdtypes.rst:3980 ../../library/stdtypes.rst:4002 -#: ../../library/stdtypes.rst:4204 +#: ../../library/stdtypes.rst:3304 ../../library/stdtypes.rst:3326 +#: ../../library/stdtypes.rst:3459 ../../library/stdtypes.rst:3552 +#: ../../library/stdtypes.rst:3566 ../../library/stdtypes.rst:3596 +#: ../../library/stdtypes.rst:3610 ../../library/stdtypes.rst:3651 +#: ../../library/stdtypes.rst:3721 ../../library/stdtypes.rst:3739 +#: ../../library/stdtypes.rst:3767 ../../library/stdtypes.rst:3906 +#: ../../library/stdtypes.rst:3961 ../../library/stdtypes.rst:4004 +#: ../../library/stdtypes.rst:4025 ../../library/stdtypes.rst:4047 +#: ../../library/stdtypes.rst:4249 msgid "" "The bytearray version of this method does *not* operate in place - it always " "produces a new object, even if no changes were made." msgstr "" -#: ../../library/stdtypes.rst:3268 +#: ../../library/stdtypes.rst:3313 msgid "" "If the binary data ends with the *suffix* string and that *suffix* is not " "empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the " "original binary data::" msgstr "" -#: ../../library/stdtypes.rst:3272 +#: ../../library/stdtypes.rst:3317 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" @@ -5131,15 +5197,15 @@ msgstr "" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" -#: ../../library/stdtypes.rst:3277 +#: ../../library/stdtypes.rst:3322 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3290 +#: ../../library/stdtypes.rst:3335 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:3295 +#: ../../library/stdtypes.rst:3340 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -5147,21 +5213,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:3301 +#: ../../library/stdtypes.rst:3346 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" "`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:3307 +#: ../../library/stdtypes.rst:3352 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary :class:`!" "bytes` or :class:`!bytearray` object." msgstr "" -#: ../../library/stdtypes.rst:3322 +#: ../../library/stdtypes.rst:3367 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -5169,11 +5235,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3327 +#: ../../library/stdtypes.rst:3372 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3333 +#: ../../library/stdtypes.rst:3378 msgid "" "Return the lowest index in the data where the subsequence *sub* is found, " "such that *sub* is contained in the slice ``s[start:end]``. Optional " @@ -5181,14 +5247,14 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3343 +#: ../../library/stdtypes.rst:3388 msgid "" "The :meth:`~bytes.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:3347 +#: ../../library/stdtypes.rst:3392 msgid "" ">>> b'Py' in b'Python'\n" "True" @@ -5196,13 +5262,13 @@ msgstr "" ">>> b'Py' in b'Python'\n" "True" -#: ../../library/stdtypes.rst:3357 +#: ../../library/stdtypes.rst:3402 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:3370 +#: ../../library/stdtypes.rst:3415 msgid "" "Return a bytes or bytearray object which is the concatenation of the binary " "data sequences in *iterable*. A :exc:`TypeError` will be raised if there " @@ -5212,7 +5278,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:3381 +#: ../../library/stdtypes.rst:3426 msgid "" "This static method returns a translation table usable for :meth:`bytes." "translate` that will map each character in *from* into the character at the " @@ -5220,7 +5286,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:3392 +#: ../../library/stdtypes.rst:3437 msgid "" "Split the sequence at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -5229,24 +5295,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:3399 ../../library/stdtypes.rst:3456 +#: ../../library/stdtypes.rst:3444 ../../library/stdtypes.rst:3501 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3405 +#: ../../library/stdtypes.rst:3450 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If the optional argument *count* is given, only the " "first *count* occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:3409 +#: ../../library/stdtypes.rst:3454 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3421 +#: ../../library/stdtypes.rst:3466 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -5254,13 +5320,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:3436 +#: ../../library/stdtypes.rst:3481 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3449 +#: ../../library/stdtypes.rst:3494 msgid "" "Split the sequence at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -5269,7 +5335,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:3462 +#: ../../library/stdtypes.rst:3507 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -5277,11 +5343,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3467 +#: ../../library/stdtypes.rst:3512 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3473 +#: ../../library/stdtypes.rst:3518 msgid "" "Return a copy of the bytes or bytearray object where all bytes occurring in " "the optional argument *delete* are removed, and the remaining bytes have " @@ -5289,18 +5355,18 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:3478 +#: ../../library/stdtypes.rst:3523 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:3481 +#: ../../library/stdtypes.rst:3526 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:3484 +#: ../../library/stdtypes.rst:3529 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" @@ -5308,11 +5374,11 @@ msgstr "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" -#: ../../library/stdtypes.rst:3487 +#: ../../library/stdtypes.rst:3532 msgid "*delete* is now supported as a keyword argument." msgstr "支援 *delete* 關鍵字引數。" -#: ../../library/stdtypes.rst:3491 +#: ../../library/stdtypes.rst:3536 msgid "" "The following methods on bytes and bytearray objects have default behaviours " "that assume the use of ASCII compatible binary formats, but can still be " @@ -5321,7 +5387,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3500 +#: ../../library/stdtypes.rst:3545 msgid "" "Return a copy of the object centered in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -5329,7 +5395,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3514 +#: ../../library/stdtypes.rst:3559 msgid "" "Return a copy of the object left justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -5337,7 +5403,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3528 +#: ../../library/stdtypes.rst:3573 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -5346,7 +5412,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3534 +#: ../../library/stdtypes.rst:3579 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" @@ -5358,14 +5424,14 @@ msgstr "" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" -#: ../../library/stdtypes.rst:3539 +#: ../../library/stdtypes.rst:3584 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removeprefix` for a method that will remove a " "single prefix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3544 +#: ../../library/stdtypes.rst:3589 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" @@ -5377,7 +5443,7 @@ msgstr "" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" -#: ../../library/stdtypes.rst:3558 +#: ../../library/stdtypes.rst:3603 msgid "" "Return a copy of the object right justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -5385,7 +5451,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3572 +#: ../../library/stdtypes.rst:3617 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " @@ -5395,7 +5461,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:3628 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -5404,7 +5470,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3589 +#: ../../library/stdtypes.rst:3634 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" @@ -5416,14 +5482,14 @@ msgstr "" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" -#: ../../library/stdtypes.rst:3594 +#: ../../library/stdtypes.rst:3639 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removesuffix` for a method that will remove a " "single suffix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:3644 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" @@ -5435,7 +5501,7 @@ msgstr "" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" -#: ../../library/stdtypes.rst:3613 +#: ../../library/stdtypes.rst:3658 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given and non-negative, at most " @@ -5444,7 +5510,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3619 +#: ../../library/stdtypes.rst:3664 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -5455,7 +5521,7 @@ msgid "" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3629 +#: ../../library/stdtypes.rst:3674 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -5475,7 +5541,7 @@ msgstr "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" -#: ../../library/stdtypes.rst:3638 +#: ../../library/stdtypes.rst:3683 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive ASCII whitespace are regarded as a single " @@ -5485,7 +5551,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3648 +#: ../../library/stdtypes.rst:3693 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -5501,7 +5567,7 @@ msgstr "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" -#: ../../library/stdtypes.rst:3659 +#: ../../library/stdtypes.rst:3704 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *bytes* argument is a binary sequence specifying the set of " @@ -5510,7 +5576,7 @@ msgid "" "or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3666 +#: ../../library/stdtypes.rst:3711 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" @@ -5522,13 +5588,13 @@ msgstr "" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" -#: ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:3716 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3680 +#: ../../library/stdtypes.rst:3725 msgid "" "The following methods on bytes and bytearray objects assume the use of ASCII " "compatible binary formats and should not be applied to arbitrary binary " @@ -5536,14 +5602,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3688 +#: ../../library/stdtypes.rst:3733 msgid "" "Return a copy of the sequence with each byte interpreted as an ASCII " "character, and the first byte capitalized and the rest lowercased. Non-ASCII " "byte values are passed through unchanged." msgstr "" -#: ../../library/stdtypes.rst:3701 +#: ../../library/stdtypes.rst:3746 msgid "" "Return a copy of the sequence where all ASCII tab characters are replaced by " "one or more ASCII spaces, depending on the current column and the given tab " @@ -5559,7 +5625,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3715 +#: ../../library/stdtypes.rst:3760 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" @@ -5571,7 +5637,7 @@ msgstr "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" -#: ../../library/stdtypes.rst:3729 +#: ../../library/stdtypes.rst:3774 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -5580,7 +5646,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3737 +#: ../../library/stdtypes.rst:3782 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" @@ -5592,7 +5658,7 @@ msgstr "" ">>> b'ABC abc1'.isalnum()\n" "False" -#: ../../library/stdtypes.rst:3746 +#: ../../library/stdtypes.rst:3791 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -5600,7 +5666,7 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3753 +#: ../../library/stdtypes.rst:3798 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" @@ -5612,20 +5678,20 @@ msgstr "" ">>> b'ABCabc1'.isalpha()\n" "False" -#: ../../library/stdtypes.rst:3762 +#: ../../library/stdtypes.rst:3807 msgid "" "Return ``True`` if the sequence is empty or all bytes in the sequence are " "ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." msgstr "" -#: ../../library/stdtypes.rst:3772 +#: ../../library/stdtypes.rst:3817 msgid "" "Return ``True`` if all bytes in the sequence are ASCII decimal digits and " "the sequence is not empty, ``False`` otherwise. ASCII decimal digits are " "those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3778 +#: ../../library/stdtypes.rst:3823 msgid "" ">>> b'1234'.isdigit()\n" "True\n" @@ -5637,13 +5703,13 @@ msgstr "" ">>> b'1.23'.isdigit()\n" "False" -#: ../../library/stdtypes.rst:3787 +#: ../../library/stdtypes.rst:3832 msgid "" "Return ``True`` if there is at least one lowercase ASCII character in the " "sequence and no uppercase ASCII characters, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:3792 +#: ../../library/stdtypes.rst:3837 msgid "" ">>> b'hello world'.islower()\n" "True\n" @@ -5655,16 +5721,16 @@ msgstr "" ">>> b'Hello world'.islower()\n" "False" -#: ../../library/stdtypes.rst:3797 ../../library/stdtypes.rst:3839 -#: ../../library/stdtypes.rst:3855 ../../library/stdtypes.rst:3905 -#: ../../library/stdtypes.rst:3974 +#: ../../library/stdtypes.rst:3842 ../../library/stdtypes.rst:3884 +#: ../../library/stdtypes.rst:3900 ../../library/stdtypes.rst:3950 +#: ../../library/stdtypes.rst:4019 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " "values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3805 +#: ../../library/stdtypes.rst:3850 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -5672,14 +5738,14 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3814 +#: ../../library/stdtypes.rst:3859 msgid "" "Return ``True`` if the sequence is ASCII titlecase and the sequence is not " "empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the " "definition of \"titlecase\"." msgstr "" -#: ../../library/stdtypes.rst:3820 +#: ../../library/stdtypes.rst:3865 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" @@ -5691,14 +5757,14 @@ msgstr "" ">>> b'Hello world'.istitle()\n" "False" -#: ../../library/stdtypes.rst:3829 +#: ../../library/stdtypes.rst:3874 msgid "" "Return ``True`` if there is at least one uppercase alphabetic ASCII " "character in the sequence and no lowercase ASCII characters, ``False`` " "otherwise." msgstr "" -#: ../../library/stdtypes.rst:3834 +#: ../../library/stdtypes.rst:3879 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" @@ -5710,13 +5776,13 @@ msgstr "" ">>> b'Hello world'.isupper()\n" "False" -#: ../../library/stdtypes.rst:3847 +#: ../../library/stdtypes.rst:3892 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3852 +#: ../../library/stdtypes.rst:3897 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" @@ -5724,7 +5790,7 @@ msgstr "" ">>> b'Hello World'.lower()\n" "b'hello world'" -#: ../../library/stdtypes.rst:3872 +#: ../../library/stdtypes.rst:3917 msgid "" "Return a list of the lines in the binary sequence, breaking at ASCII line " "boundaries. This method uses the :term:`universal newlines` approach to " @@ -5732,7 +5798,7 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3879 +#: ../../library/stdtypes.rst:3924 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" @@ -5744,14 +5810,14 @@ msgstr "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" -#: ../../library/stdtypes.rst:3884 +#: ../../library/stdtypes.rst:3929 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:3888 +#: ../../library/stdtypes.rst:3933 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" @@ -5763,13 +5829,13 @@ msgstr "" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" -#: ../../library/stdtypes.rst:3897 +#: ../../library/stdtypes.rst:3942 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." msgstr "" -#: ../../library/stdtypes.rst:3902 +#: ../../library/stdtypes.rst:3947 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" @@ -5777,7 +5843,7 @@ msgstr "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" -#: ../../library/stdtypes.rst:3909 +#: ../../library/stdtypes.rst:3954 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -5785,14 +5851,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3923 +#: ../../library/stdtypes.rst:3968 msgid "" "Return a titlecased version of the binary sequence where words start with an " "uppercase ASCII character and the remaining characters are lowercase. " "Uncased byte values are left unmodified." msgstr "" -#: ../../library/stdtypes.rst:3929 +#: ../../library/stdtypes.rst:3974 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" @@ -5800,7 +5866,7 @@ msgstr "" ">>> b'Hello world'.title()\n" "b'Hello World'" -#: ../../library/stdtypes.rst:3932 +#: ../../library/stdtypes.rst:3977 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -5808,7 +5874,7 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3942 +#: ../../library/stdtypes.rst:3987 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" @@ -5816,12 +5882,12 @@ msgstr "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:3945 +#: ../../library/stdtypes.rst:3990 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3947 +#: ../../library/stdtypes.rst:3992 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -5843,13 +5909,13 @@ msgstr "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:3966 +#: ../../library/stdtypes.rst:4011 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3971 +#: ../../library/stdtypes.rst:4016 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" @@ -5857,7 +5923,7 @@ msgstr "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" -#: ../../library/stdtypes.rst:3987 +#: ../../library/stdtypes.rst:4032 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -5866,7 +5932,7 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3995 +#: ../../library/stdtypes.rst:4040 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" @@ -5878,11 +5944,11 @@ msgstr "" ">>> b\"-42\".zfill(5)\n" "b'-0042'" -#: ../../library/stdtypes.rst:4009 +#: ../../library/stdtypes.rst:4054 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:4026 +#: ../../library/stdtypes.rst:4071 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -5890,7 +5956,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:4031 +#: ../../library/stdtypes.rst:4076 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -5900,7 +5966,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:4038 +#: ../../library/stdtypes.rst:4083 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -5908,7 +5974,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:4072 +#: ../../library/stdtypes.rst:4117 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the bytes object *must* include a parenthesised mapping key into " @@ -5916,77 +5982,77 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:4124 +#: ../../library/stdtypes.rst:4169 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:4146 +#: ../../library/stdtypes.rst:4191 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:4149 +#: ../../library/stdtypes.rst:4194 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:4149 +#: ../../library/stdtypes.rst:4194 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`~object.__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:4153 +#: ../../library/stdtypes.rst:4198 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4156 +#: ../../library/stdtypes.rst:4201 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:4159 +#: ../../library/stdtypes.rst:4204 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4159 +#: ../../library/stdtypes.rst:4204 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:4194 +#: ../../library/stdtypes.rst:4239 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%s'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4197 +#: ../../library/stdtypes.rst:4242 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%r'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4209 +#: ../../library/stdtypes.rst:4254 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:4216 +#: ../../library/stdtypes.rst:4261 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:4218 +#: ../../library/stdtypes.rst:4263 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying." msgstr "" -#: ../../library/stdtypes.rst:4224 +#: ../../library/stdtypes.rst:4269 msgid "" "Create a :class:`memoryview` that references *object*. *object* must " "support the buffer protocol. Built-in objects that support the buffer " "protocol include :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/stdtypes.rst:4228 +#: ../../library/stdtypes.rst:4273 msgid "" "A :class:`memoryview` has the notion of an *element*, which is the atomic " "memory unit handled by the originating *object*. For many simple types such " @@ -5994,32 +6060,32 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:4233 +#: ../../library/stdtypes.rst:4278 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which " "is the nested list representation of the view. If ``view.ndim = 1``, this is " "equal to the number of elements in the view." msgstr "" -#: ../../library/stdtypes.rst:4237 +#: ../../library/stdtypes.rst:4282 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -#: ../../library/stdtypes.rst:4240 +#: ../../library/stdtypes.rst:4285 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:4243 +#: ../../library/stdtypes.rst:4288 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:4246 +#: ../../library/stdtypes.rst:4291 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -6041,7 +6107,7 @@ msgstr "" ">>> bytes(v[1:4])\n" "b'bce'" -#: ../../library/stdtypes.rst:4256 +#: ../../library/stdtypes.rst:4301 msgid "" "If :class:`~memoryview.format` is one of the native format specifiers from " "the :mod:`struct` module, indexing with an integer or a tuple of integers is " @@ -6052,11 +6118,11 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:4265 +#: ../../library/stdtypes.rst:4310 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:4267 +#: ../../library/stdtypes.rst:4312 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -6078,13 +6144,13 @@ msgstr "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" -#: ../../library/stdtypes.rst:4277 +#: ../../library/stdtypes.rst:4322 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:4280 +#: ../../library/stdtypes.rst:4325 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -6124,14 +6190,14 @@ msgstr "" ">>> data\n" "bytearray(b'z1spam')" -#: ../../library/stdtypes.rst:4298 +#: ../../library/stdtypes.rst:4343 msgid "" "One-dimensional memoryviews of :term:`hashable` (read-only) types with " "formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) " "== hash(m.tobytes())``::" msgstr "" -#: ../../library/stdtypes.rst:4302 +#: ../../library/stdtypes.rst:4347 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -6149,44 +6215,44 @@ msgstr "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" -#: ../../library/stdtypes.rst:4310 +#: ../../library/stdtypes.rst:4355 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4314 +#: ../../library/stdtypes.rst:4359 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:4318 +#: ../../library/stdtypes.rst:4363 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:4321 +#: ../../library/stdtypes.rst:4366 msgid "memoryview is now a :term:`generic type`." msgstr "" -#: ../../library/stdtypes.rst:4324 +#: ../../library/stdtypes.rst:4369 msgid ":class:`memoryview` has several methods:" msgstr ":class:`memoryview` 有幾個方法:" -#: ../../library/stdtypes.rst:4328 +#: ../../library/stdtypes.rst:4373 msgid "" "A memoryview and a :pep:`3118` exporter are equal if their shapes are " "equivalent and if all corresponding values are equal when the operands' " "respective format codes are interpreted using :mod:`struct` syntax." msgstr "" -#: ../../library/stdtypes.rst:4332 +#: ../../library/stdtypes.rst:4377 msgid "" "For the subset of :mod:`struct` format strings currently supported by :meth:" "`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" msgstr "" -#: ../../library/stdtypes.rst:4335 +#: ../../library/stdtypes.rst:4380 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -6220,14 +6286,14 @@ msgstr "" ">>> z.tolist() == c.tolist()\n" "True" -#: ../../library/stdtypes.rst:4351 +#: ../../library/stdtypes.rst:4396 msgid "" "If either format string is not supported by the :mod:`struct` module, then " "the objects will always compare as unequal (even if the format strings and " "buffer contents are identical)::" msgstr "" -#: ../../library/stdtypes.rst:4355 +#: ../../library/stdtypes.rst:4400 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -6253,25 +6319,25 @@ msgstr "" ">>> a == b\n" "False" -#: ../../library/stdtypes.rst:4367 +#: ../../library/stdtypes.rst:4412 msgid "" "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:4415 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:4376 +#: ../../library/stdtypes.rst:4421 msgid "" "Return the data in the buffer as a bytestring. This is equivalent to " "calling the :class:`bytes` constructor on the memoryview. ::" msgstr "" -#: ../../library/stdtypes.rst:4379 +#: ../../library/stdtypes.rst:4424 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -6285,7 +6351,7 @@ msgstr "" ">>> bytes(m)\n" "b'abc'" -#: ../../library/stdtypes.rst:4385 +#: ../../library/stdtypes.rst:4430 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -6293,7 +6359,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:4390 +#: ../../library/stdtypes.rst:4435 msgid "" "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the " "original array is converted to C or Fortran order. For contiguous views, 'A' " @@ -6302,13 +6368,13 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:4400 +#: ../../library/stdtypes.rst:4445 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:4403 +#: ../../library/stdtypes.rst:4448 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" @@ -6318,18 +6384,18 @@ msgstr "" ">>> m.hex()\n" "'616263'" -#: ../../library/stdtypes.rst:4409 +#: ../../library/stdtypes.rst:4454 msgid "" "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:4416 +#: ../../library/stdtypes.rst:4461 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:4418 +#: ../../library/stdtypes.rst:4463 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -6347,19 +6413,19 @@ msgstr "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" -#: ../../library/stdtypes.rst:4426 +#: ../../library/stdtypes.rst:4471 msgid "" ":meth:`tolist` now supports all single character native formats in :mod:" "`struct` module syntax as well as multi-dimensional representations." msgstr "" -#: ../../library/stdtypes.rst:4433 +#: ../../library/stdtypes.rst:4478 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:4436 +#: ../../library/stdtypes.rst:4481 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -6385,7 +6451,7 @@ msgstr "" ">>> mm.tolist()\n" "[43, 98, 99]" -#: ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:4497 msgid "" "Release the underlying buffer exposed by the memoryview object. Many " "objects take special actions when a view is held on them (for example, a :" @@ -6394,14 +6460,14 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:4458 +#: ../../library/stdtypes.rst:4503 msgid "" "After this method has been called, any further operation on the view raises " "a :class:`ValueError` (except :meth:`release` itself which can be called " "multiple times)::" msgstr "" -#: ../../library/stdtypes.rst:4462 +#: ../../library/stdtypes.rst:4507 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -6417,13 +6483,13 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4469 +#: ../../library/stdtypes.rst:4514 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:4472 +#: ../../library/stdtypes.rst:4517 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -6443,7 +6509,7 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4486 +#: ../../library/stdtypes.rst:4531 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -6452,7 +6518,7 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:4492 +#: ../../library/stdtypes.rst:4537 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " @@ -6460,11 +6526,11 @@ msgid "" "Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:4498 +#: ../../library/stdtypes.rst:4543 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:4500 +#: ../../library/stdtypes.rst:4545 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -6508,11 +6574,11 @@ msgstr "" ">>> y.nbytes\n" "24" -#: ../../library/stdtypes.rst:4521 +#: ../../library/stdtypes.rst:4566 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4523 +#: ../../library/stdtypes.rst:4568 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -6536,11 +6602,11 @@ msgstr "" ">>> b\n" "bytearray(b'ayz')" -#: ../../library/stdtypes.rst:4534 +#: ../../library/stdtypes.rst:4579 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4536 +#: ../../library/stdtypes.rst:4581 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -6590,11 +6656,11 @@ msgstr "" ">>> z.nbytes\n" "48" -#: ../../library/stdtypes.rst:4560 +#: ../../library/stdtypes.rst:4605 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4562 +#: ../../library/stdtypes.rst:4607 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -6616,33 +6682,33 @@ msgstr "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" -#: ../../library/stdtypes.rst:4574 +#: ../../library/stdtypes.rst:4619 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4579 +#: ../../library/stdtypes.rst:4624 msgid "Count the number of occurrences of *value*." msgstr "計算 *value* 的出現次數" -#: ../../library/stdtypes.rst:4585 +#: ../../library/stdtypes.rst:4630 msgid "" "Return the index of the first occurrence of *value* (at or after index " "*start* and before index *stop*)." msgstr "" -#: ../../library/stdtypes.rst:4588 +#: ../../library/stdtypes.rst:4633 msgid "Raises a :exc:`ValueError` if *value* cannot be found." msgstr "在找不到 *value* 時引發 :exc:`ValueError`。" -#: ../../library/stdtypes.rst:4592 +#: ../../library/stdtypes.rst:4637 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4596 +#: ../../library/stdtypes.rst:4641 msgid "The underlying object of the memoryview::" msgstr "memoryview 的底層物件: ::" -#: ../../library/stdtypes.rst:4598 +#: ../../library/stdtypes.rst:4643 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" @@ -6654,14 +6720,14 @@ msgstr "" ">>> m.obj is b\n" "True" -#: ../../library/stdtypes.rst:4607 +#: ../../library/stdtypes.rst:4652 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -#: ../../library/stdtypes.rst:4611 +#: ../../library/stdtypes.rst:4656 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -6693,11 +6759,11 @@ msgstr "" ">>> len(y.tobytes())\n" "12" -#: ../../library/stdtypes.rst:4626 +#: ../../library/stdtypes.rst:4671 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4628 +#: ../../library/stdtypes.rst:4673 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" @@ -6721,11 +6787,11 @@ msgstr "" ">>> y.nbytes\n" "96" -#: ../../library/stdtypes.rst:4643 +#: ../../library/stdtypes.rst:4688 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4647 +#: ../../library/stdtypes.rst:4692 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -6733,17 +6799,17 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4652 +#: ../../library/stdtypes.rst:4697 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" -#: ../../library/stdtypes.rst:4658 +#: ../../library/stdtypes.rst:4703 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4660 +#: ../../library/stdtypes.rst:4705 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -6763,49 +6829,49 @@ msgstr "" ">>> struct.calcsize('H') == m.itemsize\n" "True" -#: ../../library/stdtypes.rst:4671 +#: ../../library/stdtypes.rst:4716 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4676 +#: ../../library/stdtypes.rst:4721 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." msgstr "" -#: ../../library/stdtypes.rst:4679 ../../library/stdtypes.rst:4687 +#: ../../library/stdtypes.rst:4724 ../../library/stdtypes.rst:4732 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4684 +#: ../../library/stdtypes.rst:4729 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." msgstr "" -#: ../../library/stdtypes.rst:4692 +#: ../../library/stdtypes.rst:4737 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4696 +#: ../../library/stdtypes.rst:4741 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4702 +#: ../../library/stdtypes.rst:4747 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4708 +#: ../../library/stdtypes.rst:4753 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4716 +#: ../../library/stdtypes.rst:4761 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4720 +#: ../../library/stdtypes.rst:4765 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -6815,7 +6881,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4727 +#: ../../library/stdtypes.rst:4772 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -6823,7 +6889,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4732 +#: ../../library/stdtypes.rst:4777 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -6835,18 +6901,18 @@ msgid "" "or as an element of another set." msgstr "" -#: ../../library/stdtypes.rst:4741 +#: ../../library/stdtypes.rst:4786 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -#: ../../library/stdtypes.rst:4745 +#: ../../library/stdtypes.rst:4790 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4750 +#: ../../library/stdtypes.rst:4795 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -6854,92 +6920,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4756 +#: ../../library/stdtypes.rst:4801 msgid "Sets can be created by several means:" msgstr "集合可以以多種方式建立:" -#: ../../library/stdtypes.rst:4758 +#: ../../library/stdtypes.rst:4803 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4759 +#: ../../library/stdtypes.rst:4804 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4760 +#: ../../library/stdtypes.rst:4805 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4762 +#: ../../library/stdtypes.rst:4807 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4767 +#: ../../library/stdtypes.rst:4812 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4771 +#: ../../library/stdtypes.rst:4816 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4775 +#: ../../library/stdtypes.rst:4820 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4779 +#: ../../library/stdtypes.rst:4824 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." msgstr "" -#: ../../library/stdtypes.rst:4785 +#: ../../library/stdtypes.rst:4830 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4789 +#: ../../library/stdtypes.rst:4834 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4795 +#: ../../library/stdtypes.rst:4840 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4799 +#: ../../library/stdtypes.rst:4844 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4805 +#: ../../library/stdtypes.rst:4850 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4810 +#: ../../library/stdtypes.rst:4855 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4815 +#: ../../library/stdtypes.rst:4860 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4820 +#: ../../library/stdtypes.rst:4865 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4824 +#: ../../library/stdtypes.rst:4869 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4827 +#: ../../library/stdtypes.rst:4872 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -6949,7 +7015,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4834 +#: ../../library/stdtypes.rst:4879 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -6959,14 +7025,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:4886 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " "returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" -#: ../../library/stdtypes.rst:4845 +#: ../../library/stdtypes.rst:4890 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -6974,71 +7040,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4850 +#: ../../library/stdtypes.rst:4895 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" -#: ../../library/stdtypes.rst:4853 +#: ../../library/stdtypes.rst:4898 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4855 +#: ../../library/stdtypes.rst:4900 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -#: ../../library/stdtypes.rst:4859 +#: ../../library/stdtypes.rst:4904 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4865 +#: ../../library/stdtypes.rst:4910 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4870 +#: ../../library/stdtypes.rst:4915 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4875 +#: ../../library/stdtypes.rst:4920 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4880 +#: ../../library/stdtypes.rst:4925 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4884 +#: ../../library/stdtypes.rst:4929 msgid "Add element *elem* to the set." msgstr "將元素 *elem* 加入集合。" -#: ../../library/stdtypes.rst:4888 +#: ../../library/stdtypes.rst:4933 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4893 +#: ../../library/stdtypes.rst:4938 msgid "Remove element *elem* from the set if it is present." msgstr "如果 *elem* 存在於集合中則將其移除。" -#: ../../library/stdtypes.rst:4897 +#: ../../library/stdtypes.rst:4942 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4902 +#: ../../library/stdtypes.rst:4947 msgid "Remove all elements from the set." msgstr "從集合中移除所有元素。" -#: ../../library/stdtypes.rst:4905 +#: ../../library/stdtypes.rst:4950 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -7046,18 +7112,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4910 +#: ../../library/stdtypes.rst:4955 msgid "" "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:" "`remove`, and :meth:`discard` methods may be a set. To support searching " "for an equivalent frozenset, a temporary one is created from *elem*." msgstr "" -#: ../../library/stdtypes.rst:4919 +#: ../../library/stdtypes.rst:4964 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4929 +#: ../../library/stdtypes.rst:4974 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -7066,7 +7132,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4935 +#: ../../library/stdtypes.rst:4980 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -7075,33 +7141,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4946 +#: ../../library/stdtypes.rst:4991 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4949 +#: ../../library/stdtypes.rst:4994 msgid "Dictionaries can be created by several means:" msgstr "字典可以用數種方式建立:" -#: ../../library/stdtypes.rst:4951 +#: ../../library/stdtypes.rst:4996 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4953 +#: ../../library/stdtypes.rst:4998 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4954 +#: ../../library/stdtypes.rst:4999 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4957 +#: ../../library/stdtypes.rst:5002 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it defines a ``keys()`` method, a " @@ -7114,7 +7180,7 @@ msgid "" "that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4967 +#: ../../library/stdtypes.rst:5012 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -7122,13 +7188,13 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4972 ../../library/stdtypes.rst:4990 +#: ../../library/stdtypes.rst:5017 ../../library/stdtypes.rst:5035 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:5020 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -7137,7 +7203,7 @@ msgid "" "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:5026 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -7157,13 +7223,13 @@ msgstr "" ">>> a == b == c == d == e == f\n" "True" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:5038 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:5041 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7195,33 +7261,33 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5056 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5060 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:5020 +#: ../../library/stdtypes.rst:5065 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5024 +#: ../../library/stdtypes.rst:5069 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5028 +#: ../../library/stdtypes.rst:5073 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:5033 +#: ../../library/stdtypes.rst:5078 msgid "" "If a subclass of dict defines a method :meth:`~object.__missing__` and *key* " "is not present, the ``d[key]`` operation calls that method with the key " @@ -7232,7 +7298,7 @@ msgid "" "__missing__` must be a method; it cannot be an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:5041 +#: ../../library/stdtypes.rst:5086 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -7256,51 +7322,51 @@ msgstr "" ">>> c['red']\n" "1" -#: ../../library/stdtypes.rst:5052 +#: ../../library/stdtypes.rst:5097 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different :meth:`!__missing__` method is used by :class:" "`collections.defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:5059 +#: ../../library/stdtypes.rst:5104 msgid "Set ``d[key]`` to *value*." msgstr "將 ``d[key]`` 設為 *value*。" -#: ../../library/stdtypes.rst:5063 +#: ../../library/stdtypes.rst:5108 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "從 *d* 中移除 ``d[key]``。若 *key* 不在對映中則引發 :exc:`KeyError`。" -#: ../../library/stdtypes.rst:5068 +#: ../../library/stdtypes.rst:5113 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "若 *d* 有鍵 *key* 則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/stdtypes.rst:5072 +#: ../../library/stdtypes.rst:5117 msgid "Equivalent to ``not key in d``." msgstr "等價於 ``not key in d``。" -#: ../../library/stdtypes.rst:5076 +#: ../../library/stdtypes.rst:5121 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:5126 msgid "Remove all items from the dictionary." msgstr "從字典中移除所有項目。" -#: ../../library/stdtypes.rst:5085 +#: ../../library/stdtypes.rst:5130 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5089 +#: ../../library/stdtypes.rst:5134 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:5091 +#: ../../library/stdtypes.rst:5136 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -7309,70 +7375,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:5099 +#: ../../library/stdtypes.rst:5144 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " "raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:5105 +#: ../../library/stdtypes.rst:5150 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5110 +#: ../../library/stdtypes.rst:5155 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:5116 +#: ../../library/stdtypes.rst:5161 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" "exc:`KeyError` is raised." msgstr "" -#: ../../library/stdtypes.rst:5122 +#: ../../library/stdtypes.rst:5167 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -#: ../../library/stdtypes.rst:5125 +#: ../../library/stdtypes.rst:5170 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" "`popitem` raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:5129 +#: ../../library/stdtypes.rst:5174 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:5135 +#: ../../library/stdtypes.rst:5180 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5142 +#: ../../library/stdtypes.rst:5187 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" -#: ../../library/stdtypes.rst:5150 +#: ../../library/stdtypes.rst:5195 msgid "" "Update the dictionary with the key/value pairs from *mapping* or *iterable* " "and *kwargs*, overwriting existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:5153 +#: ../../library/stdtypes.rst:5198 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -7381,20 +7447,20 @@ msgid "" "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:5161 +#: ../../library/stdtypes.rst:5206 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5164 +#: ../../library/stdtypes.rst:5209 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:5168 +#: ../../library/stdtypes.rst:5213 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -7404,25 +7470,25 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:5174 +#: ../../library/stdtypes.rst:5219 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:5182 +#: ../../library/stdtypes.rst:5227 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:5188 +#: ../../library/stdtypes.rst:5233 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:5190 +#: ../../library/stdtypes.rst:5235 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7444,21 +7510,21 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:5200 +#: ../../library/stdtypes.rst:5245 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5205 +#: ../../library/stdtypes.rst:5250 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:5212 +#: ../../library/stdtypes.rst:5257 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:5214 +#: ../../library/stdtypes.rst:5259 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -7466,23 +7532,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:5219 +#: ../../library/stdtypes.rst:5264 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:5224 +#: ../../library/stdtypes.rst:5269 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5228 +#: ../../library/stdtypes.rst:5273 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5231 +#: ../../library/stdtypes.rst:5276 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -7490,39 +7556,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:5236 +#: ../../library/stdtypes.rst:5281 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:5239 +#: ../../library/stdtypes.rst:5284 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:5244 +#: ../../library/stdtypes.rst:5289 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:5249 +#: ../../library/stdtypes.rst:5294 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:5252 +#: ../../library/stdtypes.rst:5297 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5257 +#: ../../library/stdtypes.rst:5302 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:5262 +#: ../../library/stdtypes.rst:5307 msgid "" "Keys views are set-like since their entries are unique and :term:`hashable`. " "Items views also have set-like operations since the (key, value) pairs are " @@ -7536,11 +7602,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:5274 +#: ../../library/stdtypes.rst:5319 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:5276 +#: ../../library/stdtypes.rst:5321 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -7581,11 +7647,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:5318 +#: ../../library/stdtypes.rst:5363 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:5325 +#: ../../library/stdtypes.rst:5370 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -7596,7 +7662,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:5333 +#: ../../library/stdtypes.rst:5378 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -7607,7 +7673,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:5338 +#: ../../library/stdtypes.rst:5383 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -7616,7 +7682,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:5342 +#: ../../library/stdtypes.rst:5387 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -7630,7 +7696,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的目前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:5352 +#: ../../library/stdtypes.rst:5397 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -7642,7 +7708,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:5357 +#: ../../library/stdtypes.rst:5402 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -7657,7 +7723,7 @@ msgstr "" "(propagate)。執行此方法期間發生的例外會取代 :keyword:`!with` 陳述式主體中發生" "的任何例外。" -#: ../../library/stdtypes.rst:5364 +#: ../../library/stdtypes.rst:5409 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -7669,7 +7735,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:5370 +#: ../../library/stdtypes.rst:5415 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -7681,7 +7747,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:5376 +#: ../../library/stdtypes.rst:5421 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -7696,7 +7762,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:5383 +#: ../../library/stdtypes.rst:5428 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -7708,7 +7774,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:5391 +#: ../../library/stdtypes.rst:5436 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -7716,7 +7782,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" "ref:`聯合 (Union) `" -#: ../../library/stdtypes.rst:5396 +#: ../../library/stdtypes.rst:5441 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -7724,11 +7790,11 @@ msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" -#: ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:5448 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:5409 +#: ../../library/stdtypes.rst:5454 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -7744,7 +7810,7 @@ msgstr "" "立的。``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使" "用。" -#: ../../library/stdtypes.rst:5419 +#: ../../library/stdtypes.rst:5464 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -7752,7 +7818,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:5422 +#: ../../library/stdtypes.rst:5467 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -7760,7 +7826,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:5425 +#: ../../library/stdtypes.rst:5470 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -7772,7 +7838,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:5431 +#: ../../library/stdtypes.rst:5476 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -7784,7 +7850,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 `\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:5437 +#: ../../library/stdtypes.rst:5482 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -7796,7 +7862,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:5443 +#: ../../library/stdtypes.rst:5488 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -7809,7 +7875,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match ` 物件。" -#: ../../library/stdtypes.rst:5449 +#: ../../library/stdtypes.rst:5494 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -7818,7 +7884,7 @@ msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" -#: ../../library/stdtypes.rst:5455 +#: ../../library/stdtypes.rst:5500 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -7828,7 +7894,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:5460 +#: ../../library/stdtypes.rst:5505 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -7836,7 +7902,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:5463 +#: ../../library/stdtypes.rst:5508 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -7847,7 +7913,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:5468 +#: ../../library/stdtypes.rst:5513 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -7855,7 +7921,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:5471 +#: ../../library/stdtypes.rst:5516 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -7863,7 +7929,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5519 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -7875,7 +7941,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:5479 +#: ../../library/stdtypes.rst:5524 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -7887,7 +7953,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:5485 +#: ../../library/stdtypes.rst:5530 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -7897,13 +7963,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:5489 +#: ../../library/stdtypes.rst:5534 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5492 +#: ../../library/stdtypes.rst:5537 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -7921,13 +7987,13 @@ msgstr "" ">>> type(l)\n" "" -#: ../../library/stdtypes.rst:5500 +#: ../../library/stdtypes.rst:5545 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5502 +#: ../../library/stdtypes.rst:5547 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -7941,7 +8007,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5508 +#: ../../library/stdtypes.rst:5553 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -7949,7 +8015,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5511 +#: ../../library/stdtypes.rst:5556 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -7961,7 +8027,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5516 +#: ../../library/stdtypes.rst:5561 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -7971,7 +8037,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5520 +#: ../../library/stdtypes.rst:5565 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -7983,253 +8049,253 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5527 +#: ../../library/stdtypes.rst:5572 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5529 +#: ../../library/stdtypes.rst:5574 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5532 +#: ../../library/stdtypes.rst:5577 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5533 +#: ../../library/stdtypes.rst:5578 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5534 +#: ../../library/stdtypes.rst:5579 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5535 +#: ../../library/stdtypes.rst:5580 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5536 +#: ../../library/stdtypes.rst:5581 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5537 +#: ../../library/stdtypes.rst:5582 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5538 +#: ../../library/stdtypes.rst:5583 msgid ":class:`asyncio.Future`" msgstr ":class:`asyncio.Future`" -#: ../../library/stdtypes.rst:5539 +#: ../../library/stdtypes.rst:5584 msgid ":class:`asyncio.Task`" msgstr ":class:`asyncio.Task`" -#: ../../library/stdtypes.rst:5540 +#: ../../library/stdtypes.rst:5585 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5541 +#: ../../library/stdtypes.rst:5586 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5542 +#: ../../library/stdtypes.rst:5587 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5543 +#: ../../library/stdtypes.rst:5588 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5589 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5545 +#: ../../library/stdtypes.rst:5590 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5546 +#: ../../library/stdtypes.rst:5591 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5547 +#: ../../library/stdtypes.rst:5592 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5548 +#: ../../library/stdtypes.rst:5593 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5594 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5550 +#: ../../library/stdtypes.rst:5595 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5596 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5597 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5598 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5554 +#: ../../library/stdtypes.rst:5599 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5555 +#: ../../library/stdtypes.rst:5600 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5556 +#: ../../library/stdtypes.rst:5601 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5557 +#: ../../library/stdtypes.rst:5602 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5558 +#: ../../library/stdtypes.rst:5603 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5559 +#: ../../library/stdtypes.rst:5604 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5560 +#: ../../library/stdtypes.rst:5605 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5561 +#: ../../library/stdtypes.rst:5606 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5562 +#: ../../library/stdtypes.rst:5607 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5563 +#: ../../library/stdtypes.rst:5608 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5564 +#: ../../library/stdtypes.rst:5609 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5565 +#: ../../library/stdtypes.rst:5610 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5566 +#: ../../library/stdtypes.rst:5611 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5612 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5568 +#: ../../library/stdtypes.rst:5613 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5569 +#: ../../library/stdtypes.rst:5614 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5570 +#: ../../library/stdtypes.rst:5615 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5571 +#: ../../library/stdtypes.rst:5616 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5572 +#: ../../library/stdtypes.rst:5617 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5573 +#: ../../library/stdtypes.rst:5618 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5574 +#: ../../library/stdtypes.rst:5619 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5575 +#: ../../library/stdtypes.rst:5620 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5621 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5577 +#: ../../library/stdtypes.rst:5622 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5578 +#: ../../library/stdtypes.rst:5623 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5579 +#: ../../library/stdtypes.rst:5624 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5580 +#: ../../library/stdtypes.rst:5625 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5581 +#: ../../library/stdtypes.rst:5626 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5627 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5583 +#: ../../library/stdtypes.rst:5628 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5584 +#: ../../library/stdtypes.rst:5629 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5585 +#: ../../library/stdtypes.rst:5630 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5586 +#: ../../library/stdtypes.rst:5631 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5587 +#: ../../library/stdtypes.rst:5632 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5592 +#: ../../library/stdtypes.rst:5637 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5594 +#: ../../library/stdtypes.rst:5639 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5598 +#: ../../library/stdtypes.rst:5643 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5600 +#: ../../library/stdtypes.rst:5645 msgid "" ">>> list[int].__origin__\n" "" @@ -8237,7 +8303,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5606 +#: ../../library/stdtypes.rst:5651 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " @@ -8246,7 +8312,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5610 +#: ../../library/stdtypes.rst:5655 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -8254,7 +8320,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5616 +#: ../../library/stdtypes.rst:5661 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -8262,7 +8328,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5619 +#: ../../library/stdtypes.rst:5664 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -8276,7 +8342,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5627 +#: ../../library/stdtypes.rst:5672 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -8286,7 +8352,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5634 +#: ../../library/stdtypes.rst:5679 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -8294,19 +8360,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5642 +#: ../../library/stdtypes.rst:5687 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5643 +#: ../../library/stdtypes.rst:5688 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5645 +#: ../../library/stdtypes.rst:5690 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5646 +#: ../../library/stdtypes.rst:5691 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -8315,7 +8381,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5650 +#: ../../library/stdtypes.rst:5695 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -8323,18 +8389,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:5651 +#: ../../library/stdtypes.rst:5696 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" "有關如何實作可以在 runtime 參數化並能被靜態型別檢查器理解的泛型類別的文件。" -#: ../../library/stdtypes.rst:5660 +#: ../../library/stdtypes.rst:5705 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5666 +#: ../../library/stdtypes.rst:5711 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -8347,7 +8413,7 @@ msgstr "" "釋 (type annotation) `。與下標 :data:`typing.Union` 相比,聯合型" "別運算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5673 +#: ../../library/stdtypes.rst:5718 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -8358,7 +8424,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5678 +#: ../../library/stdtypes.rst:5723 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -8366,7 +8432,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:5683 +#: ../../library/stdtypes.rst:5728 msgid "" "The ``|`` operand cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -8379,40 +8445,40 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:5691 +#: ../../library/stdtypes.rst:5736 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:5693 +#: ../../library/stdtypes.rst:5738 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:5695 +#: ../../library/stdtypes.rst:5740 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:5697 +#: ../../library/stdtypes.rst:5742 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:5699 +#: ../../library/stdtypes.rst:5744 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:5701 +#: ../../library/stdtypes.rst:5746 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:5703 +#: ../../library/stdtypes.rst:5748 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:5705 +#: ../../library/stdtypes.rst:5750 msgid "It creates instances of :class:`typing.Union`::" msgstr "它會建立 :class:`types.UnionType` 的實例: ::" -#: ../../library/stdtypes.rst:5707 +#: ../../library/stdtypes.rst:5752 msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" @@ -8420,21 +8486,21 @@ msgstr "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" -#: ../../library/stdtypes.rst:5710 +#: ../../library/stdtypes.rst:5755 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:5712 +#: ../../library/stdtypes.rst:5757 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:5717 +#: ../../library/stdtypes.rst:5762 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:5720 +#: ../../library/stdtypes.rst:5765 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -8442,14 +8508,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:5723 +#: ../../library/stdtypes.rst:5768 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:5726 +#: ../../library/stdtypes.rst:5771 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -8459,7 +8525,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:5733 +#: ../../library/stdtypes.rst:5778 msgid "" "The user-exposed type for the union object can be accessed from :class:" "`typing.Union` and used for :func:`isinstance` checks::" @@ -8467,7 +8533,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`types." "UnionType` 存取並用於 :func:`isinstance` 檢查: ::" -#: ../../library/stdtypes.rst:5736 +#: ../../library/stdtypes.rst:5781 msgid "" ">>> import typing\n" ">>> isinstance(int | str, typing.Union)\n" @@ -8485,7 +8551,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" -#: ../../library/stdtypes.rst:5745 +#: ../../library/stdtypes.rst:5790 msgid "" "The :meth:`!__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`!__or__`, the Union may " @@ -8494,7 +8560,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:5749 +#: ../../library/stdtypes.rst:5794 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -8520,32 +8586,32 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:5765 +#: ../../library/stdtypes.rst:5810 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:5771 +#: ../../library/stdtypes.rst:5816 msgid "" "Union objects are now instances of :class:`typing.Union`. Previously, they " "were instances of :class:`types.UnionType`, which remains an alias for :" "class:`typing.Union`." msgstr "" -#: ../../library/stdtypes.rst:5778 +#: ../../library/stdtypes.rst:5823 msgid "Other Built-in Types" msgstr "其他內建型別" -#: ../../library/stdtypes.rst:5780 +#: ../../library/stdtypes.rst:5825 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5787 +#: ../../library/stdtypes.rst:5832 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5789 +#: ../../library/stdtypes.rst:5834 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -8556,7 +8622,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5796 +#: ../../library/stdtypes.rst:5841 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -8567,32 +8633,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5804 +#: ../../library/stdtypes.rst:5849 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5812 +#: ../../library/stdtypes.rst:5857 msgid "Classes and Class Instances" msgstr "類別與類別實例" -#: ../../library/stdtypes.rst:5814 +#: ../../library/stdtypes.rst:5859 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "請見 :ref:`objects` 和 :ref:`class`。" -#: ../../library/stdtypes.rst:5820 +#: ../../library/stdtypes.rst:5865 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5822 +#: ../../library/stdtypes.rst:5867 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:5825 +#: ../../library/stdtypes.rst:5870 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -8600,15 +8666,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5829 +#: ../../library/stdtypes.rst:5874 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:5835 +#: ../../library/stdtypes.rst:5880 msgid "Methods" msgstr "方法" -#: ../../library/stdtypes.rst:5839 +#: ../../library/stdtypes.rst:5884 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -8616,7 +8682,7 @@ msgid "" "methods>`. Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:5845 +#: ../../library/stdtypes.rst:5890 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :ref:" @@ -8629,7 +8695,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5856 +#: ../../library/stdtypes.rst:5901 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -8640,7 +8706,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:5864 +#: ../../library/stdtypes.rst:5909 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -8668,15 +8734,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:5879 +#: ../../library/stdtypes.rst:5924 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:5887 +#: ../../library/stdtypes.rst:5932 msgid "Code Objects" msgstr "程式碼物件" -#: ../../library/stdtypes.rst:5893 +#: ../../library/stdtypes.rst:5938 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -8686,7 +8752,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5900 +#: ../../library/stdtypes.rst:5945 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -8695,21 +8761,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:5907 +#: ../../library/stdtypes.rst:5952 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5910 +#: ../../library/stdtypes.rst:5955 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:5916 +#: ../../library/stdtypes.rst:5961 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5922 +#: ../../library/stdtypes.rst:5967 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -8717,30 +8783,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5927 +#: ../../library/stdtypes.rst:5972 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5933 +#: ../../library/stdtypes.rst:5978 msgid "The Null Object" msgstr "Null 物件" -#: ../../library/stdtypes.rst:5935 +#: ../../library/stdtypes.rst:5980 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5939 +#: ../../library/stdtypes.rst:5984 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:5946 +#: ../../library/stdtypes.rst:5991 msgid "The Ellipsis Object" msgstr "Ellipsis 物件" -#: ../../library/stdtypes.rst:5948 +#: ../../library/stdtypes.rst:5993 msgid "" "This object is commonly used to indicate that something is omitted. It " "supports no special operations. There is exactly one ellipsis object, " @@ -8748,63 +8814,63 @@ msgid "" "the :const:`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5953 +#: ../../library/stdtypes.rst:5998 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:5955 +#: ../../library/stdtypes.rst:6000 msgid "" "In typical use, ``...`` as the ``Ellipsis`` object appears in a few " "different places, for instance:" msgstr "" -#: ../../library/stdtypes.rst:5958 +#: ../../library/stdtypes.rst:6003 msgid "" "In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." msgstr "" -#: ../../library/stdtypes.rst:5961 +#: ../../library/stdtypes.rst:6006 msgid "" "As the body of a function instead of a :ref:`pass statement `." msgstr "" -#: ../../library/stdtypes.rst:5963 +#: ../../library/stdtypes.rst:6008 msgid "" "In third-party libraries, such as `Numpy's slicing and striding `_." msgstr "" -#: ../../library/stdtypes.rst:5966 +#: ../../library/stdtypes.rst:6011 msgid "" "Python also uses three dots in ways that are not ``Ellipsis`` objects, for " "instance:" msgstr "" -#: ../../library/stdtypes.rst:5968 +#: ../../library/stdtypes.rst:6013 msgid "" "Doctest's :const:`ELLIPSIS `, as a pattern for missing " "content." msgstr "" -#: ../../library/stdtypes.rst:5970 +#: ../../library/stdtypes.rst:6015 msgid "" "The default Python prompt of the :term:`interactive` shell when partial " "input is incomplete." msgstr "" -#: ../../library/stdtypes.rst:5972 +#: ../../library/stdtypes.rst:6017 msgid "" "Lastly, the Python documentation often uses three dots in conventional " "English usage to mean omitted content, even in code examples that also use " "them as the ``Ellipsis``." msgstr "" -#: ../../library/stdtypes.rst:5980 +#: ../../library/stdtypes.rst:6025 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:5982 +#: ../../library/stdtypes.rst:6027 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -8812,64 +8878,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5987 +#: ../../library/stdtypes.rst:6032 msgid "It is written as :code:`NotImplemented`." msgstr "它被寫為 :code:`NotImplemented`。" -#: ../../library/stdtypes.rst:5993 +#: ../../library/stdtypes.rst:6038 msgid "Internal Objects" msgstr "內部物件" -#: ../../library/stdtypes.rst:5995 +#: ../../library/stdtypes.rst:6040 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:6003 +#: ../../library/stdtypes.rst:6048 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:6005 +#: ../../library/stdtypes.rst:6050 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:6012 +#: ../../library/stdtypes.rst:6057 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:6018 +#: ../../library/stdtypes.rst:6063 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:6026 +#: ../../library/stdtypes.rst:6071 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:6031 +#: ../../library/stdtypes.rst:6076 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:6036 +#: ../../library/stdtypes.rst:6081 msgid "" "The :ref:`type parameters ` of generic classes, functions, and :" "ref:`type aliases `. For classes and functions that are not " "generic, this will be an empty tuple." msgstr "" -#: ../../library/stdtypes.rst:6046 +#: ../../library/stdtypes.rst:6091 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:6048 +#: ../../library/stdtypes.rst:6093 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -8877,7 +8943,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:6053 +#: ../../library/stdtypes.rst:6098 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -8887,24 +8953,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:6060 +#: ../../library/stdtypes.rst:6105 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:6062 +#: ../../library/stdtypes.rst:6107 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:6066 +#: ../../library/stdtypes.rst:6111 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:6068 +#: ../../library/stdtypes.rst:6113 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -8928,7 +8994,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:6088 +#: ../../library/stdtypes.rst:6133 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -8936,11 +9002,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:6093 +#: ../../library/stdtypes.rst:6138 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:6095 +#: ../../library/stdtypes.rst:6140 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -8958,84 +9024,84 @@ msgstr "" "... '571186405732').to_bytes(53, 'big')\n" "..." -#: ../../library/stdtypes.rst:6108 +#: ../../library/stdtypes.rst:6153 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:6110 +#: ../../library/stdtypes.rst:6155 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:6113 +#: ../../library/stdtypes.rst:6158 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:6114 +#: ../../library/stdtypes.rst:6159 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:6115 +#: ../../library/stdtypes.rst:6160 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:6116 +#: ../../library/stdtypes.rst:6161 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:6117 +#: ../../library/stdtypes.rst:6162 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:6120 +#: ../../library/stdtypes.rst:6165 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:6122 +#: ../../library/stdtypes.rst:6167 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:6123 +#: ../../library/stdtypes.rst:6168 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:6124 +#: ../../library/stdtypes.rst:6169 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:6125 +#: ../../library/stdtypes.rst:6170 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:6126 +#: ../../library/stdtypes.rst:6171 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:6127 +#: ../../library/stdtypes.rst:6172 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:6130 +#: ../../library/stdtypes.rst:6175 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:6132 +#: ../../library/stdtypes.rst:6177 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:6135 +#: ../../library/stdtypes.rst:6180 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:6138 +#: ../../library/stdtypes.rst:6183 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -9043,7 +9109,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:6140 +#: ../../library/stdtypes.rst:6185 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -9052,38 +9118,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:6146 +#: ../../library/stdtypes.rst:6191 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:6149 +#: ../../library/stdtypes.rst:6194 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:6153 +#: ../../library/stdtypes.rst:6198 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:6155 +#: ../../library/stdtypes.rst:6200 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:6157 +#: ../../library/stdtypes.rst:6202 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:6164 +#: ../../library/stdtypes.rst:6209 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -9095,7 +9161,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:6173 +#: ../../library/stdtypes.rst:6218 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -9103,11 +9169,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:6179 +#: ../../library/stdtypes.rst:6224 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:6181 +#: ../../library/stdtypes.rst:6226 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -9115,11 +9181,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:6186 +#: ../../library/stdtypes.rst:6231 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:6188 +#: ../../library/stdtypes.rst:6233 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -9141,38 +9207,38 @@ msgstr "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" -#: ../../library/stdtypes.rst:6198 +#: ../../library/stdtypes.rst:6243 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:6202 +#: ../../library/stdtypes.rst:6247 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:6203 +#: ../../library/stdtypes.rst:6248 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:6206 +#: ../../library/stdtypes.rst:6251 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:6209 +#: ../../library/stdtypes.rst:6254 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:6211 +#: ../../library/stdtypes.rst:6256 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:6214 +#: ../../library/stdtypes.rst:6259 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -9185,13 +9251,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:322 #: ../../library/stdtypes.rst:399 ../../library/stdtypes.rst:992 #: ../../library/stdtypes.rst:1179 ../../library/stdtypes.rst:1201 -#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4921 -#: ../../library/stdtypes.rst:5918 +#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:5963 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1216 -#: ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:4966 msgid "statement" msgstr "statement(陳述式)" @@ -9313,11 +9379,11 @@ msgstr "is not" #: ../../library/stdtypes.rst:1201 ../../library/stdtypes.rst:1366 #: ../../library/stdtypes.rst:1445 ../../library/stdtypes.rst:1489 #: ../../library/stdtypes.rst:1610 ../../library/stdtypes.rst:1740 -#: ../../library/stdtypes.rst:2950 ../../library/stdtypes.rst:2969 -#: ../../library/stdtypes.rst:3082 ../../library/stdtypes.rst:4718 -#: ../../library/stdtypes.rst:4921 ../../library/stdtypes.rst:5405 -#: ../../library/stdtypes.rst:5662 ../../library/stdtypes.rst:5837 -#: ../../library/stdtypes.rst:5882 +#: ../../library/stdtypes.rst:2995 ../../library/stdtypes.rst:3014 +#: ../../library/stdtypes.rst:3127 ../../library/stdtypes.rst:4763 +#: ../../library/stdtypes.rst:4966 ../../library/stdtypes.rst:5450 +#: ../../library/stdtypes.rst:5707 ../../library/stdtypes.rst:5882 +#: ../../library/stdtypes.rst:5927 msgid "object" msgstr "object(物件)" @@ -9409,9 +9475,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:992 -#: ../../library/stdtypes.rst:1179 ../../library/stdtypes.rst:4921 -#: ../../library/stdtypes.rst:5889 ../../library/stdtypes.rst:5903 -#: ../../library/stdtypes.rst:5918 +#: ../../library/stdtypes.rst:1179 ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:5934 ../../library/stdtypes.rst:5948 +#: ../../library/stdtypes.rst:5963 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -9427,8 +9493,8 @@ msgstr "float" msgid "complex" msgstr "complex(複數)" -#: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:2826 -#: ../../library/stdtypes.rst:4086 +#: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:2871 +#: ../../library/stdtypes.rst:4131 msgid "+ (plus)" msgstr "+ (加號)" @@ -9440,13 +9506,13 @@ msgstr "unary operator(一元運算子)" msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:2826 -#: ../../library/stdtypes.rst:4086 +#: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:2871 +#: ../../library/stdtypes.rst:4131 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:2783 -#: ../../library/stdtypes.rst:4043 +#: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:2828 +#: ../../library/stdtypes.rst:4088 msgid "* (asterisk)" msgstr "* (星號)" @@ -9458,8 +9524,8 @@ msgstr "/ (斜線)" msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:2746 -#: ../../library/stdtypes.rst:4011 +#: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:2791 +#: ../../library/stdtypes.rst:4056 msgid "% (percent)" msgstr "% (百分號)" @@ -9469,7 +9535,7 @@ msgstr "**" #: ../../library/stdtypes.rst:322 ../../library/stdtypes.rst:399 #: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:1216 -#: ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:4966 msgid "operations on" msgstr "operations on(操作於)" @@ -9478,7 +9544,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:341 ../../library/stdtypes.rst:1808 -#: ../../library/stdtypes.rst:2950 ../../library/stdtypes.rst:5918 +#: ../../library/stdtypes.rst:2995 ../../library/stdtypes.rst:5963 msgid "module" msgstr "模組" @@ -9546,7 +9612,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:889 ../../library/stdtypes.rst:5320 +#: ../../library/stdtypes.rst:889 ../../library/stdtypes.rst:5365 msgid "protocol" msgstr "protocol(協定)" @@ -9572,7 +9638,7 @@ msgstr "container(容器)" msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:4966 msgid "len" msgstr "len" @@ -9641,14 +9707,14 @@ msgstr "mutable(可變)" msgid "list" msgstr "list(串列)" -#: ../../library/stdtypes.rst:1201 ../../library/stdtypes.rst:2950 -#: ../../library/stdtypes.rst:3082 ../../library/stdtypes.rst:3192 -#: ../../library/stdtypes.rst:4011 +#: ../../library/stdtypes.rst:1201 ../../library/stdtypes.rst:2995 +#: ../../library/stdtypes.rst:3127 ../../library/stdtypes.rst:3237 +#: ../../library/stdtypes.rst:4056 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4921 -#: ../../library/stdtypes.rst:5662 ../../library/stdtypes.rst:5918 +#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:5707 ../../library/stdtypes.rst:5963 msgid "type" msgstr "type(型別)" @@ -9656,7 +9722,7 @@ msgstr "type(型別)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4966 msgid "del" msgstr "del" @@ -9665,8 +9731,8 @@ msgid "range" msgstr "range" #: ../../library/stdtypes.rst:1610 ../../library/stdtypes.rst:1753 -#: ../../library/stdtypes.rst:1800 ../../library/stdtypes.rst:2600 -#: ../../library/stdtypes.rst:2746 +#: ../../library/stdtypes.rst:1800 ../../library/stdtypes.rst:2645 +#: ../../library/stdtypes.rst:2791 msgid "string" msgstr "string(字串)" @@ -9687,17 +9753,17 @@ msgstr "(亦請見 string)" msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1773 ../../library/stdtypes.rst:2942 +#: ../../library/stdtypes.rst:1773 ../../library/stdtypes.rst:2987 msgid "buffer protocol" msgstr "buffer protocol(緩衝區協定)" -#: ../../library/stdtypes.rst:1773 ../../library/stdtypes.rst:2950 -#: ../../library/stdtypes.rst:2969 ../../library/stdtypes.rst:3192 -#: ../../library/stdtypes.rst:4011 +#: ../../library/stdtypes.rst:1773 ../../library/stdtypes.rst:2995 +#: ../../library/stdtypes.rst:3014 ../../library/stdtypes.rst:3237 +#: ../../library/stdtypes.rst:4056 msgid "bytes" msgstr "bytes(位元組)" -#: ../../library/stdtypes.rst:1800 ../../library/stdtypes.rst:3192 +#: ../../library/stdtypes.rst:1800 ../../library/stdtypes.rst:3237 msgid "methods" msgstr "methods(方法)" @@ -9705,239 +9771,239 @@ msgstr "methods(方法)" msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2412 ../../library/stdtypes.rst:3865 +#: ../../library/stdtypes.rst:2457 ../../library/stdtypes.rst:3910 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/stdtypes.rst:2412 +#: ../../library/stdtypes.rst:2457 msgid "str.splitlines method" msgstr "str.splitlines 方法" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "! formatted string literal" msgstr "! formatted string literals(! 格式化字串常數)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "formatted string literals" msgstr "formatted string literals(格式化字串常數)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "! f-string" msgstr "! f-string(! f 字串)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "! (exclamation mark)" msgstr "! (驚嘆號)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "= (equals)" msgstr "= (等號)" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2645 msgid "for help in debugging using string literals" msgstr "" -#: ../../library/stdtypes.rst:2746 +#: ../../library/stdtypes.rst:2791 msgid "formatting, string (%)" msgstr "formatting(格式化)、字串 (%)" -#: ../../library/stdtypes.rst:2746 +#: ../../library/stdtypes.rst:2791 msgid "interpolation, string (%)" msgstr "interpolation(插值)、字串 (%)" -#: ../../library/stdtypes.rst:2746 +#: ../../library/stdtypes.rst:2791 msgid "formatting, printf" msgstr "formatting(格式化)、printf" -#: ../../library/stdtypes.rst:2746 +#: ../../library/stdtypes.rst:2791 msgid "interpolation, printf" msgstr "interpolation(插值)、printf" -#: ../../library/stdtypes.rst:2746 ../../library/stdtypes.rst:4011 +#: ../../library/stdtypes.rst:2791 ../../library/stdtypes.rst:4056 msgid "printf-style formatting" msgstr "printf 風格格式化" -#: ../../library/stdtypes.rst:2746 ../../library/stdtypes.rst:4011 +#: ../../library/stdtypes.rst:2791 ../../library/stdtypes.rst:4056 msgid "sprintf-style formatting" msgstr "sprintf 風格格式化" -#: ../../library/stdtypes.rst:2783 ../../library/stdtypes.rst:4043 +#: ../../library/stdtypes.rst:2828 ../../library/stdtypes.rst:4088 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/stdtypes.rst:2783 ../../library/stdtypes.rst:2826 -#: ../../library/stdtypes.rst:4043 ../../library/stdtypes.rst:4086 +#: ../../library/stdtypes.rst:2828 ../../library/stdtypes.rst:2871 +#: ../../library/stdtypes.rst:4088 ../../library/stdtypes.rst:4131 msgid "in printf-style formatting" msgstr "於 printf 風格格式化" -#: ../../library/stdtypes.rst:2783 ../../library/stdtypes.rst:4043 +#: ../../library/stdtypes.rst:2828 ../../library/stdtypes.rst:4088 msgid ". (dot)" msgstr ". (點)" -#: ../../library/stdtypes.rst:2826 ../../library/stdtypes.rst:4086 +#: ../../library/stdtypes.rst:2871 ../../library/stdtypes.rst:4131 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/stdtypes.rst:2826 ../../library/stdtypes.rst:4086 +#: ../../library/stdtypes.rst:2871 ../../library/stdtypes.rst:4131 msgid "space" msgstr "space(空白)" -#: ../../library/stdtypes.rst:2942 +#: ../../library/stdtypes.rst:2987 msgid "binary sequence types" msgstr "binary sequence types(二進位序列型別)" -#: ../../library/stdtypes.rst:2950 +#: ../../library/stdtypes.rst:2995 msgid "memoryview" msgstr "memoryview(記憶體視圖)" -#: ../../library/stdtypes.rst:2950 +#: ../../library/stdtypes.rst:2995 msgid "array" msgstr "array(陣列)" -#: ../../library/stdtypes.rst:3865 +#: ../../library/stdtypes.rst:3910 msgid "bytes.splitlines method" msgstr "bytes.splitlines 方法" -#: ../../library/stdtypes.rst:3865 +#: ../../library/stdtypes.rst:3910 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines 方法" -#: ../../library/stdtypes.rst:4011 +#: ../../library/stdtypes.rst:4056 msgid "formatting" msgstr "formatting(格式化)" -#: ../../library/stdtypes.rst:4011 +#: ../../library/stdtypes.rst:4056 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:4011 +#: ../../library/stdtypes.rst:4056 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:4011 +#: ../../library/stdtypes.rst:4056 msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:4718 +#: ../../library/stdtypes.rst:4763 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:4966 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:4921 +#: ../../library/stdtypes.rst:4966 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:5031 +#: ../../library/stdtypes.rst:5076 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:5320 +#: ../../library/stdtypes.rst:5365 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:5320 +#: ../../library/stdtypes.rst:5365 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:5320 +#: ../../library/stdtypes.rst:5365 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:5393 +#: ../../library/stdtypes.rst:5438 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:5393 +#: ../../library/stdtypes.rst:5438 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:5405 +#: ../../library/stdtypes.rst:5450 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:5405 +#: ../../library/stdtypes.rst:5450 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:5405 +#: ../../library/stdtypes.rst:5450 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5662 +#: ../../library/stdtypes.rst:5707 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5662 +#: ../../library/stdtypes.rst:5707 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5837 +#: ../../library/stdtypes.rst:5882 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5882 +#: ../../library/stdtypes.rst:5927 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5882 +#: ../../library/stdtypes.rst:5927 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5889 +#: ../../library/stdtypes.rst:5934 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5889 +#: ../../library/stdtypes.rst:5934 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:5903 +#: ../../library/stdtypes.rst:5948 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5903 +#: ../../library/stdtypes.rst:5948 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5942 +#: ../../library/stdtypes.rst:5987 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5942 +#: ../../library/stdtypes.rst:5987 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號字面值)" From 2f329b56db64fea30c6960446f2202528cf8cb4b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 26 Nov 2025 00:16:12 +0000 Subject: [PATCH 05/13] sync with cpython 20a677d7 --- c-api/conversion.po | 78 ++- c-api/exceptions.po | 226 +++---- c-api/init.po | 743 +++++++++++++++------- howto/a-conceptual-overview-of-asyncio.po | 122 ++-- whatsnew/3.14.po | 93 ++- 5 files changed, 821 insertions(+), 441 deletions(-) diff --git a/c-api/conversion.po b/c-api/conversion.po index 0810043636..6d62c65920 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2025-11-26 00:14+0000\n" "PO-Revision-Date: 2023-12-11 18:26+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -291,72 +291,106 @@ msgstr "" "回傳值是指向 *buffer* 的指標,其中包含轉換後的字串,如果轉換失敗則回傳 " "``NULL``。呼叫者負責透過呼叫 :c:func:`PyMem_Free` 來釋放回傳的字串。" -#: ../../c-api/conversion.rst:167 +#: ../../c-api/conversion.rst:168 +#, fuzzy msgid "" -"Case insensitive comparison of strings. The function works almost " -"identically to :c:func:`!strcmp` except that it ignores the case." +"Case insensitive comparison of strings. These functions work almost " +"identically to :c:func:`!strcmp` and :c:func:`!strncmp` (respectively), " +"except that they ignore the case of ASCII characters." msgstr "" -"不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strcmp` 相同,只是它忽" -"略大小寫。" +"不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strncmp` 相同,只是它" +"忽略大小寫。" -#: ../../c-api/conversion.rst:173 +#: ../../c-api/conversion.rst:172 msgid "" -"Case insensitive comparison of strings. The function works almost " -"identically to :c:func:`!strncmp` except that it ignores the case." +"Return ``0`` if the strings are equal, a negative value if *str1* sorts " +"lexicographically before *str2*, or a positive value if it sorts after." +msgstr "" + +#: ../../c-api/conversion.rst:175 +msgid "" +"In the *str1* or *str2* arguments, a NUL byte marks the end of the string. " +"For :c:func:`!PyOS_mystrnicmp`, the *size* argument gives the maximum size " +"of the string, as if NUL was present at the index given by *size*." msgstr "" -"不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strncmp` 相同,只是它" -"忽略大小寫。" -#: ../../c-api/conversion.rst:178 +#: ../../c-api/conversion.rst:179 +msgid "These functions do not use the locale." +msgstr "" + +#: ../../c-api/conversion.rst:185 +msgid "Case insensitive comparison of strings." +msgstr "" + +#: ../../c-api/conversion.rst:187 +msgid "" +"On Windows, these are aliases of :c:func:`!stricmp` and :c:func:`!strnicmp`, " +"respectively." +msgstr "" + +#: ../../c-api/conversion.rst:190 +msgid "" +"On other platforms, they are aliases of :c:func:`PyOS_mystricmp` and :c:func:" +"`PyOS_mystrnicmp`, respectively." +msgstr "" + +#: ../../c-api/conversion.rst:195 msgid "Character classification and conversion" msgstr "" -#: ../../c-api/conversion.rst:180 +#: ../../c-api/conversion.rst:197 msgid "" "The following macros provide locale-independent (unlike the C standard " "library ``ctype.h``) character classification and conversion. The argument " "must be a signed or unsigned :c:expr:`char`." msgstr "" -#: ../../c-api/conversion.rst:187 +#: ../../c-api/conversion.rst:204 msgid "Return true if the character *c* is an alphanumeric character." msgstr "" -#: ../../c-api/conversion.rst:192 +#: ../../c-api/conversion.rst:209 msgid "" "Return true if the character *c* is an alphabetic character (``a-z`` and ``A-" "Z``)." msgstr "" -#: ../../c-api/conversion.rst:197 +#: ../../c-api/conversion.rst:214 msgid "Return true if the character *c* is a decimal digit (``0-9``)." msgstr "" -#: ../../c-api/conversion.rst:202 +#: ../../c-api/conversion.rst:219 msgid "Return true if the character *c* is a lowercase ASCII letter (``a-z``)." msgstr "" -#: ../../c-api/conversion.rst:207 +#: ../../c-api/conversion.rst:224 msgid "" "Return true if the character *c* is an uppercase ASCII letter (``A-Z``)." msgstr "" -#: ../../c-api/conversion.rst:212 +#: ../../c-api/conversion.rst:229 msgid "" "Return true if the character *c* is a whitespace character (space, tab, " "carriage return, newline, vertical tab, or form feed)." msgstr "" -#: ../../c-api/conversion.rst:218 +#: ../../c-api/conversion.rst:235 msgid "" "Return true if the character *c* is a hexadecimal digit (``0-9``, ``a-f``, " "and ``A-F``)." msgstr "" -#: ../../c-api/conversion.rst:224 +#: ../../c-api/conversion.rst:241 msgid "Return the lowercase equivalent of the character *c*." msgstr "" -#: ../../c-api/conversion.rst:229 +#: ../../c-api/conversion.rst:246 msgid "Return the uppercase equivalent of the character *c*." msgstr "" + +#~ msgid "" +#~ "Case insensitive comparison of strings. The function works almost " +#~ "identically to :c:func:`!strcmp` except that it ignores the case." +#~ msgstr "" +#~ "不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strcmp` 相同,只是" +#~ "它忽略大小寫。" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 6af71062a0..8a03c9821f 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-13 23:16+0000\n" +"POT-Creation-Date: 2025-11-26 00:14+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1057,19 +1057,23 @@ msgid "" "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:987 ../../c-api/exceptions.rst:995 +#: ../../c-api/exceptions.rst:988 +msgid "The :c:func:`PyUnstable_ThreadState_SetStackProtection` function." +msgstr "" + +#: ../../c-api/exceptions.rst:990 ../../c-api/exceptions.rst:998 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:992 +#: ../../c-api/exceptions.rst:995 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:998 +#: ../../c-api/exceptions.rst:1001 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -1078,13 +1082,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:1006 +#: ../../c-api/exceptions.rst:1009 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1012 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -1092,301 +1096,301 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1018 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1022 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:1024 +#: ../../c-api/exceptions.rst:1027 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1032 msgid "" "Get the recursion limit for the current interpreter. It can be set with :c:" "func:`Py_SetRecursionLimit`. The recursion limit prevents the Python " "interpreter stack from growing infinitely." msgstr "" -#: ../../c-api/exceptions.rst:1033 ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1036 ../../c-api/exceptions.rst:1046 msgid "" "This function cannot fail, and the caller must hold an :term:`attached " "thread state`." msgstr "" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1040 msgid ":py:func:`sys.getrecursionlimit`" msgstr ":py:func:`sys.getrecursionlimit`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1044 msgid "Set the recursion limit for the current interpreter." msgstr "" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1050 msgid ":py:func:`sys.setrecursionlimit`" msgstr ":py:func:`sys.setrecursionlimit`" -#: ../../c-api/exceptions.rst:1052 +#: ../../c-api/exceptions.rst:1055 msgid "Exception and warning types" msgstr "例外和警告型別" -#: ../../c-api/exceptions.rst:1054 +#: ../../c-api/exceptions.rst:1057 msgid "" "All standard Python exceptions and warning categories are available as " "global variables whose names are ``PyExc_`` followed by the Python exception " "name. These have the type :c:expr:`PyObject*`; they are all class objects." msgstr "" -#: ../../c-api/exceptions.rst:1058 +#: ../../c-api/exceptions.rst:1061 msgid "For completeness, here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1064 msgid "Exception types" msgstr "例外型別" -#: ../../c-api/exceptions.rst:1068 ../../c-api/exceptions.rst:1214 -#: ../../c-api/exceptions.rst:1244 +#: ../../c-api/exceptions.rst:1071 ../../c-api/exceptions.rst:1217 +#: ../../c-api/exceptions.rst:1247 msgid "C name" msgstr "C 名稱" -#: ../../c-api/exceptions.rst:1069 ../../c-api/exceptions.rst:1215 -#: ../../c-api/exceptions.rst:1245 +#: ../../c-api/exceptions.rst:1072 ../../c-api/exceptions.rst:1218 +#: ../../c-api/exceptions.rst:1248 msgid "Python name" msgstr "Python 名稱" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1074 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1076 msgid ":exc:`BaseExceptionGroup`" msgstr ":exc:`BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1078 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1080 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1082 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1084 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1086 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1088 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1090 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1092 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1094 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1096 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1098 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1100 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1102 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1104 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1106 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1108 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1110 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1109 +#: ../../c-api/exceptions.rst:1112 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1111 +#: ../../c-api/exceptions.rst:1114 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:1116 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1115 +#: ../../c-api/exceptions.rst:1118 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1117 +#: ../../c-api/exceptions.rst:1120 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:1122 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:1124 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1126 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1125 +#: ../../c-api/exceptions.rst:1128 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1127 +#: ../../c-api/exceptions.rst:1130 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:1132 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:1134 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:1136 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1135 ../../c-api/exceptions.rst:1218 -#: ../../c-api/exceptions.rst:1221 ../../c-api/exceptions.rst:1224 +#: ../../c-api/exceptions.rst:1138 ../../c-api/exceptions.rst:1221 +#: ../../c-api/exceptions.rst:1224 ../../c-api/exceptions.rst:1227 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1137 +#: ../../c-api/exceptions.rst:1140 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1139 +#: ../../c-api/exceptions.rst:1142 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1141 +#: ../../c-api/exceptions.rst:1144 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1143 +#: ../../c-api/exceptions.rst:1146 msgid ":exc:`PythonFinalizationError`" msgstr ":exc:`PythonFinalizationError`" -#: ../../c-api/exceptions.rst:1145 +#: ../../c-api/exceptions.rst:1148 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1147 +#: ../../c-api/exceptions.rst:1150 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:1152 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1151 +#: ../../c-api/exceptions.rst:1154 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1153 +#: ../../c-api/exceptions.rst:1156 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1155 +#: ../../c-api/exceptions.rst:1158 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1157 +#: ../../c-api/exceptions.rst:1160 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1159 +#: ../../c-api/exceptions.rst:1162 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1164 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1163 +#: ../../c-api/exceptions.rst:1166 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1168 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1167 +#: ../../c-api/exceptions.rst:1170 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1169 +#: ../../c-api/exceptions.rst:1172 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1171 +#: ../../c-api/exceptions.rst:1174 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1173 +#: ../../c-api/exceptions.rst:1176 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1175 +#: ../../c-api/exceptions.rst:1178 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1177 +#: ../../c-api/exceptions.rst:1180 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1182 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1184 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1406,141 +1410,141 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`。" -#: ../../c-api/exceptions.rst:1194 +#: ../../c-api/exceptions.rst:1197 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`。" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1200 msgid ":c:data:`PyExc_BaseExceptionGroup`." msgstr ":c:data:`PyExc_BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1202 +#: ../../c-api/exceptions.rst:1205 msgid "OSError aliases" msgstr "OSError 別名" -#: ../../c-api/exceptions.rst:1204 +#: ../../c-api/exceptions.rst:1207 msgid "The following are a compatibility aliases to :c:data:`PyExc_OSError`." msgstr "" -#: ../../c-api/exceptions.rst:1206 +#: ../../c-api/exceptions.rst:1209 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1216 +#: ../../c-api/exceptions.rst:1219 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:1225 +#: ../../c-api/exceptions.rst:1228 msgid "[win]_" msgstr "[win]_" -#: ../../c-api/exceptions.rst:1227 +#: ../../c-api/exceptions.rst:1230 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1230 +#: ../../c-api/exceptions.rst:1233 msgid "" ":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that " "uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1237 +#: ../../c-api/exceptions.rst:1240 msgid "Warning types" msgstr "警告型別" -#: ../../c-api/exceptions.rst:1247 +#: ../../c-api/exceptions.rst:1250 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1249 +#: ../../c-api/exceptions.rst:1252 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1251 +#: ../../c-api/exceptions.rst:1254 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1253 +#: ../../c-api/exceptions.rst:1256 msgid ":exc:`EncodingWarning`" msgstr ":exc:`EncodingWarning`" -#: ../../c-api/exceptions.rst:1255 +#: ../../c-api/exceptions.rst:1258 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1257 +#: ../../c-api/exceptions.rst:1260 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1259 +#: ../../c-api/exceptions.rst:1262 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1261 +#: ../../c-api/exceptions.rst:1264 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1263 +#: ../../c-api/exceptions.rst:1266 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1265 +#: ../../c-api/exceptions.rst:1268 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1267 +#: ../../c-api/exceptions.rst:1270 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1269 +#: ../../c-api/exceptions.rst:1272 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1271 +#: ../../c-api/exceptions.rst:1274 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`。" -#: ../../c-api/exceptions.rst:1274 +#: ../../c-api/exceptions.rst:1277 msgid ":c:data:`PyExc_EncodingWarning`." msgstr ":c:data:`PyExc_EncodingWarning`。" -#: ../../c-api/exceptions.rst:1279 +#: ../../c-api/exceptions.rst:1282 msgid "Tracebacks" msgstr "" -#: ../../c-api/exceptions.rst:1283 +#: ../../c-api/exceptions.rst:1286 msgid "" "Type object for traceback objects. This is available as :class:`types." "TracebackType` in the Python layer." msgstr "" -#: ../../c-api/exceptions.rst:1289 +#: ../../c-api/exceptions.rst:1292 msgid "" "Return true if *op* is a traceback object, false otherwise. This function " "does not account for subtypes." msgstr "" -#: ../../c-api/exceptions.rst:1295 +#: ../../c-api/exceptions.rst:1298 msgid "" "Replace the :attr:`~BaseException.__traceback__` attribute on the current " "exception with a new traceback prepending *f* to the existing chain." msgstr "" -#: ../../c-api/exceptions.rst:1298 +#: ../../c-api/exceptions.rst:1301 msgid "Calling this function without an exception set is undefined behavior." msgstr "" -#: ../../c-api/exceptions.rst:1300 ../../c-api/exceptions.rst:1308 +#: ../../c-api/exceptions.rst:1303 ../../c-api/exceptions.rst:1311 msgid "" "This function returns ``0`` on success, and returns ``-1`` with an exception " "set on failure." msgstr "" -#: ../../c-api/exceptions.rst:1306 +#: ../../c-api/exceptions.rst:1309 msgid "Write the traceback *tb* into the file *f*." msgstr "" diff --git a/c-api/init.po b/c-api/init.po index 0048331384..dd6ad36d34 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-20 17:54+0000\n" +"POT-Creation-Date: 2025-11-26 00:14+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1573,7 +1573,7 @@ msgid "" "deadlock ensues. *tstate* will be attached upon returning." msgstr "" -#: ../../c-api/init.rst:1244 ../../c-api/init.rst:1631 +#: ../../c-api/init.rst:1244 ../../c-api/init.rst:1688 msgid "" "Calling this function from a thread when the runtime is finalizing will hang " "the thread until the program exits, even if the thread was not created by " @@ -1582,7 +1582,7 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1249 ../../c-api/init.rst:1333 -#: ../../c-api/init.rst:1641 +#: ../../c-api/init.rst:1698 msgid "" "Hangs the current thread, rather than terminating it, if called while the " "interpreter is finalizing." @@ -1924,79 +1924,138 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1536 +msgid "" +"Set the stack protection start address and stack protection size of a Python " +"thread state." +msgstr "" + +#: ../../c-api/init.rst:1539 +msgid "" +"On success, return ``0``. On failure, set an exception and return ``-1``." +msgstr "" + +#: ../../c-api/init.rst:1542 +msgid "" +"CPython implements :ref:`recursion control ` for C code by " +"raising :py:exc:`RecursionError` when it notices that the machine execution " +"stack is close to overflow. See for example the :c:func:" +"`Py_EnterRecursiveCall` function. For this, it needs to know the location of " +"the current thread's stack, which it normally gets from the operating " +"system. When the stack is changed, for example using context switching " +"techniques like the Boost library's ``boost::context``, you must call :c:" +"func:`~PyUnstable_ThreadState_SetStackProtection` to inform CPython of the " +"change." +msgstr "" + +#: ../../c-api/init.rst:1551 +msgid "" +"Call :c:func:`~PyUnstable_ThreadState_SetStackProtection` either before or " +"after changing the stack. Do not call any other Python C API between the " +"call and the stack change." +msgstr "" + +#: ../../c-api/init.rst:1556 +msgid "" +"See :c:func:`PyUnstable_ThreadState_ResetStackProtection` for undoing this " +"operation." +msgstr "" + +#: ../../c-api/init.rst:1562 ../../c-api/init.rst:1582 +msgid "" +"This function was added in a bugfix release, and extensions that use it will " +"be incompatible with Python 3.14.0. Most packaging tools for Python are not " +"able to handle this incompatibility automatically, and will need explicit " +"configuration. When using PyPA standards (wheels and source distributions), " +"specify ``Requires-Python: != 3.14.0.*`` in `core metadata `_." +msgstr "" + +#: ../../c-api/init.rst:1573 +msgid "" +"Reset the stack protection start address and stack protection size of a " +"Python thread state to the operating system defaults." +msgstr "" + +#: ../../c-api/init.rst:1576 +msgid "" +"See :c:func:`PyUnstable_ThreadState_SetStackProtection` for an explanation." +msgstr "" + +#: ../../c-api/init.rst:1593 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1538 +#: ../../c-api/init.rst:1595 msgid "" "Issue a fatal error if there no :term:`attached thread state`. It cannot " "return NULL." msgstr "" -#: ../../c-api/init.rst:1546 +#: ../../c-api/init.rst:1603 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1549 ../../c-api/init.rst:2164 -#: ../../c-api/init.rst:2171 ../../c-api/init.rst:2190 -#: ../../c-api/init.rst:2197 +#: ../../c-api/init.rst:1606 ../../c-api/init.rst:2221 +#: ../../c-api/init.rst:2228 ../../c-api/init.rst:2247 +#: ../../c-api/init.rst:2254 msgid "The caller must have an :term:`attached thread state`." msgstr "呼叫者必須擁有一個 :term:`attached thread state`。" -#: ../../c-api/init.rst:1556 +#: ../../c-api/init.rst:1613 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1560 +#: ../../c-api/init.rst:1617 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1563 +#: ../../c-api/init.rst:1620 msgid "" "The returned dictionary is borrowed from the interpreter and is valid until " "interpreter shutdown." msgstr "" -#: ../../c-api/init.rst:1571 +#: ../../c-api/init.rst:1628 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1573 +#: ../../c-api/init.rst:1630 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1576 +#: ../../c-api/init.rst:1633 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1579 +#: ../../c-api/init.rst:1636 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1584 +#: ../../c-api/init.rst:1641 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1586 ../../c-api/init.rst:1594 +#: ../../c-api/init.rst:1643 ../../c-api/init.rst:1651 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1592 +#: ../../c-api/init.rst:1649 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1601 +#: ../../c-api/init.rst:1658 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -2006,7 +2065,7 @@ msgid "" "thread state is attached." msgstr "" -#: ../../c-api/init.rst:1611 +#: ../../c-api/init.rst:1668 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -2018,54 +2077,54 @@ msgid "" "is cleared. This raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1619 +#: ../../c-api/init.rst:1676 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1625 +#: ../../c-api/init.rst:1682 msgid "" ":term:`Attach ` *tstate* to the current thread, which " "must not be ``NULL`` or already :term:`attached `." msgstr "" -#: ../../c-api/init.rst:1628 +#: ../../c-api/init.rst:1685 msgid "" "The calling thread must not already have an :term:`attached thread state`." msgstr "" -#: ../../c-api/init.rst:1636 +#: ../../c-api/init.rst:1693 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1645 +#: ../../c-api/init.rst:1702 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1651 +#: ../../c-api/init.rst:1708 msgid "" "Detach the :term:`attached thread state`. The *tstate* argument, which must " "not be ``NULL``, is only used to check that it represents the :term:" "`attached thread state` --- if it isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1656 +#: ../../c-api/init.rst:1713 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1663 +#: ../../c-api/init.rst:1720 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1665 +#: ../../c-api/init.rst:1722 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -2073,7 +2132,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1670 +#: ../../c-api/init.rst:1727 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -2084,31 +2143,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1677 +#: ../../c-api/init.rst:1734 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1683 +#: ../../c-api/init.rst:1740 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1689 +#: ../../c-api/init.rst:1746 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1693 +#: ../../c-api/init.rst:1750 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1697 +#: ../../c-api/init.rst:1754 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -2116,44 +2175,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1705 +#: ../../c-api/init.rst:1762 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1709 +#: ../../c-api/init.rst:1766 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1714 +#: ../../c-api/init.rst:1771 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1719 +#: ../../c-api/init.rst:1776 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1724 +#: ../../c-api/init.rst:1781 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:1787 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create daemon threads. Otherwise daemon threads are allowed (as long as :c:" "member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1737 +#: ../../c-api/init.rst:1794 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " @@ -2162,37 +2221,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1744 +#: ../../c-api/init.rst:1801 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1749 +#: ../../c-api/init.rst:1806 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1756 +#: ../../c-api/init.rst:1813 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1760 +#: ../../c-api/init.rst:1817 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1764 +#: ../../c-api/init.rst:1821 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1766 +#: ../../c-api/init.rst:1823 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1780 +#: ../../c-api/init.rst:1837 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -2205,13 +2264,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1790 +#: ../../c-api/init.rst:1847 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1793 +#: ../../c-api/init.rst:1850 msgid "" "Upon success, *tstate_p* will be set to the first :term:`thread state` " "created in the new sub-interpreter. This thread state is :term:`attached " @@ -2222,7 +2281,7 @@ msgid "" "not exist." msgstr "" -#: ../../c-api/init.rst:1802 +#: ../../c-api/init.rst:1859 msgid "" "Like all other Python/C API functions, an :term:`attached thread state` must " "be present before calling this function, but it might be detached upon " @@ -2235,13 +2294,13 @@ msgid "" "will remain detached." msgstr "" -#: ../../c-api/init.rst:1813 +#: ../../c-api/init.rst:1870 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1816 +#: ../../c-api/init.rst:1873 msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -2273,7 +2332,7 @@ msgstr "" " Py_ExitStatusException(status);\n" "}" -#: ../../c-api/init.rst:1831 +#: ../../c-api/init.rst:1888 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -2281,11 +2340,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1840 +#: ../../c-api/init.rst:1897 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1842 +#: ../../c-api/init.rst:1899 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -2293,7 +2352,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1848 +#: ../../c-api/init.rst:1905 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -2305,7 +2364,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1859 +#: ../../c-api/init.rst:1916 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -2315,7 +2374,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1879 +#: ../../c-api/init.rst:1936 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -2324,7 +2383,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1891 +#: ../../c-api/init.rst:1948 msgid "" "Destroy the (sub-)interpreter represented by the given :term:`thread state`. " "The given thread state must be :term:`attached `. " @@ -2332,17 +2391,17 @@ msgid "" "thread states associated with this interpreter are destroyed." msgstr "" -#: ../../c-api/init.rst:1896 +#: ../../c-api/init.rst:1953 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1903 +#: ../../c-api/init.rst:1960 msgid "A Per-Interpreter GIL" msgstr "直譯器各別持有的 GIL" -#: ../../c-api/init.rst:1905 +#: ../../c-api/init.rst:1962 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2354,7 +2413,7 @@ msgid "" "just using threads. (See :pep:`554` and :pep:`684`.)" msgstr "" -#: ../../c-api/init.rst:1915 +#: ../../c-api/init.rst:1972 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2368,7 +2427,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:1983 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2376,7 +2435,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1931 +#: ../../c-api/init.rst:1988 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2386,11 +2445,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1942 +#: ../../c-api/init.rst:1999 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1944 +#: ../../c-api/init.rst:2001 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2403,7 +2462,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1954 +#: ../../c-api/init.rst:2011 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2412,7 +2471,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1960 +#: ../../c-api/init.rst:2017 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2424,25 +2483,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1971 +#: ../../c-api/init.rst:2028 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1973 +#: ../../c-api/init.rst:2030 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1980 +#: ../../c-api/init.rst:2037 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1984 +#: ../../c-api/init.rst:2041 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2450,17 +2509,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1989 +#: ../../c-api/init.rst:2046 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1990 +#: ../../c-api/init.rst:2047 msgid "" "with the main thread holding an :term:`attached thread state` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1993 +#: ../../c-api/init.rst:2050 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2468,7 +2527,7 @@ msgid "" "if the :term:`thread state ` is detached." msgstr "" -#: ../../c-api/init.rst:1998 +#: ../../c-api/init.rst:2055 msgid "" "This function doesn't need an :term:`attached thread state`. However, to " "call this function in a subinterpreter, the caller must have an :term:" @@ -2476,7 +2535,7 @@ msgid "" "be called from the wrong interpreter." msgstr "" -#: ../../c-api/init.rst:2003 +#: ../../c-api/init.rst:2060 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2486,7 +2545,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:2012 +#: ../../c-api/init.rst:2069 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2494,46 +2553,46 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:2018 +#: ../../c-api/init.rst:2075 msgid "" "This function now always schedules *func* to be run in the main interpreter." msgstr "" -#: ../../c-api/init.rst:2025 +#: ../../c-api/init.rst:2082 msgid "" "Execute all pending calls. This is usually executed automatically by the " "interpreter." msgstr "" -#: ../../c-api/init.rst:2028 +#: ../../c-api/init.rst:2085 msgid "" "This function returns ``0`` on success, and returns ``-1`` with an exception " "set on failure." msgstr "" -#: ../../c-api/init.rst:2031 +#: ../../c-api/init.rst:2088 msgid "" "If this is not called in the main thread of the main interpreter, this " "function does nothing and returns ``0``. The caller must hold an :term:" "`attached thread state`." msgstr "" -#: ../../c-api/init.rst:2037 +#: ../../c-api/init.rst:2094 msgid "This function only runs pending calls in the main interpreter." msgstr "" -#: ../../c-api/init.rst:2044 +#: ../../c-api/init.rst:2101 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:2049 +#: ../../c-api/init.rst:2106 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:2053 +#: ../../c-api/init.rst:2110 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2543,7 +2602,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:2063 +#: ../../c-api/init.rst:2120 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " @@ -2555,66 +2614,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:2072 +#: ../../c-api/init.rst:2129 msgid "Value of *what*" msgstr "*what* 的值" -#: ../../c-api/init.rst:2072 +#: ../../c-api/init.rst:2129 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:2074 +#: ../../c-api/init.rst:2131 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:2074 ../../c-api/init.rst:2079 -#: ../../c-api/init.rst:2090 +#: ../../c-api/init.rst:2131 ../../c-api/init.rst:2136 +#: ../../c-api/init.rst:2147 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:2076 +#: ../../c-api/init.rst:2133 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:2076 +#: ../../c-api/init.rst:2133 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:2079 +#: ../../c-api/init.rst:2136 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:2081 +#: ../../c-api/init.rst:2138 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:2081 +#: ../../c-api/init.rst:2138 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:2084 +#: ../../c-api/init.rst:2141 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:2084 ../../c-api/init.rst:2086 -#: ../../c-api/init.rst:2088 +#: ../../c-api/init.rst:2141 ../../c-api/init.rst:2143 +#: ../../c-api/init.rst:2145 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:2086 +#: ../../c-api/init.rst:2143 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:2088 +#: ../../c-api/init.rst:2145 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:2090 +#: ../../c-api/init.rst:2147 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:2095 +#: ../../c-api/init.rst:2152 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2623,7 +2682,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:2104 +#: ../../c-api/init.rst:2161 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2635,7 +2694,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:2115 +#: ../../c-api/init.rst:2172 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2643,31 +2702,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:2123 +#: ../../c-api/init.rst:2180 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:2129 +#: ../../c-api/init.rst:2186 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:2135 +#: ../../c-api/init.rst:2192 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:2141 +#: ../../c-api/init.rst:2198 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:2147 +#: ../../c-api/init.rst:2204 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2675,7 +2734,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:2155 +#: ../../c-api/init.rst:2212 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2685,24 +2744,24 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:2162 +#: ../../c-api/init.rst:2219 msgid "See also the :func:`sys.setprofile` function." msgstr "另請參閱 :func:`sys.setprofile` 函式。" -#: ../../c-api/init.rst:2168 +#: ../../c-api/init.rst:2225 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:2173 +#: ../../c-api/init.rst:2230 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:2181 +#: ../../c-api/init.rst:2238 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2713,28 +2772,28 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:2188 +#: ../../c-api/init.rst:2245 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:2194 +#: ../../c-api/init.rst:2251 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:2199 +#: ../../c-api/init.rst:2256 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2205 +#: ../../c-api/init.rst:2262 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:2211 +#: ../../c-api/init.rst:2268 msgid "" "The type of the trace function registered using :c:func:" "`PyRefTracer_SetTracer`. The first parameter is a Python object that has " @@ -2744,19 +2803,19 @@ msgid "" "provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:2221 +#: ../../c-api/init.rst:2278 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:2226 +#: ../../c-api/init.rst:2283 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:2231 +#: ../../c-api/init.rst:2288 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2765,7 +2824,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:2237 +#: ../../c-api/init.rst:2294 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2773,12 +2832,12 @@ msgid "" "active every time the tracer function is called." msgstr "" -#: ../../c-api/init.rst:2242 ../../c-api/init.rst:2253 +#: ../../c-api/init.rst:2299 ../../c-api/init.rst:2310 msgid "" "There must be an :term:`attached thread state` when calling this function." msgstr "" -#: ../../c-api/init.rst:2248 +#: ../../c-api/init.rst:2305 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2786,48 +2845,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:2260 +#: ../../c-api/init.rst:2317 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2265 +#: ../../c-api/init.rst:2322 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2270 +#: ../../c-api/init.rst:2327 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2275 +#: ../../c-api/init.rst:2332 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2280 +#: ../../c-api/init.rst:2337 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2286 +#: ../../c-api/init.rst:2343 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2292 +#: ../../c-api/init.rst:2349 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2299 +#: ../../c-api/init.rst:2356 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2303 +#: ../../c-api/init.rst:2360 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2837,19 +2896,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2310 +#: ../../c-api/init.rst:2367 msgid "" "A :term:`thread state` does *not* need to be :term:`attached ` when calling these functions; they suppl their own locking." msgstr "" -#: ../../c-api/init.rst:2313 +#: ../../c-api/init.rst:2370 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2317 +#: ../../c-api/init.rst:2374 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2857,22 +2916,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2325 +#: ../../c-api/init.rst:2382 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2327 +#: ../../c-api/init.rst:2384 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2333 +#: ../../c-api/init.rst:2390 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2338 +#: ../../c-api/init.rst:2395 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2880,52 +2939,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2343 +#: ../../c-api/init.rst:2400 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2349 +#: ../../c-api/init.rst:2406 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2354 +#: ../../c-api/init.rst:2411 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2356 +#: ../../c-api/init.rst:2413 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2363 +#: ../../c-api/init.rst:2420 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2370 +#: ../../c-api/init.rst:2427 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2376 +#: ../../c-api/init.rst:2433 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2381 +#: ../../c-api/init.rst:2438 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2383 +#: ../../c-api/init.rst:2440 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2933,13 +2992,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2391 +#: ../../c-api/init.rst:2448 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2397 +#: ../../c-api/init.rst:2454 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2948,7 +3007,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2406 +#: ../../c-api/init.rst:2463 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2957,31 +3016,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2415 +#: ../../c-api/init.rst:2472 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2422 +#: ../../c-api/init.rst:2479 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2430 +#: ../../c-api/init.rst:2487 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2432 +#: ../../c-api/init.rst:2489 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2437 +#: ../../c-api/init.rst:2494 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2990,45 +3049,45 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2442 +#: ../../c-api/init.rst:2499 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" -#: ../../c-api/init.rst:2453 +#: ../../c-api/init.rst:2510 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2455 +#: ../../c-api/init.rst:2512 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2459 +#: ../../c-api/init.rst:2516 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2462 +#: ../../c-api/init.rst:2519 msgid "PyMutex mutex = {0};" msgstr "PyMutex mutex = {0};" -#: ../../c-api/init.rst:2464 +#: ../../c-api/init.rst:2521 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2470 +#: ../../c-api/init.rst:2527 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2478 +#: ../../c-api/init.rst:2535 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " @@ -3036,28 +3095,28 @@ msgid "" "exists." msgstr "" -#: ../../c-api/init.rst:2486 +#: ../../c-api/init.rst:2543 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2493 +#: ../../c-api/init.rst:2550 msgid "Returns non-zero if the mutex *m* is currently locked, zero otherwise." msgstr "" -#: ../../c-api/init.rst:2497 +#: ../../c-api/init.rst:2554 msgid "" "This function is intended for use in assertions and debugging only and " "should not be used to make concurrency control decisions, as the lock state " "may change immediately after the check." msgstr "" -#: ../../c-api/init.rst:2506 +#: ../../c-api/init.rst:2563 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2508 +#: ../../c-api/init.rst:2565 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -3065,7 +3124,7 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2513 +#: ../../c-api/init.rst:2570 msgid "" "Critical sections are intended to be used for custom types implemented in C-" "API extensions. They should generally not be used with built-in types like :" @@ -3074,7 +3133,7 @@ msgid "" "`PyDict_Next`, which requires critical section to be acquired externally." msgstr "" -#: ../../c-api/init.rst:2520 +#: ../../c-api/init.rst:2577 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections, hence, they do not provide exclusive access such as provided by " @@ -3085,7 +3144,7 @@ msgid "" "threads can acquire the per-object lock for the same object." msgstr "" -#: ../../c-api/init.rst:2528 +#: ../../c-api/init.rst:2585 msgid "" "Variants that accept :c:type:`PyMutex` pointers rather than Python objects " "are also available. Use these variants to start a critical section in a " @@ -3094,7 +3153,7 @@ msgid "" "needs to call into the C API in a manner that might lead to deadlocks." msgstr "" -#: ../../c-api/init.rst:2534 +#: ../../c-api/init.rst:2591 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -3102,7 +3161,7 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2541 +#: ../../c-api/init.rst:2598 msgid "" "Operations that need to lock two objects at once must use :c:macro:" "`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " @@ -3111,11 +3170,11 @@ msgid "" "lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2547 +#: ../../c-api/init.rst:2604 msgid "Example usage::" msgstr "範例用法: ::" -#: ../../c-api/init.rst:2549 +#: ../../c-api/init.rst:2606 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -3135,7 +3194,7 @@ msgstr "" " Py_RETURN_NONE;\n" "}" -#: ../../c-api/init.rst:2558 +#: ../../c-api/init.rst:2615 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " @@ -3145,19 +3204,19 @@ msgid "" "`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2566 +#: ../../c-api/init.rst:2623 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2569 ../../c-api/init.rst:2583 -#: ../../c-api/init.rst:2600 ../../c-api/init.rst:2615 -#: ../../c-api/init.rst:2629 ../../c-api/init.rst:2646 +#: ../../c-api/init.rst:2626 ../../c-api/init.rst:2640 +#: ../../c-api/init.rst:2657 ../../c-api/init.rst:2672 +#: ../../c-api/init.rst:2686 ../../c-api/init.rst:2703 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2571 +#: ../../c-api/init.rst:2628 msgid "" "{\n" " PyCriticalSection _py_cs;\n" @@ -3167,15 +3226,15 @@ msgstr "" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" -#: ../../c-api/init.rst:2575 ../../c-api/init.rst:2621 +#: ../../c-api/init.rst:2632 ../../c-api/init.rst:2678 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2581 +#: ../../c-api/init.rst:2638 msgid "Locks the mutex *m* and begins a critical section." msgstr "" -#: ../../c-api/init.rst:2585 +#: ../../c-api/init.rst:2642 msgid "" "{\n" " PyCriticalSection _py_cs;\n" @@ -3185,21 +3244,21 @@ msgstr "" " PyCriticalSection _py_cs;\n" " PyCriticalSection_BeginMutex(&_py_cs, m)" -#: ../../c-api/init.rst:2589 +#: ../../c-api/init.rst:2646 msgid "" "Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION`, there is no cast for " "the argument of the macro - it must be a :c:type:`PyMutex` pointer." msgstr "" -#: ../../c-api/init.rst:2592 ../../c-api/init.rst:2638 +#: ../../c-api/init.rst:2649 ../../c-api/init.rst:2695 msgid "On the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2598 +#: ../../c-api/init.rst:2655 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2602 +#: ../../c-api/init.rst:2659 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" @@ -3207,18 +3266,18 @@ msgstr "" " PyCriticalSection_End(&_py_cs);\n" "}" -#: ../../c-api/init.rst:2605 ../../c-api/init.rst:2651 +#: ../../c-api/init.rst:2662 ../../c-api/init.rst:2708 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2611 +#: ../../c-api/init.rst:2668 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2617 +#: ../../c-api/init.rst:2674 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" @@ -3228,11 +3287,11 @@ msgstr "" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" -#: ../../c-api/init.rst:2627 +#: ../../c-api/init.rst:2684 msgid "Locks the mutexes *m1* and *m2* and begins a critical section." msgstr "" -#: ../../c-api/init.rst:2631 +#: ../../c-api/init.rst:2688 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" @@ -3242,17 +3301,17 @@ msgstr "" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_BeginMutex(&_py_cs2, m1, m2)" -#: ../../c-api/init.rst:2635 +#: ../../c-api/init.rst:2692 msgid "" "Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION2`, there is no cast for " "the arguments of the macro - they must be :c:type:`PyMutex` pointers." msgstr "" -#: ../../c-api/init.rst:2644 +#: ../../c-api/init.rst:2701 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2648 +#: ../../c-api/init.rst:2705 msgid "" " PyCriticalSection2_End(&_py_cs2);\n" "}" @@ -3260,6 +3319,262 @@ msgstr "" " PyCriticalSection2_End(&_py_cs2);\n" "}" +#: ../../c-api/init.rst:2714 +msgid "Legacy Locking APIs" +msgstr "" + +#: ../../c-api/init.rst:2716 +msgid "" +"These APIs are obsolete since Python 3.13 with the introduction of :c:type:" +"`PyMutex`." +msgstr "" + +#: ../../c-api/init.rst:2719 +msgid "These APIs are now a simple wrapper around ``PyMutex``." +msgstr "" + +#: ../../c-api/init.rst:2725 +msgid "A pointer to a mutual exclusion lock." +msgstr "" + +#: ../../c-api/init.rst:2730 +msgid "The result of acquiring a lock with a timeout." +msgstr "" + +#: ../../c-api/init.rst:2736 +msgid "Failed to acquire the lock." +msgstr "" + +#: ../../c-api/init.rst:2740 +msgid "The lock was successfully acquired." +msgstr "" + +#: ../../c-api/init.rst:2744 +msgid "The lock was interrupted by a signal." +msgstr "" + +#: ../../c-api/init.rst:2749 +msgid "Allocate a new lock." +msgstr "" + +#: ../../c-api/init.rst:2751 +msgid "" +"On success, this function returns a lock; on failure, this function returns " +"``0`` without an exception set." +msgstr "" + +#: ../../c-api/init.rst:2754 ../../c-api/init.rst:2766 +#: ../../c-api/init.rst:2786 ../../c-api/init.rst:2804 +#: ../../c-api/init.rst:2812 ../../c-api/init.rst:2835 +#: ../../c-api/init.rst:2919 ../../c-api/init.rst:2927 +#, fuzzy +msgid "The caller does not need to hold an :term:`attached thread state`." +msgstr "呼叫者必須擁有一個 :term:`attached thread state`。" + +#: ../../c-api/init.rst:2756 +msgid "" +"This function now always uses :c:type:`PyMutex`. In prior versions, this " +"would use a lock provided by the operating system." +msgstr "" + +#: ../../c-api/init.rst:2763 +msgid "" +"Destroy *lock*. The lock should not be held by any thread when calling this." +msgstr "" + +#: ../../c-api/init.rst:2771 +msgid "Acquire *lock* with a timeout." +msgstr "" + +#: ../../c-api/init.rst:2773 +msgid "" +"This will wait for *microseconds* microseconds to acquire the lock. If the " +"timeout expires, this function returns :c:enumerator:`PY_LOCK_FAILURE`. If " +"*microseconds* is ``-1``, this will wait indefinitely until the lock has " +"been released." +msgstr "" + +#: ../../c-api/init.rst:2778 +msgid "" +"If *intr_flag* is ``1``, acquiring the lock may be interrupted by a signal, " +"in which case this function returns :c:enumerator:`PY_LOCK_INTR`. Upon " +"interruption, it's generally expected that the caller makes a call to :c:" +"func:`Py_MakePendingCalls` to propagate an exception to Python code." +msgstr "" + +#: ../../c-api/init.rst:2783 +msgid "" +"If the lock is successfully acquired, this function returns :c:enumerator:" +"`PY_LOCK_ACQUIRED`." +msgstr "" + +#: ../../c-api/init.rst:2791 +msgid "Acquire *lock*." +msgstr "" + +#: ../../c-api/init.rst:2793 +msgid "" +"If *waitflag* is ``1`` and another thread currently holds the lock, this " +"function will wait until the lock can be acquired and will always return " +"``1``." +msgstr "" + +#: ../../c-api/init.rst:2797 +msgid "" +"If *waitflag* is ``0`` and another thread holds the lock, this function will " +"not wait and instead return ``0``. If the lock is not held by any other " +"thread, then this function will acquire it and return ``1``." +msgstr "" + +#: ../../c-api/init.rst:2801 +msgid "" +"Unlike :c:func:`PyThread_acquire_lock_timed`, acquiring the lock cannot be " +"interrupted by a signal." +msgstr "" + +#: ../../c-api/init.rst:2809 +msgid "" +"Release *lock*. If *lock* is not held, then this function issues a fatal " +"error." +msgstr "" + +#: ../../c-api/init.rst:2816 +msgid "Operating System Thread APIs" +msgstr "" + +#: ../../c-api/init.rst:2820 +msgid "Sentinel value for an invalid thread ID." +msgstr "" + +#: ../../c-api/init.rst:2822 +msgid "This is currently equivalent to ``(unsigned long)-1``." +msgstr "" + +#: ../../c-api/init.rst:2827 +msgid "" +"Start function *func* in a new thread with argument *arg*. The resulting " +"thread is not intended to be joined." +msgstr "" + +#: ../../c-api/init.rst:2830 +msgid "*func* must not be ``NULL``, but *arg* may be ``NULL``." +msgstr "" + +#: ../../c-api/init.rst:2832 +msgid "" +"On success, this function returns the identifier of the new thread; on " +"failure, this returns :c:macro:`PYTHREAD_INVALID_THREAD_ID`." +msgstr "" + +#: ../../c-api/init.rst:2840 +msgid "Return the identifier of the current thread, which will never be zero." +msgstr "" + +#: ../../c-api/init.rst:2842 ../../c-api/init.rst:2874 +#, fuzzy +msgid "" +"This function cannot fail, and the caller does not need to hold an :term:" +"`attached thread state`." +msgstr "呼叫者必須擁有一個 :term:`attached thread state`。" + +#: ../../c-api/init.rst:2846 +#, fuzzy +msgid ":py:func:`threading.get_ident`" +msgstr ":c:func:`PyThreadState_Get`" + +#: ../../c-api/init.rst:2851 +msgid "" +"Get general information about the current thread in the form of a :ref:" +"`struct sequence ` object. This information is " +"accessible as :py:attr:`sys.thread_info` in Python." +msgstr "" + +#: ../../c-api/init.rst:2855 +msgid "" +"On success, this returns a new :term:`strong reference` to the thread " +"information; on failure, this returns ``NULL`` with an exception set." +msgstr "" + +#: ../../c-api/init.rst:2858 +#, fuzzy +msgid "The caller must hold an :term:`attached thread state`." +msgstr "呼叫者必須擁有一個 :term:`attached thread state`。" + +#: ../../c-api/init.rst:2863 +msgid "This macro is defined when the system supports native thread IDs." +msgstr "" + +#: ../../c-api/init.rst:2868 +msgid "" +"Get the native identifier of the current thread as it was assigned by the " +"operating system's kernel, which will never be less than zero." +msgstr "" + +#: ../../c-api/init.rst:2871 +msgid "" +"This function is only available when :c:macro:`PY_HAVE_THREAD_NATIVE_ID` is " +"defined." +msgstr "" + +#: ../../c-api/init.rst:2878 +#, fuzzy +msgid ":py:func:`threading.get_native_id`" +msgstr ":c:func:`PyThreadState_Get`" + +#: ../../c-api/init.rst:2883 +msgid "" +"Terminate the current thread. This function is generally considered unsafe " +"and should be avoided. It is kept solely for backwards compatibility." +msgstr "" + +#: ../../c-api/init.rst:2886 +msgid "" +"This function is only safe to call if all functions in the full call stack " +"are written to safely allow it." +msgstr "" + +#: ../../c-api/init.rst:2891 +msgid "" +"If the current system uses POSIX threads (also known as \"pthreads\"), this " +"calls :manpage:`pthread_exit(3)`, which attempts to unwind the stack and " +"call C++ destructors on some libc implementations. However, if a " +"``noexcept`` function is reached, it may terminate the process. Other " +"systems, such as macOS, do unwinding." +msgstr "" + +#: ../../c-api/init.rst:2897 +msgid "" +"On Windows, this function calls ``_endthreadex()``, which kills the thread " +"without calling C++ destructors." +msgstr "" + +#: ../../c-api/init.rst:2900 +msgid "In any case, there is a risk of corruption on the thread's stack." +msgstr "" + +#: ../../c-api/init.rst:2907 +msgid "" +"Initialize ``PyThread*`` APIs. Python executes this function automatically, " +"so there's little need to call it from an extension module." +msgstr "" + +#: ../../c-api/init.rst:2913 +msgid "Set the stack size of the current thread to *size* bytes." +msgstr "" + +#: ../../c-api/init.rst:2915 +msgid "" +"This function returns ``0`` on success, ``-1`` if *size* is invalid, or " +"``-2`` if the system does not support changing the stack size. This function " +"does not set exceptions." +msgstr "" + +#: ../../c-api/init.rst:2924 +msgid "" +"Return the stack size of the current thread in bytes, or ``0`` if the " +"system's default stack size is in use." +msgstr "" + #: ../../c-api/init.rst:350 msgid "PyEval_InitThreads()" msgstr "PyEval_InitThreads()" @@ -3273,19 +3588,19 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:350 ../../c-api/init.rst:712 ../../c-api/init.rst:1228 -#: ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:1829 ../../c-api/init.rst:1928 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1829 ../../c-api/init.rst:1928 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1829 ../../c-api/init.rst:1928 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1829 ../../c-api/init.rst:1928 msgid "sys" msgstr "sys" @@ -3297,7 +3612,7 @@ msgstr "search(搜尋)" msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1836 ../../c-api/init.rst:1889 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1893 ../../c-api/init.rst:1946 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" @@ -3393,23 +3708,23 @@ msgstr "PyEval_RestoreThread()" msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:1829 ../../c-api/init.rst:1928 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:1829 ../../c-api/init.rst:1928 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:1829 ../../c-api/init.rst:1928 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1836 +#: ../../c-api/init.rst:1893 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1866 +#: ../../c-api/init.rst:1923 msgid "close (in module os)" msgstr "close(os 模組中)" diff --git a/howto/a-conceptual-overview-of-asyncio.po b/howto/a-conceptual-overview-of-asyncio.po index 9fdca88cc0..d07c49702c 100644 --- a/howto/a-conceptual-overview-of-asyncio.po +++ b/howto/a-conceptual-overview-of-asyncio.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 00:16+0000\n" +"POT-Creation-Date: 2025-11-26 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -312,12 +312,14 @@ msgstr "" #: ../../howto/a-conceptual-overview-of-asyncio.rst:178 msgid "" -"Since there's only one event loop (in each thread), :mod:`!asyncio` takes " -"care of associating the task with the event loop for you. As such, there's " -"no need to specify the event loop." +":mod:`!asyncio` automatically associates tasks with the event loop for you. " +"This automatic association was purposely designed into :mod:`!asyncio` for " +"the sake of simplicity. Without it, you'd have to keep track of the event " +"loop object and pass it to any coroutine function that wants to create " +"tasks, adding redundant clutter to your code." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:184 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:187 msgid "" "coroutine = loudmouth_penguin(magic_number=5)\n" "# This creates a Task object and schedules its execution via the event " @@ -325,7 +327,7 @@ msgid "" "task = asyncio.create_task(coroutine)" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:188 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:191 msgid "" "Earlier, we manually created the event loop and set it to run forever. In " "practice, it's recommended to use (and common to see) :func:`asyncio.run`, " @@ -334,7 +336,7 @@ msgid "" "this setup::" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:194 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:197 msgid "" "import asyncio\n" "\n" @@ -349,7 +351,7 @@ msgid "" " print(\"coroutine main() is done!\")" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:206 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:209 msgid "" "It's important to be aware that the task itself is not added to the event " "loop, only a callback to the task is. This matters if the task object you " @@ -357,7 +359,7 @@ msgid "" "example, consider this program:" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:212 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:215 msgid "" "async def hello():\n" " print(\"hello!\")\n" @@ -371,7 +373,7 @@ msgid "" "asyncio.run(main())" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:226 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:229 msgid "" "Because there's no reference to the task object created on line 5, it " "*might* be garbage collected before the event loop invokes it. Later " @@ -385,17 +387,17 @@ msgid "" "doesn't happen. But that's no reason to be reckless!" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:242 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:245 msgid "await" msgstr "await" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:244 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:247 msgid "" ":keyword:`await` is a Python keyword that's commonly used in one of two " "different ways::" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:247 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:250 msgid "" "await task\n" "await coroutine" @@ -403,20 +405,20 @@ msgstr "" "await task\n" "await coroutine" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:250 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:253 msgid "" "In a crucial way, the behavior of ``await`` depends on the type of object " "being awaited." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:253 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:256 msgid "" "Awaiting a task will cede control from the current task or coroutine to the " "event loop. In the process of relinquishing control, a few important things " "happen. We'll use the following code example to illustrate::" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:258 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:261 msgid "" "async def plant_a_tree():\n" " dig_the_hole_task = asyncio.create_task(dig_the_hole())\n" @@ -426,7 +428,7 @@ msgid "" " ..." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:265 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:268 msgid "" "In this example, imagine the event loop has passed control to the start of " "the coroutine ``plant_a_tree()``. As seen above, the coroutine creates a " @@ -439,21 +441,21 @@ msgid "" "this case, a call to resume ``plant_a_tree()``." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:276 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:279 msgid "" "Generally speaking, when the awaited task finishes (``dig_the_hole_task``), " "the original task or coroutine (``plant_a_tree()``) is added back to the " "event loop's to-do list to be resumed." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:280 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:283 msgid "" "This is a basic, yet reliable mental model. In practice, the control " "handoffs are slightly more complex, but not by much. In part 2, we'll walk " "through the details that make this possible." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:284 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:287 msgid "" "**Unlike tasks, awaiting a coroutine does not hand control back to the event " "loop!** Wrapping a coroutine in a task first, then awaiting that would cede " @@ -461,7 +463,7 @@ msgid "" "invoking a regular, synchronous Python function. Consider this program::" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:292 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:295 msgid "" "import asyncio\n" "\n" @@ -497,7 +499,7 @@ msgstr "" "\n" "asyncio.run(main())" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:309 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:312 msgid "" "The first statement in the coroutine ``main()`` creates ``task_b`` and " "schedules it for execution via the event loop. Then, ``coro_a()`` is " @@ -506,7 +508,7 @@ msgid "" "output:" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:315 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:318 msgid "" "I am coro_a(). Hi!\n" "I am coro_a(). Hi!\n" @@ -518,7 +520,7 @@ msgstr "" "I am coro_a(). Hi!\n" "I am coro_b(). I sure hope no one hogs the event loop..." -#: ../../howto/a-conceptual-overview-of-asyncio.rst:322 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:325 msgid "" "If we change ``await coro_a()`` to ``await asyncio.create_task(coro_a())``, " "the behavior changes. The coroutine ``main()`` cedes control to the event " @@ -527,7 +529,7 @@ msgid "" "before resuming the coroutine ``main()``." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:329 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:332 msgid "" "I am coro_b(). I sure hope no one hogs the event loop...\n" "I am coro_a(). Hi!\n" @@ -539,7 +541,7 @@ msgstr "" "I am coro_a(). Hi!\n" "I am coro_a(). Hi!" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:336 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:339 msgid "" "This behavior of ``await coroutine`` can trip a lot of people up! That " "example highlights how using only ``await coroutine`` could unintentionally " @@ -550,7 +552,7 @@ msgid "" "longer." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:346 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:349 msgid "" "The design intentionally trades off some conceptual clarity around usage of " "``await`` for improved performance. Each time a task is awaited, control " @@ -559,11 +561,11 @@ msgid "" "a deep call stack, that overhead can add up to a meaningful performance drag." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:355 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:358 msgid "A conceptual overview part 2: the nuts and bolts" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:357 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:360 msgid "" "Part 2 goes into detail on the mechanisms :mod:`!asyncio` uses to manage " "control flow. This is where the magic happens. You'll come away from this " @@ -571,15 +573,15 @@ msgid "" "own asynchronous operators." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:365 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:368 msgid "The inner workings of coroutines" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:367 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:370 msgid ":mod:`!asyncio` leverages four components to pass around control." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:369 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:372 msgid "" ":meth:`coroutine.send(arg) ` is the method used to start or " "resume a coroutine. If the coroutine was paused and is now being resumed, " @@ -588,7 +590,7 @@ msgid "" "first time (as opposed to being resumed), ``arg`` must be ``None``." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:377 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:380 msgid "" "class Rock:\n" " def __await__(self):\n" @@ -642,7 +644,7 @@ msgstr "" " returned_value = e.value\n" "print(f\"Coroutine main() finished and provided value: {returned_value}.\")" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:405 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:408 msgid "" ":ref:`yield `, as usual, pauses execution and returns control to " "the caller. In the example above, the ``yield``, on line 3, is called by " @@ -653,7 +655,7 @@ msgid "" "coroutine.send(None)`` on line 16." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:415 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:418 msgid "" "The coroutine is resumed via the ``coroutine.send(42)`` call on line 21. The " "coroutine picks back up from where it ``yield``\\ ed (or paused) on line 3 " @@ -662,11 +664,11 @@ msgid "" "attached in the :attr:`~StopIteration.value` attribute." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:421 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:424 msgid "That snippet produces this output:" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:423 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:426 msgid "" "Beginning coroutine main().\n" "Awaiting rock...\n" @@ -684,28 +686,28 @@ msgstr "" "Coroutine received value: 42 from rock.\n" "Coroutine main() finished and provided value: 23." -#: ../../howto/a-conceptual-overview-of-asyncio.rst:433 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:436 msgid "" "It's worth pausing for a moment here and making sure you followed the " "various ways that control flow and values were passed. A lot of important " "ideas were covered and it's worth ensuring your understanding is firm." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:437 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:440 msgid "" "The only way to yield (or effectively cede control) from a coroutine is to " "``await`` an object that ``yield``\\ s in its ``__await__`` method. That " "might sound odd to you. You might be thinking:" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:441 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:444 msgid "" "1. What about a ``yield`` directly within the coroutine function? The " "coroutine function becomes an :ref:`async generator function `, a different beast entirely." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:446 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:449 msgid "" "2. What about a :ref:`yield from ` within the coroutine function " "to a (plain) generator? That causes the error: ``SyntaxError: yield from not " @@ -716,11 +718,11 @@ msgid "" "same thing." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:457 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:460 msgid "Futures" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:459 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:462 msgid "" "A :ref:`future ` is an object meant to represent a " "computation's status and result. The term is a nod to the idea of something " @@ -728,7 +730,7 @@ msgid "" "that something." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:464 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:467 msgid "" "A future has a few important attributes. One is its state, which can be " "either \"pending\", \"cancelled\", or \"done\". Another is its result, which " @@ -738,7 +740,7 @@ msgid "" "yellow, or green) or indicator." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:471 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:474 msgid "" ":class:`asyncio.Task` subclasses :class:`asyncio.Future` in order to gain " "these various capabilities. The prior section said tasks store a list of " @@ -746,7 +748,7 @@ msgid "" "class that implements this logic, which ``Task`` inherits." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:478 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:481 msgid "" "Futures may also be used directly (not via tasks). Tasks mark themselves as " "done when their coroutine is complete. Futures are much more versatile and " @@ -754,18 +756,18 @@ msgid "" "interface for you to make your own conditions for waiting and resuming." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:486 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:489 msgid "A homemade asyncio.sleep" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:488 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:491 msgid "" "We'll go through an example of how you could leverage a future to create " "your own variant of asynchronous sleep (``async_sleep``) which mimics :func:" "`asyncio.sleep`." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:492 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:495 msgid "" "This snippet registers a few tasks with the event loop and then awaits the " "task created by ``asyncio.create_task``, which wraps the ``async_sleep(3)`` " @@ -773,7 +775,7 @@ msgid "" "elapsed, but without preventing other tasks from running." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:499 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:502 msgid "" "async def other_work():\n" " print(\"I like work. Work work.\")\n" @@ -799,7 +801,7 @@ msgid "" " await asyncio.gather(*work_tasks)" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:523 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:526 msgid "" "Below, we use a future to enable custom control over when that task will be " "marked as done. If :meth:`future.set_result() ` " @@ -809,7 +811,7 @@ msgid "" "elapsed and, accordingly, call ``future.set_result()``." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:534 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:537 msgid "" "async def async_sleep(seconds: float):\n" " future = asyncio.Future()\n" @@ -821,7 +823,7 @@ msgid "" " await future" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:542 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:545 msgid "" "Below, we use a rather bare ``YieldToEventLoop()`` object to ``yield`` from " "its ``__await__`` method, ceding control to the event loop. This is " @@ -830,7 +832,7 @@ msgid "" "sleep`` when showcasing how to implement it!" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:548 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:551 msgid "" "As usual, the event loop cycles through its tasks, giving them control and " "receiving control back when they pause or finish. The ``watcher_task``, " @@ -845,7 +847,7 @@ msgid "" "true of ``asyncio.sleep``." msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:564 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:567 msgid "" "class YieldToEventLoop:\n" " def __await__(self):\n" @@ -861,11 +863,11 @@ msgid "" " await YieldToEventLoop()" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:577 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:580 msgid "Here is the full program's output:" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:579 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:582 msgid "" "$ python custom-async-sleep.py\n" "Beginning asynchronous sleep at time: 14:52:22.\n" @@ -881,7 +883,7 @@ msgstr "" "I like work. Work work.\n" "Done asynchronous sleep at time: 14:52:25." -#: ../../howto/a-conceptual-overview-of-asyncio.rst:588 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:591 msgid "" "You might feel this implementation of asynchronous sleep was unnecessarily " "convoluted. And, well, it was. The example was meant to showcase the " @@ -890,7 +892,7 @@ msgid "" "so::" msgstr "" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:595 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:598 msgid "" "async def simpler_async_sleep(seconds):\n" " time_to_wake = time.time() + seconds\n" @@ -908,7 +910,7 @@ msgstr "" " else:\n" " await YieldToEventLoop()" -#: ../../howto/a-conceptual-overview-of-asyncio.rst:603 +#: ../../howto/a-conceptual-overview-of-asyncio.rst:606 msgid "" "But that's all for now. Hopefully you're ready to more confidently dive into " "some async programming or check out advanced topics in the :mod:`rest of the " diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index 9e939d1eb8..f460273f04 100644 --- a/whatsnew/3.14.po +++ b/whatsnew/3.14.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-17 00:14+0000\n" +"POT-Creation-Date: 2025-11-26 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -279,7 +279,9 @@ msgstr "" msgid "" "(Contributed by Jelle Zijlstra in :pep:`749` and :gh:`119180`; :pep:`649` " "was written by Larry Hastings.)" -msgstr "(由 Jelle Zijlstra 於 :pep:`749` 和 :gh:`119180` 貢獻;:pep:`649` 由 Larry Hastings 撰寫。)" +msgstr "" +"(由 Jelle Zijlstra 於 :pep:`749` 和 :gh:`119180` 貢獻;:pep:`649` 由 Larry " +"Hastings 撰寫。)" #: ../../whatsnew/3.14.rst:194 msgid ":pep:`649`" @@ -1377,7 +1379,8 @@ msgstr "" msgid "" "(Contributed by Pablo Galindo and Brett Cannon in :pep:`758` and :gh:" "`131831`.)" -msgstr "(由 Pablo Galindo 和 Brett Cannon 於 :pep:`758` 和 :gh:`131831` 貢獻。)" +msgstr "" +"(由 Pablo Galindo 和 Brett Cannon 於 :pep:`758` 和 :gh:`131831` 貢獻。)" #: ../../whatsnew/3.14.rst:934 msgid "PEP 765: Control flow in :keyword:`finally` blocks" @@ -3022,10 +3025,10 @@ msgid "" "helpers like :func:`~typing.get_origin` and :func:`typing.get_args` instead " "of relying on private implementation details." msgstr "" -"在過去,舊式聯集是使用私有類別 ``typing._UnionGenericAlias`` 實" -"作的。這個類別不再被需要,但為了向後相容性而保留,並計劃將在 Python 3.17 中移" -"除。使用者應該改用文件中記錄的自我檢查輔助函式,例如 :func:`~typing.get_origin` " -"和 :func:`typing.get_args`,或者依賴私有實作細節。" +"在過去,舊式聯集是使用私有類別 ``typing._UnionGenericAlias`` 實作的。這個類別" +"不再被需要,但為了向後相容性而保留,並計劃將在 Python 3.17 中移除。使用者應該" +"改用文件中記錄的自我檢查輔助函式,例如 :func:`~typing.get_origin` 和 :func:" +"`typing.get_args`,或者依賴私有實作細節。" #: ../../whatsnew/3.14.rst:2007 msgid "" @@ -3575,7 +3578,8 @@ msgid "" "There's a few patterns that use :func:`asyncio.get_event_loop`, most of them " "can be replaced with :func:`asyncio.run`." msgstr "" -"有一些使用 :func:`asyncio.get_event_loop` 的模式,其中大多數可以用 :func:`asyncio.run` 取代。" +"有一些使用 :func:`asyncio.get_event_loop` 的模式,其中大多數可以用 :func:" +"`asyncio.run` 取代。" #: ../../whatsnew/3.14.rst:2381 msgid "If you're running an async function, simply use :func:`asyncio.run`." @@ -3630,8 +3634,8 @@ msgid "" "If you need to start something, for example, a server listening on a socket " "and then run forever, use :func:`asyncio.run` and an :class:`asyncio.Event`." msgstr "" -"如果你需要啟動某些東西然後永遠運行,像是監聽 socket 的伺服器,請使用 :func:`asyncio.run` " -"和 :class:`asyncio.Event`。" +"如果你需要啟動某些東西然後永遠運行,像是監聽 socket 的伺服器,請使用 :func:" +"`asyncio.run` 和 :class:`asyncio.Event`。" #: ../../whatsnew/3.14.rst:2412 msgid "" @@ -3676,7 +3680,8 @@ msgid "" "If you need to run something in an event loop, then run some blocking code " "around it, use :class:`asyncio.Runner`." msgstr "" -"如果你需要在事件迴圈中運行某些東西,然後在其周圍運行一些阻塞程式碼,請使用 :class:`asyncio.Runner`。" +"如果你需要在事件迴圈中運行某些東西,然後在其周圍運行一些阻塞程式碼,請使用 :" +"class:`asyncio.Runner`。" #: ../../whatsnew/3.14.rst:2440 msgid "" @@ -3868,8 +3873,9 @@ msgid "" "passed as a single positional argument. (Contributed by Serhiy Storchaka in :" "gh:`109218`.)" msgstr "" -"在 :func:`complex` 建構函式中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" -"複數應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" +"在 :func:`complex` 建構函式中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄" +"用;複數應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢" +"獻。)" #: ../../whatsnew/3.14.rst:2576 #: ../../deprecations/pending-removal-in-future.rst:7 @@ -3986,8 +3992,8 @@ msgid "" "be removed in a future version of Python. Use :func:`open` instead. " "(Contributed by Inada Naoki in :gh:`133036`.)" msgstr "" -":mod:`codecs`: :func:`codecs.open` 函式已被棄用,並將在未來的 Python 版本中移除。請改用 :func:`open`。" -"(由 Inada Naoki 於 :gh:`133036` 貢獻。)" +":mod:`codecs`: :func:`codecs.open` 函式已被棄用,並將在未來的 Python 版本中移" +"除。請改用 :func:`open`。(由 Inada Naoki 於 :gh:`133036` 貢獻。)" #: ../../whatsnew/3.14.rst:2627 #: ../../deprecations/pending-removal-in-3.15.rst:16 @@ -4020,8 +4026,8 @@ msgid "" "(Contributed by Kirill Podoprigora in :gh:`121676`.)" msgstr "" ":mod:`functools`: 使用 *function* 或 *sequence* 關鍵字引數呼叫 :func:" -"`functools.reduce` 的 Python 實作已被棄用;這些參數將在 Python 3.16 中變為僅限位置引數。" -"(由 Kirill Podoprigora 於 :gh:`121676` 貢獻。)" +"`functools.reduce` 的 Python 實作已被棄用;這些參數將在 Python 3.16 中變為僅" +"限位置引數。(由 Kirill Podoprigora 於 :gh:`121676` 貢獻。)" #: ../../whatsnew/3.14.rst:2647 msgid "" @@ -4030,8 +4036,9 @@ msgid "" "with the *stream* argument instead. (Contributed by Mariusz Felisiak in :gh:" "`115032`.)" msgstr "" -":mod:`logging`: 對具有 *strm* 引數的自訂日誌記錄處理函式的支援已被棄用,並計劃在 Python 3.16 " -"中移除。請改為使用 *stream* 引數來定義處理函式。(由 Mariusz Felisiak 於 :gh:`115032` 貢獻。)" +":mod:`logging`: 對具有 *strm* 引數的自訂日誌記錄處理函式的支援已被棄用,並計" +"劃在 Python 3.16 中移除。請改為使用 *stream* 引數來定義處理函式。(由 " +"Mariusz Felisiak 於 :gh:`115032` 貢獻。)" #: ../../whatsnew/3.14.rst:2653 msgid "" @@ -4040,9 +4047,9 @@ msgid "" "and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van " "Kemenade in :gh:`75223`.)" msgstr "" -":mod:`mimetypes`: 有效的副檔名為空字串或對 :meth:`mimetypes.MimeTypes.add_type` 以 '.' 開頭。未" -"加點的副檔名已被棄用,並將在 Python 3.16 中引發 :exc:`ValueError`。(由 Hugo " -"van Kemenade 於 :gh:`75223` 貢獻。)" +":mod:`mimetypes`: 有效的副檔名為空字串或對 :meth:`mimetypes.MimeTypes." +"add_type` 以 '.' 開頭。未加點的副檔名已被棄用,並將在 Python 3.16 中引發 :" +"exc:`ValueError`。(由 Hugo van Kemenade 於 :gh:`75223` 貢獻。)" #: ../../whatsnew/3.14.rst:2660 msgid "" @@ -4523,10 +4530,10 @@ msgid "" "that explicitly specifies the types your code supports (e.g., ``bytes | " "bytearray | memoryview``)." msgstr "" -"使用 ``isinstance(obj, collections.abc.Buffer)`` 來測試 ``obj`` 是否在 runtime " -"實作了\\ :ref:`緩衝區協定 `。在型別註解的使用中,請用 :class:`~" -"collections.abc.Buffer` 或明確指定你的程式碼所支援型別的聯集(例如 " -"``bytes | bytearray | memoryview``)。" +"使用 ``isinstance(obj, collections.abc.Buffer)`` 來測試 ``obj`` 是否在 " +"runtime 實作了\\ :ref:`緩衝區協定 `。在型別註解的使用中,請" +"用 :class:`~collections.abc.Buffer` 或明確指定你的程式碼所支援型別的聯集(例" +"如 ``bytes | bytearray | memoryview``)。" #: ../../deprecations/pending-removal-in-3.17.rst:14 #: ../../deprecations/pending-removal-in-3.17.rst:42 @@ -4539,10 +4546,11 @@ msgid "" "also never understood as subtypes of :class:`!ByteString` (either at runtime " "or by static type checkers)." msgstr "" -":class:`!ByteString` 最初被設計為一個抽象類別,以作為 :class:`bytes` 和 :class:`bytearray` " -"的超型別 (supertype)。然而由於 ABC 從未擁有任何方法,知道一個物件是 :class:`!ByteString` 的" -"實例從未真正告訴你任何關於該物件的有用資訊。其他常見的緩衝區型別如 :class:`memoryview` " -"也從未被理解為 :class:`!ByteString` 的子型別(無論是在 runtime 還是由靜態型別檢查器)。" +":class:`!ByteString` 最初被設計為一個抽象類別,以作為 :class:`bytes` 和 :" +"class:`bytearray` 的超型別 (supertype)。然而由於 ABC 從未擁有任何方法,知道一" +"個物件是 :class:`!ByteString` 的實例從未真正告訴你任何關於該物件的有用資訊。" +"其他常見的緩衝區型別如 :class:`memoryview` 也從未被理解為 :class:`!" +"ByteString` 的子型別(無論是在 runtime 還是由靜態型別檢查器)。" #: ../../deprecations/pending-removal-in-3.17.rst:22 #: ../../deprecations/pending-removal-in-3.17.rst:50 @@ -4550,7 +4558,8 @@ msgid "" "See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by " "Shantanu Jain in :gh:`91896`.)" msgstr "" -"更多細節請見 :pep:`PEP 688 <688#current-options>`。(由 Shantanu Jain 於 :gh:`91896` 貢獻。)" +"更多細節請見 :pep:`PEP 688 <688#current-options>`。(由 Shantanu Jain 於 :gh:" +"`91896` 貢獻。)" #: ../../deprecations/pending-removal-in-3.17.rst:28 msgid "" @@ -4571,7 +4580,8 @@ msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " "removal in Python 3.17." msgstr "" -":class:`typing.ByteString` 自 Python 3.9 起已被棄用,預計在 Python 3.17 中移除。" +":class:`typing.ByteString` 自 Python 3.9 起已被棄用,預計在 Python 3.17 中移" +"除。" #: ../../deprecations/pending-removal-in-3.19.rst:2 msgid "Pending removal in Python 3.19" @@ -6775,7 +6785,8 @@ msgstr "``_PyUnicode_Equal()``: :c:func:`PyUnicode_Equal`" #: ../../whatsnew/3.14.rst:3429 msgid "" "``_Py_GetConfig()``: :c:func:`PyConfig_Get` and :c:func:`PyConfig_GetInt`" -msgstr "``_Py_GetConfig()``: :c:func:`PyConfig_Get` 和 :c:func:`PyConfig_GetInt`" +msgstr "" +"``_Py_GetConfig()``: :c:func:`PyConfig_Get` 和 :c:func:`PyConfig_GetInt`" #: ../../whatsnew/3.14.rst:3430 msgid "``_Py_HashBytes()``: :c:func:`Py_HashBuffer`" @@ -6793,4 +6804,18 @@ msgstr "``PyMutex_IsLocked()`` : :c:func:`PyMutex_IsLocked`" msgid "" "The `pythoncapi-compat project`_ can be used to get most of these new " "functions on Python 3.13 and older." -msgstr "`pythoncapi-compat project`_ 可以用來在 Python 3.13 和更早版本中獲得這些新函式。" +msgstr "" +"`pythoncapi-compat project`_ 可以用來在 Python 3.13 和更早版本中獲得這些新函" +"式。" + +#: ../../whatsnew/3.14.rst:3441 +msgid "Notable changes in 3.14.1" +msgstr "" + +#: ../../whatsnew/3.14.rst:3443 +msgid "" +"Add :c:func:`PyUnstable_ThreadState_SetStackProtection` and :c:func:" +"`PyUnstable_ThreadState_ResetStackProtection` functions to set the stack " +"protection base address and stack protection size of a Python thread state. " +"(Contributed by Victor Stinner in :gh:`139653`.)" +msgstr "" From ee1b3a461536114a1189448957748254163bbd0a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 27 Nov 2025 00:15:41 +0000 Subject: [PATCH 06/13] sync with cpython f47e9285 --- c-api/module.po | 148 ++++++++++++++++++++++++------------------------ 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/c-api/module.po b/c-api/module.po index 2c15f9d411..71f6d4b155 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-07 13:39+0000\n" +"POT-Creation-Date: 2025-11-27 00:14+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -49,8 +49,8 @@ msgid "" "setting a :attr:`~module.__file__` attribute." msgstr "" -#: ../../c-api/module.rst:46 ../../c-api/module.rst:430 -#: ../../c-api/module.rst:457 +#: ../../c-api/module.rst:46 ../../c-api/module.rst:434 +#: ../../c-api/module.rst:461 msgid "Return ``NULL`` with an exception set on error." msgstr "在失敗時回傳 ``NULL`` 並設定例外。" @@ -371,7 +371,7 @@ msgid "" "``Py_mod_create``." msgstr "" -#: ../../c-api/module.rst:333 +#: ../../c-api/module.rst:335 msgid "" "Specifies a function that is called to *execute* the module. This is " "equivalent to executing the code of a Python module: typically, this " @@ -379,61 +379,61 @@ msgid "" "function is:" msgstr "" -#: ../../c-api/module.rst:342 +#: ../../c-api/module.rst:344 msgid "" "If multiple ``Py_mod_exec`` slots are specified, they are processed in the " "order they appear in the *m_slots* array." msgstr "" -#: ../../c-api/module.rst:347 ../../c-api/module.rst:380 +#: ../../c-api/module.rst:351 ../../c-api/module.rst:384 msgid "Specifies one of the following values:" msgstr "" -#: ../../c-api/module.rst:353 +#: ../../c-api/module.rst:357 msgid "The module does not support being imported in subinterpreters." msgstr "" -#: ../../c-api/module.rst:357 +#: ../../c-api/module.rst:361 msgid "" "The module supports being imported in subinterpreters, but only when they " "share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" -#: ../../c-api/module.rst:363 +#: ../../c-api/module.rst:367 msgid "" "The module supports being imported in subinterpreters, even when they have " "their own GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" -#: ../../c-api/module.rst:367 +#: ../../c-api/module.rst:371 msgid "" "This slot determines whether or not importing this module in a " "subinterpreter will fail." msgstr "" -#: ../../c-api/module.rst:370 +#: ../../c-api/module.rst:374 msgid "" "Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " "module definition." msgstr "" -#: ../../c-api/module.rst:373 +#: ../../c-api/module.rst:377 msgid "" "If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " "defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``." msgstr "" -#: ../../c-api/module.rst:386 +#: ../../c-api/module.rst:390 msgid "" "The module depends on the presence of the global interpreter lock (GIL), and " "may access global state without synchronization." msgstr "" -#: ../../c-api/module.rst:391 +#: ../../c-api/module.rst:395 msgid "The module is safe to run without an active GIL." msgstr "" -#: ../../c-api/module.rst:393 +#: ../../c-api/module.rst:397 msgid "" "This slot is ignored by Python builds not configured with :option:`--disable-" "gil`. Otherwise, it determines whether or not importing this module will " @@ -441,22 +441,22 @@ msgid "" "threaded-cpython` for more detail." msgstr "" -#: ../../c-api/module.rst:398 +#: ../../c-api/module.rst:402 msgid "" "Multiple ``Py_mod_gil`` slots may not be specified in one module definition." msgstr "" -#: ../../c-api/module.rst:400 +#: ../../c-api/module.rst:404 msgid "" "If ``Py_mod_gil`` is not specified, the import machinery defaults to " "``Py_MOD_GIL_USED``." msgstr "" -#: ../../c-api/module.rst:409 +#: ../../c-api/module.rst:413 msgid "Creating extension modules dynamically" msgstr "" -#: ../../c-api/module.rst:411 +#: ../../c-api/module.rst:415 msgid "" "The following functions may be used to create a module outside of an " "extension's :ref:`initialization function `. They are " @@ -464,7 +464,7 @@ msgid "" "initialization>`." msgstr "" -#: ../../c-api/module.rst:418 +#: ../../c-api/module.rst:422 msgid "" "Create a new module object, given the definition in *def*. This is a macro " "that calls :c:func:`PyModule_Create2` with *module_api_version* set to :c:" @@ -472,33 +472,33 @@ msgid "" "the :ref:`limited API `." msgstr "" -#: ../../c-api/module.rst:426 +#: ../../c-api/module.rst:430 msgid "" "Create a new module object, given the definition in *def*, assuming the API " "version *module_api_version*. If that version does not match the version of " "the running interpreter, a :exc:`RuntimeWarning` is emitted." msgstr "" -#: ../../c-api/module.rst:432 +#: ../../c-api/module.rst:436 msgid "" "This function does not support slots. The :c:member:`~PyModuleDef.m_slots` " "member of *def* must be ``NULL``." msgstr "" -#: ../../c-api/module.rst:438 +#: ../../c-api/module.rst:442 msgid "" "Most uses of this function should be using :c:func:`PyModule_Create` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:443 +#: ../../c-api/module.rst:447 msgid "" "This macro calls :c:func:`PyModule_FromDefAndSpec2` with " "*module_api_version* set to :c:macro:`PYTHON_API_VERSION`, or to :c:macro:" "`PYTHON_ABI_VERSION` if using the :ref:`limited API `." msgstr "" -#: ../../c-api/module.rst:452 +#: ../../c-api/module.rst:456 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*, assuming the API version *module_api_version*. If that version does " @@ -506,42 +506,42 @@ msgid "" "emitted." msgstr "" -#: ../../c-api/module.rst:459 +#: ../../c-api/module.rst:463 msgid "" "Note that this does not process execution slots (:c:data:`Py_mod_exec`). " "Both ``PyModule_FromDefAndSpec`` and ``PyModule_ExecDef`` must be called to " "fully initialize a module." msgstr "" -#: ../../c-api/module.rst:465 +#: ../../c-api/module.rst:469 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:472 +#: ../../c-api/module.rst:476 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:478 +#: ../../c-api/module.rst:482 msgid "The C API version. Defined for backwards compatibility." msgstr "" -#: ../../c-api/module.rst:480 ../../c-api/module.rst:487 +#: ../../c-api/module.rst:484 ../../c-api/module.rst:491 msgid "" "Currently, this constant is not updated in new Python versions, and is not " "useful for versioning. This may change in the future." msgstr "" -#: ../../c-api/module.rst:485 +#: ../../c-api/module.rst:489 msgid "Defined as ``3`` for backwards compatibility." msgstr "" -#: ../../c-api/module.rst:492 +#: ../../c-api/module.rst:496 msgid "Support functions" msgstr "支援的函式" -#: ../../c-api/module.rst:494 +#: ../../c-api/module.rst:498 msgid "" "The following functions are provided to help initialize a module state. They " "are intended for a module's execution slots (:c:data:`Py_mod_exec`), the " @@ -549,23 +549,23 @@ msgid "" "phase-initialization>`, or code that creates modules dynamically." msgstr "" -#: ../../c-api/module.rst:502 +#: ../../c-api/module.rst:506 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function." msgstr "" -#: ../../c-api/module.rst:505 +#: ../../c-api/module.rst:509 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:507 ../../c-api/module.rst:558 -#: ../../c-api/module.rst:585 +#: ../../c-api/module.rst:511 ../../c-api/module.rst:562 +#: ../../c-api/module.rst:589 msgid "Example usage::" msgstr "用法範例: ::" -#: ../../c-api/module.rst:509 +#: ../../c-api/module.rst:513 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -591,20 +591,20 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:521 +#: ../../c-api/module.rst:525 msgid "" "To be convenient, the function accepts ``NULL`` *value* with an exception " "set. In this case, return ``-1`` and just leave the raised exception " "unchanged." msgstr "" -#: ../../c-api/module.rst:525 +#: ../../c-api/module.rst:529 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: ../../c-api/module.rst:528 +#: ../../c-api/module.rst:532 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -624,13 +624,13 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:537 +#: ../../c-api/module.rst:541 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:540 +#: ../../c-api/module.rst:544 msgid "" "The number of different *name* strings passed to this function should be " "kept small, usually by only using statically allocated strings as *name*. " @@ -640,7 +640,7 @@ msgid "" "internally to create a key object." msgstr "" -#: ../../c-api/module.rst:553 +#: ../../c-api/module.rst:557 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to " "*value*. It can be called with a result of function that returns a new " @@ -648,7 +648,7 @@ msgid "" "variable." msgstr "" -#: ../../c-api/module.rst:560 +#: ../../c-api/module.rst:564 msgid "" "if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" " goto error;\n" @@ -658,7 +658,7 @@ msgstr "" " goto error;\n" "}" -#: ../../c-api/module.rst:569 +#: ../../c-api/module.rst:573 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." @@ -666,26 +666,26 @@ msgstr "" "類似於 :c:func:`PyModule_AddObjectRef`,但在成功時(如果回傳 ``0``)會偷走對 " "*value* 的參照。" -#: ../../c-api/module.rst:572 +#: ../../c-api/module.rst:576 msgid "" "The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions " "are recommended, since it is easy to introduce reference leaks by misusing " "the :c:func:`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:579 +#: ../../c-api/module.rst:583 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:582 +#: ../../c-api/module.rst:586 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_XDECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:587 +#: ../../c-api/module.rst:591 msgid "" "PyObject *obj = PyBytes_FromString(value);\n" "if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" @@ -699,25 +699,25 @@ msgid "" "// Py_XDECREF(obj) is not needed here." msgstr "" -#: ../../c-api/module.rst:600 +#: ../../c-api/module.rst:604 msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." msgstr "" ":c:func:`PyModule_AddObject` 已被\\ :term:`軟性棄用 `。" -#: ../../c-api/module.rst:605 +#: ../../c-api/module.rst:609 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` with an " "exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:609 +#: ../../c-api/module.rst:613 msgid "" "This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:" "func:`PyModule_AddObjectRef`; see their documentation for details." msgstr "" -#: ../../c-api/module.rst:615 +#: ../../c-api/module.rst:619 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " @@ -725,14 +725,14 @@ msgid "" "on success." msgstr "" -#: ../../c-api/module.rst:620 +#: ../../c-api/module.rst:624 msgid "" "This is a convenience function that calls :c:func:" "`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their " "documentation for details." msgstr "" -#: ../../c-api/module.rst:627 +#: ../../c-api/module.rst:631 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -740,11 +740,11 @@ msgid "" "with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:635 +#: ../../c-api/module.rst:639 msgid "Add a string constant to *module*." msgstr "將字串常數加入到 *module* 中。" -#: ../../c-api/module.rst:639 +#: ../../c-api/module.rst:643 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -752,7 +752,7 @@ msgid "" "``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:649 +#: ../../c-api/module.rst:653 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -761,7 +761,7 @@ msgid "" "first parameter, making them similar to instance methods on Python classes)." msgstr "" -#: ../../c-api/module.rst:655 +#: ../../c-api/module.rst:659 msgid "" "This function is called automatically when creating a module from " "``PyModuleDef`` (such as when using :ref:`multi-phase-initialization`, " @@ -770,13 +770,13 @@ msgid "" "that case they should call this function directly." msgstr "" -#: ../../c-api/module.rst:662 +#: ../../c-api/module.rst:666 msgid "" "The *functions* array must be statically allocated (or otherwise guaranteed " "to outlive the module object)." msgstr "" -#: ../../c-api/module.rst:669 +#: ../../c-api/module.rst:673 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef`` (such as when " @@ -784,7 +784,7 @@ msgid "" "``PyModule_FromDefAndSpec``)." msgstr "" -#: ../../c-api/module.rst:678 +#: ../../c-api/module.rst:682 msgid "" "Indicate that *module* does or does not support running without the global " "interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " @@ -796,11 +796,11 @@ msgid "" "on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:692 +#: ../../c-api/module.rst:696 msgid "Module lookup (single-phase initialization)" msgstr "" -#: ../../c-api/module.rst:694 +#: ../../c-api/module.rst:698 msgid "" "The legacy :ref:`single-phase initialization ` " "initialization scheme creates singleton modules that can be looked up in the " @@ -808,14 +808,14 @@ msgid "" "retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:699 +#: ../../c-api/module.rst:703 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:704 +#: ../../c-api/module.rst:708 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -824,18 +824,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:711 +#: ../../c-api/module.rst:715 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:714 +#: ../../c-api/module.rst:718 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:716 +#: ../../c-api/module.rst:720 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module " "that uses :ref:`single-phase initialization `, " @@ -847,21 +847,21 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:725 +#: ../../c-api/module.rst:729 msgid "" "If a module was attached previously using the same *def*, it is replaced by " "the new *module*." msgstr "" -#: ../../c-api/module.rst:728 ../../c-api/module.rst:739 +#: ../../c-api/module.rst:732 ../../c-api/module.rst:743 msgid "The caller must have an :term:`attached thread state`." msgstr "" -#: ../../c-api/module.rst:730 +#: ../../c-api/module.rst:734 msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "成功時回傳 ``0``,在失敗時回傳 ``-1`` 並設定例外。" -#: ../../c-api/module.rst:736 +#: ../../c-api/module.rst:740 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return ``-1`` with an exception set on error, ``0`` on success." From de915267b3a731dc689821a3c0d2cd0a153c6cd5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 30 Nov 2025 00:17:52 +0000 Subject: [PATCH 07/13] sync with cpython 3d448061 --- howto/functional.po | 5 +- howto/urllib2.po | 13 +- library/argparse.po | 28 +- library/decimal.po | 51 +- library/socket.po | 563 +++++++++-------- library/ssl.po | 20 +- library/subprocess.po | 320 +++++----- library/xml.sax.handler.po | 174 +++--- library/zipfile.po | 34 +- reference/compound_stmts.po | 16 +- whatsnew/3.4.po | 1143 +++++++++++++++++------------------ 11 files changed, 1172 insertions(+), 1195 deletions(-) diff --git a/howto/functional.po b/howto/functional.po index 85b44dc8cb..aca5629ca5 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-04 00:16+0000\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,8 @@ msgid "Author" msgstr "作者" #: ../../howto/functional.rst:7 -msgid "A. M. Kuchling" +#, fuzzy +msgid "\\A. M. Kuchling" msgstr "A. M. Kuchling" #: ../../howto/functional.rst:0 diff --git a/howto/urllib2.po b/howto/urllib2.po index ed567cbbf0..95508ddb22 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,9 +42,10 @@ msgid "" msgstr "以下這些與 Python 有關的文章說不定能幫到你::" #: ../../howto/urllib2.rst:18 +#, fuzzy msgid "" "`Basic Authentication `_" +"voidspace.org.uk/python/articles/authentication.shtml>`__" msgstr "" "`Basic Authentication `_" @@ -88,10 +89,10 @@ msgid "" "is supplementary to them." msgstr "" "一般情形下 *urlopen* 是非常容易使用的,但當你遇到錯誤或者較複雜的情況下,你可" -"能需要對超文本協定 (HyperText Transfer Protocol) 有一定的了解。最完整且具參考價" -"值的是 :rfc:`2616`,不過它是一份技術文件並不容易閱讀,以下的教學會提供足夠的 " -"HTTP 知識來幫助你使用 *urllib*。這份教學並非要取代 :mod:`urllib.request` 這份" -"文件,你還是會需要它。" +"能需要對超文本協定 (HyperText Transfer Protocol) 有一定的了解。最完整且具參考" +"價值的是 :rfc:`2616`,不過它是一份技術文件並不容易閱讀,以下的教學會提供足夠" +"的 HTTP 知識來幫助你使用 *urllib*。這份教學並非要取代 :mod:`urllib.request` " +"這份文件,你還是會需要它。" #: ../../howto/urllib2.rst:44 msgid "Fetching URLs" diff --git a/library/argparse.po b/library/argparse.po index cfd49a9868..a1d55a211f 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-06 00:14+0000\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1342,9 +1342,8 @@ msgstr "" #: ../../library/argparse.rst:770 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " -"``'store_const'`` used for storing the values ``True`` and ``False`` " -"respectively. In addition, they create default values of ``False`` and " -"``True`` respectively::" +"``'store_const'`` that respectively store the values ``True`` and ``False`` " +"with default values of ``False`` and ``True``::" msgstr "" #: ../../library/argparse.rst:775 @@ -1386,11 +1385,10 @@ msgstr "" #: ../../library/argparse.rst:793 msgid "" -"``'append_const'`` - This stores a list, and appends the value specified by " -"the const_ keyword argument to the list; note that the const_ keyword " -"argument defaults to ``None``. The ``'append_const'`` action is typically " -"useful when multiple arguments need to store constants to the same list. For " -"example::" +"``'append_const'`` - This appends the value specified by the const_ keyword " +"argument to a list; note that the const_ keyword argument defaults to " +"``None``. The ``'append_const'`` action is typically useful when multiple " +"arguments need to store constants to the same list. For example::" msgstr "" #: ../../library/argparse.rst:799 @@ -1413,11 +1411,11 @@ msgstr "" #: ../../library/argparse.rst:805 msgid "" -"``'extend'`` - This stores a list and appends each item from the multi-value " -"argument list to it. The ``'extend'`` action is typically used with the " -"nargs_ keyword argument value ``'+'`` or ``'*'``. Note that when nargs_ is " -"``None`` (the default) or ``'?'``, each character of the argument string " -"will be appended to the list. Example usage::" +"``'extend'`` - This appends each item from a multi-value argument to a list. " +"The ``'extend'`` action is typically used with the nargs_ keyword argument " +"value ``'+'`` or ``'*'``. Note that when nargs_ is ``None`` (the default) or " +"``'?'``, each character of the argument string will be appended to the list. " +"Example usage::" msgstr "" #: ../../library/argparse.rst:813 @@ -1438,7 +1436,7 @@ msgstr "" #: ../../library/argparse.rst:820 msgid "" -"``'count'`` - This counts the number of times a keyword argument occurs. For " +"``'count'`` - This counts the number of times an argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" diff --git a/library/decimal.po b/library/decimal.po index 1f899019fb..7ae695837f 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-19 00:14+0000\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1749,11 +1749,13 @@ msgstr "如果 *x* 是 qNaN 或 sNaN 則回傳 ``True``;否則回傳 ``False`` #: ../../library/decimal.rst:1334 msgid "" "Returns ``True`` if *x* is a normal number; otherwise returns ``False``." -msgstr "如果 *x* 是正規數 (normal number) 則回傳 ``True``;否則回傳 ``False``。" +msgstr "" +"如果 *x* 是正規數 (normal number) 則回傳 ``True``;否則回傳 ``False``。" #: ../../library/decimal.rst:1339 msgid "Returns ``True`` if *x* is a quiet NaN; otherwise returns ``False``." -msgstr "如果 *x* 是安靜型 NaN (quiet NaN) 則回傳 ``True``;否則回傳 ``False``。" +msgstr "" +"如果 *x* 是安靜型 NaN (quiet NaN) 則回傳 ``True``;否則回傳 ``False``。" #: ../../library/decimal.rst:1344 msgid "Returns ``True`` if *x* is negative; otherwise returns ``False``." @@ -1762,7 +1764,8 @@ msgstr "如果 *x* 是負數則回傳 ``True``;否則回傳 ``False``。" #: ../../library/decimal.rst:1349 msgid "" "Returns ``True`` if *x* is a signaling NaN; otherwise returns ``False``." -msgstr "如果 *x* 是訊號型 NaN (signaling NaN) 則回傳 ``True``;否則回傳 ``False``。" +msgstr "" +"如果 *x* 是訊號型 NaN (signaling NaN) 則回傳 ``True``;否則回傳 ``False``。" #: ../../library/decimal.rst:1354 msgid "Returns ``True`` if *x* is subnormal; otherwise returns ``False``." @@ -2635,37 +2638,37 @@ msgstr "" #: ../../library/decimal.rst:2103 msgid "" -"Q. It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way " +"Q: It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way " "to minimize typing when using the interactive interpreter?" msgstr "" #: ../../library/decimal.rst:2106 -msgid "A. Some users abbreviate the constructor to just a single letter:" +msgid "A: Some users abbreviate the constructor to just a single letter:" msgstr "" #: ../../library/decimal.rst:2112 msgid "" -"Q. In a fixed-point application with two decimal places, some inputs have " +"Q: In a fixed-point application with two decimal places, some inputs have " "many places and need to be rounded. Others are not supposed to have excess " "digits and need to be validated. What methods should be used?" msgstr "" #: ../../library/decimal.rst:2116 msgid "" -"A. The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " +"A: The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " "places. If the :const:`Inexact` trap is set, it is also useful for " "validation:" msgstr "" #: ../../library/decimal.rst:2134 msgid "" -"Q. Once I have valid two place inputs, how do I maintain that invariant " +"Q: Once I have valid two place inputs, how do I maintain that invariant " "throughout an application?" msgstr "" #: ../../library/decimal.rst:2137 msgid "" -"A. Some operations like addition, subtraction, and multiplication by an " +"A: Some operations like addition, subtraction, and multiplication by an " "integer will automatically preserve fixed point. Others operations, like " "division and non-integer multiplication, will change the number of decimal " "places and need to be followed-up with a :meth:`~Decimal.quantize` step:" @@ -2679,7 +2682,7 @@ msgstr "" #: ../../library/decimal.rst:2169 msgid "" -"Q. There are many ways to express the same value. The numbers ``200``, " +"Q: There are many ways to express the same value. The numbers ``200``, " "``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " "precisions. Is there a way to transform them to a single recognizable " "canonical value?" @@ -2687,17 +2690,17 @@ msgstr "" #: ../../library/decimal.rst:2174 msgid "" -"A. The :meth:`~Decimal.normalize` method maps all equivalent values to a " +"A: The :meth:`~Decimal.normalize` method maps all equivalent values to a " "single representative:" msgstr "" #: ../../library/decimal.rst:2181 -msgid "Q. When does rounding occur in a computation?" +msgid "Q: When does rounding occur in a computation?" msgstr "" #: ../../library/decimal.rst:2183 msgid "" -"A. It occurs *after* the computation. The philosophy of the decimal " +"A: It occurs *after* the computation. The philosophy of the decimal " "specification is that numbers are considered exact and are created " "independent of the current context. They can even have greater precision " "than current context. Computations process with those exact inputs and then " @@ -2721,13 +2724,13 @@ msgstr "" #: ../../library/decimal.rst:2201 msgid "" -"Q. Some decimal values always print with exponential notation. Is there a " +"Q: Some decimal values always print with exponential notation. Is there a " "way to get a non-exponential representation?" msgstr "" #: ../../library/decimal.rst:2204 msgid "" -"A. For some values, exponential notation is the only way to express the " +"A: For some values, exponential notation is the only way to express the " "number of significant places in the coefficient. For example, expressing " "``5.0E+3`` as ``5000`` keeps the value constant but cannot show the " "original's two-place significance." @@ -2741,12 +2744,12 @@ msgid "" msgstr "" #: ../../library/decimal.rst:2219 -msgid "Q. Is there a way to convert a regular float to a :class:`Decimal`?" +msgid "Q: Is there a way to convert a regular float to a :class:`Decimal`?" msgstr "" #: ../../library/decimal.rst:2221 msgid "" -"A. Yes, any binary floating-point number can be exactly expressed as a " +"A: Yes, any binary floating-point number can be exactly expressed as a " "Decimal though an exact conversion may take more precision than intuition " "would suggest:" msgstr "" @@ -2761,13 +2764,13 @@ msgstr "" #: ../../library/decimal.rst:2230 msgid "" -"Q. Within a complex calculation, how can I make sure that I haven't gotten a " +"Q: Within a complex calculation, how can I make sure that I haven't gotten a " "spurious result because of insufficient precision or rounding anomalies." msgstr "" #: ../../library/decimal.rst:2233 msgid "" -"A. The decimal module makes it easy to test results. A best practice is to " +"A: The decimal module makes it easy to test results. A best practice is to " "re-run calculations using greater precision and with various rounding modes. " "Widely differing results indicate insufficient precision, rounding mode " "issues, ill-conditioned inputs, or a numerically unstable algorithm." @@ -2775,14 +2778,14 @@ msgstr "" #: ../../library/decimal.rst:2238 msgid "" -"Q. I noticed that context precision is applied to the results of operations " +"Q: I noticed that context precision is applied to the results of operations " "but not to the inputs. Is there anything to watch out for when mixing " "values of different precisions?" msgstr "" #: ../../library/decimal.rst:2242 msgid "" -"A. Yes. The principle is that all values are considered to be exact and so " +"A: Yes. The principle is that all values are considered to be exact and so " "is the arithmetic on those values. Only the results are rounded. The " "advantage for inputs is that \"what you type is what you get\". A " "disadvantage is that the results can look odd if you forget that the inputs " @@ -2823,12 +2826,12 @@ msgid "" msgstr "" #: ../../library/decimal.rst:2270 -msgid "Q. Is the CPython implementation fast for large numbers?" +msgid "Q: Is the CPython implementation fast for large numbers?" msgstr "" #: ../../library/decimal.rst:2272 msgid "" -"A. Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of " +"A: Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of " "the decimal module integrate the high speed `libmpdec `_ library for arbitrary precision " "correctly rounded decimal floating-point arithmetic [#]_. ``libmpdec`` uses " diff --git a/library/socket.po b/library/socket.po index 5a2604cb14..b3f1bc74b0 100644 --- a/library/socket.po +++ b/library/socket.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2024-12-30 23:45+0800\n" "Last-Translator: Jay \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,8 +70,8 @@ msgstr "由於是呼叫作業系統的 socket API,某些行為可能會因平 #: ../../library/socket.rst:1688 ../../library/socket.rst:1721 #: ../../library/socket.rst:1734 ../../library/socket.rst:1859 #: ../../library/socket.rst:1903 ../../library/socket.rst:2011 -#: ../../library/socket.rst:2029 ../../library/socket.rst:2113 -#: ../../library/socket.rst:2123 ../../library/socket.rst:2135 +#: ../../library/socket.rst:2029 ../../library/socket.rst:2110 +#: ../../library/socket.rst:2120 ../../library/socket.rst:2132 #: ../../includes/wasm-notavail.rst:3 msgid "Availability" msgstr "可用性" @@ -90,8 +90,8 @@ msgid "" "call and library interface for sockets to Python's object-oriented style: " "the :func:`~socket.socket` function returns a :dfn:`socket object` whose " "methods implement the various socket system calls. Parameter types are " -"somewhat higher-level than in the C interface: as with :meth:`read` " -"and :meth:`write` operations on Python files, buffer allocation on receive " +"somewhat higher-level than in the C interface: as with :meth:`read` and :" +"meth:`write` operations on Python files, buffer allocation on receive " "operations is automatic, and buffer length is implicit on send operations." msgstr "" "Python 的介面是將 Unix 的系統呼叫和 socket 函式庫介面直接轉換成 Python 的物件" @@ -151,7 +151,7 @@ msgid "" msgstr "" #: ../../library/socket.rst:66 ../../library/socket.rst:1308 -#: ../../library/socket.rst:1350 ../../library/socket.rst:2107 +#: ../../library/socket.rst:1350 ../../library/socket.rst:2104 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -167,10 +167,10 @@ msgstr "" msgid "" "For IPv4 addresses, two special forms are accepted instead of a host " "address: ``''`` represents :const:`INADDR_ANY`, which is used to bind to all " -"interfaces, and the string ``''`` " -"represents :const:`INADDR_BROADCAST`. This behavior is not compatible with " -"IPv6, therefore, you may want to avoid these if you intend to support IPv6 " -"with your Python programs." +"interfaces, and the string ``''`` represents :const:" +"`INADDR_BROADCAST`. This behavior is not compatible with IPv6, therefore, " +"you may want to avoid these if you intend to support IPv6 with your Python " +"programs." msgstr "" #: ../../library/socket.rst:83 @@ -293,9 +293,9 @@ msgstr "" #: ../../library/socket.rst:147 msgid "" -"``bdaddr_type`` is an optional integer specifying the address type; one " -"of :const:`BDADDR_BREDR` " -"(default), :const:`BDADDR_LE_PUBLIC`, :const:`BDADDR_LE_RANDOM`." +"``bdaddr_type`` is an optional integer specifying the address type; one of :" +"const:`BDADDR_BREDR` (default), :const:`BDADDR_LE_PUBLIC`, :const:" +"`BDADDR_LE_RANDOM`." msgstr "" #: ../../library/socket.rst:151 @@ -316,8 +316,8 @@ msgstr "" msgid "" "On Linux it accepts an integer ``device_id`` or a tuple ``(device_id, " "[channel])`` where ``device_id`` specifies the number of the Bluetooth " -"device, and ``channel`` is an optional integer specifying the HCI channel " -"(:const:`HCI_CHANNEL_RAW` by default)." +"device, and ``channel`` is an optional integer specifying the HCI channel (:" +"const:`HCI_CHANNEL_RAW` by default)." msgstr "" #: ../../library/socket.rst:164 @@ -537,8 +537,8 @@ msgstr "" #: ../../library/socket.rst:297 msgid "" "Non-blocking mode is supported through :meth:`~socket.setblocking`. A " -"generalization of this based on timeouts is supported " -"through :meth:`~socket.settimeout`." +"generalization of this based on timeouts is supported through :meth:`~socket." +"settimeout`." msgstr "" #: ../../library/socket.rst:303 @@ -564,12 +564,11 @@ msgstr "" #: ../../library/socket.rst:321 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " -"errors, i.e. for functions that use *h_errno* in the POSIX C API, " -"including :func:`gethostbyname_ex` and :func:`gethostbyaddr`. The " -"accompanying value is a pair ``(h_errno, string)`` representing an error " -"returned by a library call. *h_errno* is a numeric value, while *string* " -"represents the description of *h_errno*, as returned by " -"the :c:func:`hstrerror` C function." +"errors, i.e. for functions that use *h_errno* in the POSIX C API, including :" +"func:`gethostbyname_ex` and :func:`gethostbyaddr`. The accompanying value is " +"a pair ``(h_errno, string)`` representing an error returned by a library " +"call. *h_errno* is a numeric value, while *string* represents the " +"description of *h_errno*, as returned by the :c:func:`hstrerror` C function." msgstr "" #: ../../library/socket.rst:329 ../../library/socket.rst:342 @@ -594,10 +593,10 @@ msgstr "" #: ../../library/socket.rst:349 msgid "" "A subclass of :exc:`OSError`, this exception is raised when a timeout occurs " -"on a socket which has had timeouts enabled via a prior call " -"to :meth:`~socket.settimeout` (or implicitly " -"through :func:`~socket.setdefaulttimeout`). The accompanying value is a " -"string whose value is currently always \"timed out\"." +"on a socket which has had timeouts enabled via a prior call to :meth:" +"`~socket.settimeout` (or implicitly through :func:`~socket." +"setdefaulttimeout`). The accompanying value is a string whose value is " +"currently always \"timed out\"." msgstr "" #: ../../library/socket.rst:358 @@ -610,8 +609,8 @@ msgstr "常數" #: ../../library/socket.rst:365 msgid "" -"The AF_* and SOCK_* constants are now :class:`AddressFamily` " -"and :class:`SocketKind` :class:`.IntEnum` collections." +"The AF_* and SOCK_* constants are now :class:`AddressFamily` and :class:" +"`SocketKind` :class:`.IntEnum` collections." msgstr "" #: ../../library/socket.rst:374 @@ -631,8 +630,8 @@ msgstr "" #: ../../library/socket.rst:391 msgid "" -"These constants represent the socket types, used for the second argument " -"to :func:`~socket.socket`. More constants may be available depending on the " +"These constants represent the socket types, used for the second argument to :" +"func:`~socket.socket`. More constants may be available depending on the " "system. (Only :const:`SOCK_STREAM` and :const:`SOCK_DGRAM` appear to be " "generally useful.)" msgstr "" @@ -646,18 +645,18 @@ msgstr "" #: ../../library/socket.rst:405 msgid "" -"`Secure File Descriptor Handling `_ for a more thorough explanation." +"`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" #: ../../library/socket.rst:429 msgid "" "Many constants of these forms, documented in the Unix documentation on " "sockets and/or the IP protocol, are also defined in the socket module. They " -"are generally used in arguments to the :meth:`~socket.setsockopt` " -"and :meth:`~socket.getsockopt` methods of socket objects. In most cases, " -"only those symbols that are defined in the Unix header files are defined; " -"for a few symbols, default values are provided." +"are generally used in arguments to the :meth:`~socket.setsockopt` and :meth:" +"`~socket.getsockopt` methods of socket objects. In most cases, only those " +"symbols that are defined in the Unix header files are defined; for a few " +"symbols, default values are provided." msgstr "" #: ../../library/socket.rst:436 @@ -849,8 +848,8 @@ msgstr "" #: ../../library/socket.rst:690 msgid "" -"Used in the level argument to the :meth:`~socket.setsockopt` " -"and :meth:`~socket.getsockopt` methods of Bluetooth socket objects." +"Used in the level argument to the :meth:`~socket.setsockopt` and :meth:" +"`~socket.getsockopt` methods of Bluetooth socket objects." msgstr "" #: ../../library/socket.rst:693 @@ -913,8 +912,8 @@ msgstr "" #: ../../library/socket.rst:773 msgid "" -"Constant to optimize CPU locality, to be used in conjunction " -"with :data:`SO_REUSEPORT`." +"Constant to optimize CPU locality, to be used in conjunction with :data:" +"`SO_REUSEPORT`." msgstr "" #: ../../library/socket.rst:782 @@ -954,14 +953,14 @@ msgstr "" #: ../../library/socket.rst:841 msgid "" "Create a new socket using the given address family, socket type and protocol " -"number. The address family should be :const:`AF_INET` (the " -"default), :const:`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN`, :const:`AF_PACKET`, " -"or :const:`AF_RDS`. The socket type should be :const:`SOCK_STREAM` (the " -"default), :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other " -"``SOCK_`` constants. The protocol number is usually zero and may be omitted " -"or in the case where the address family is :const:`AF_CAN` the protocol " -"should be one of :const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP` " -"or :const:`CAN_J1939`." +"number. The address family should be :const:`AF_INET` (the default), :const:" +"`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN`, :const:`AF_PACKET`, or :const:" +"`AF_RDS`. The socket type should be :const:`SOCK_STREAM` (the default), :" +"const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` " +"constants. The protocol number is usually zero and may be omitted or in the " +"case where the address family is :const:`AF_CAN` the protocol should be one " +"of :const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP` or :const:" +"`CAN_J1939`." msgstr "" #: ../../library/socket.rst:851 @@ -970,9 +969,9 @@ msgid "" "auto-detected from the specified file descriptor. Auto-detection can be " "overruled by calling the function with explicit *family*, *type*, or *proto* " "arguments. This only affects how Python represents e.g. the return value " -"of :meth:`socket.getpeername` but not the actual OS resource. " -"Unlike :func:`socket.fromfd`, *fileno* will return the same socket and not a " -"duplicate. This may help close a detached socket using :meth:`socket.close`." +"of :meth:`socket.getpeername` but not the actual OS resource. Unlike :func:" +"`socket.fromfd`, *fileno* will return the same socket and not a duplicate. " +"This may help close a detached socket using :meth:`socket.close`." msgstr "" #: ../../library/socket.rst:860 ../../library/socket.rst:1006 @@ -1113,8 +1112,8 @@ msgstr "" msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; if not specified , a default " -"reasonable value is chosen. *reuse_port* dictates whether to set " -"the :data:`SO_REUSEPORT` socket option." +"reasonable value is chosen. *reuse_port* dictates whether to set the :data:" +"`SO_REUSEPORT` socket option." msgstr "" #: ../../library/socket.rst:960 @@ -1167,12 +1166,12 @@ msgstr "" msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " "object's :meth:`~io.IOBase.fileno` method) and build a socket object from " -"the result. Address family, socket type and protocol number are as for " -"the :func:`~socket.socket` function above. The file descriptor should refer " -"to a socket, but this is not checked --- subsequent operations on the object " -"may fail if the file descriptor is invalid. This function is rarely needed, " -"but can be used to get or set socket options on a socket passed to a program " -"as standard input or output (such as a server started by the Unix inet " +"the result. Address family, socket type and protocol number are as for the :" +"func:`~socket.socket` function above. The file descriptor should refer to a " +"socket, but this is not checked --- subsequent operations on the object may " +"fail if the file descriptor is invalid. This function is rarely needed, but " +"can be used to get or set socket options on a socket passed to a program as " +"standard input or output (such as a server started by the Unix inet " "daemon). The socket is assumed to be in blocking mode." msgstr "" @@ -1229,9 +1228,9 @@ msgstr "" #: ../../library/socket.rst:1058 msgid "" "The *flags* argument can be one or several of the ``AI_*`` constants, and " -"will influence how results are computed and returned. For " -"example, :const:`AI_NUMERICHOST` will disable domain name resolution and " -"will raise an error if *host* is a domain name." +"will influence how results are computed and returned. For example, :const:" +"`AI_NUMERICHOST` will disable domain name resolution and will raise an error " +"if *host* is a domain name." msgstr "" #: ../../library/socket.rst:1063 @@ -1246,13 +1245,12 @@ msgstr "``(family, type, proto, canonname, sockaddr)``" msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`~socket.socket` function. *canonname* will be a " -"string representing the canonical name of the *host* " -"if :const:`AI_CANONNAME` is part of the *flags* argument; else *canonname* " -"will be empty. *sockaddr* is a tuple describing a socket address, whose " -"format depends on the returned *family* (a ``(address, port)`` 2-tuple " -"for :const:`AF_INET`, a ``(address, port, flowinfo, scope_id)`` 4-tuple " -"for :const:`AF_INET6`), and is meant to be passed to " -"the :meth:`socket.connect` method." +"string representing the canonical name of the *host* if :const:" +"`AI_CANONNAME` is part of the *flags* argument; else *canonname* will be " +"empty. *sockaddr* is a tuple describing a socket address, whose format " +"depends on the returned *family* (a ``(address, port)`` 2-tuple for :const:" +"`AF_INET`, a ``(address, port, flowinfo, scope_id)`` 4-tuple for :const:" +"`AF_INET6`), and is meant to be passed to the :meth:`socket.connect` method." msgstr "" #: ../../library/socket.rst:1079 @@ -1352,8 +1350,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." msgstr "" -"引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` " -"``socket.gethostbyname``。" +"引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` ``socket." +"gethostbyname``。" #: ../../library/socket.rst:1147 msgid "" @@ -1393,8 +1391,8 @@ msgid "" "(possibly empty) list of alternative host names for the same address, and " "*ipaddrlist* is a list of IPv4/v6 addresses for the same interface on the " "same host (most likely containing only a single address). To find the fully " -"qualified domain name, use the " -"function :func:`getfqdn`. :func:`gethostbyaddr` supports both IPv4 and IPv6." +"qualified domain name, use the function :func:`getfqdn`. :func:" +"`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" #: ../../library/socket.rst:1184 @@ -1402,8 +1400,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." msgstr "" -"引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` " -"``socket.gethostbyaddr``。" +"引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` ``socket." +"gethostbyaddr``。" #: ../../library/socket.rst:1191 msgid "" @@ -1429,17 +1427,16 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." msgstr "" -"引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` " -"``socket.getnameinfo``。" +"引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` ``socket." +"getnameinfo``。" #: ../../library/socket.rst:1208 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " -"suitable for passing as the (optional) third argument to " -"the :func:`~socket.socket` function. This is usually only needed for " -"sockets opened in \"raw\" mode (:const:`SOCK_RAW`); for the normal socket " -"modes, the correct protocol is chosen automatically if the protocol is " -"omitted or zero." +"suitable for passing as the (optional) third argument to the :func:`~socket." +"socket` function. This is usually only needed for sockets opened in \"raw\" " +"mode (:const:`SOCK_RAW`); for the normal socket modes, the correct protocol " +"is chosen automatically if the protocol is omitted or zero." msgstr "" #: ../../library/socket.rst:1219 @@ -1522,9 +1519,9 @@ msgstr "" #: ../../library/socket.rst:1286 msgid "" -"If the IPv4 address string passed to this function is " -"invalid, :exc:`OSError` will be raised. Note that exactly what is valid " -"depends on the underlying C implementation of :c:func:`inet_aton`." +"If the IPv4 address string passed to this function is invalid, :exc:" +"`OSError` will be raised. Note that exactly what is valid depends on the " +"underlying C implementation of :c:func:`inet_aton`." msgstr "" #: ../../library/socket.rst:1290 @@ -1555,17 +1552,17 @@ msgstr "" msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " -"protocol calls for an object of type :c:struct:`in_addr` (similar " -"to :func:`inet_aton`) or :c:struct:`in6_addr`." +"protocol calls for an object of type :c:struct:`in_addr` (similar to :func:" +"`inet_aton`) or :c:struct:`in6_addr`." msgstr "" #: ../../library/socket.rst:1319 msgid "" -"Supported values for *address_family* are currently :const:`AF_INET` " -"and :const:`AF_INET6`. If the IP address string *ip_string* is " -"invalid, :exc:`OSError` will be raised. Note that exactly what is valid " -"depends on both the value of *address_family* and the underlying " -"implementation of :c:func:`inet_pton`." +"Supported values for *address_family* are currently :const:`AF_INET` and :" +"const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" +"`OSError` will be raised. Note that exactly what is valid depends on both " +"the value of *address_family* and the underlying implementation of :c:func:" +"`inet_pton`." msgstr "" #: ../../library/socket.rst:1327 ../../library/socket.rst:1347 @@ -1583,11 +1580,10 @@ msgstr "" #: ../../library/socket.rst:1340 msgid "" -"Supported values for *address_family* are currently :const:`AF_INET` " -"and :const:`AF_INET6`. If the bytes object *packed_ip* is not the correct " -"length for the specified address family, :exc:`ValueError` will be " -"raised. :exc:`OSError` is raised for errors from the call " -"to :func:`inet_ntop`." +"Supported values for *address_family* are currently :const:`AF_INET` and :" +"const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " +"for the specified address family, :exc:`ValueError` will be raised. :exc:" +"`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" #: ../../library/socket.rst:1362 @@ -1595,10 +1591,10 @@ msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " "the buffer size for :meth:`~socket.recvmsg` to receive a single item of " -"ancillary data, but :rfc:`3542` requires portable applications to " -"use :func:`CMSG_SPACE` and thus include space for padding, even when the " -"item will be the last in the buffer. Raises :exc:`OverflowError` if " -"*length* is outside the permissible range of values." +"ancillary data, but :rfc:`3542` requires portable applications to use :func:" +"`CMSG_SPACE` and thus include space for padding, even when the item will be " +"the last in the buffer. Raises :exc:`OverflowError` if *length* is outside " +"the permissible range of values." msgstr "" #: ../../library/socket.rst:1373 ../../library/socket.rst:1861 @@ -1638,9 +1634,8 @@ msgstr "" #: ../../library/socket.rst:1410 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " -"socket module is first imported, the default is ``None``. " -"See :meth:`~socket.settimeout` for possible values and their respective " -"meanings." +"socket module is first imported, the default is ``None``. See :meth:" +"`~socket.settimeout` for possible values and their respective meanings." msgstr "" #: ../../library/socket.rst:1418 @@ -1654,8 +1649,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." msgstr "" -"引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` " -"``socket.sethostname``。" +"引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." +"sethostname``。" #: ../../library/socket.rst:1430 msgid "" @@ -1698,8 +1693,8 @@ msgstr "" #: ../../library/socket.rst:1457 msgid "" -"Return a network interface index number corresponding to an interface " -"name. :exc:`OSError` if no interface with the given name exists." +"Return a network interface index number corresponding to an interface name. :" +"exc:`OSError` if no interface with the given name exists." msgstr "" #: ../../library/socket.rst:1469 ../../library/socket.rst:1486 @@ -1708,15 +1703,15 @@ msgstr "" #: ../../library/socket.rst:1474 msgid "" -"Return a network interface name corresponding to an interface index " -"number. :exc:`OSError` if no interface with the given index exists." +"Return a network interface name corresponding to an interface index number. :" +"exc:`OSError` if no interface with the given index exists." msgstr "" #: ../../library/socket.rst:1491 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " -"*sock*. The *fds* parameter is a sequence of file descriptors. " -"Consult :meth:`~socket.sendmsg` for the documentation of these parameters." +"*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" +"`~socket.sendmsg` for the documentation of these parameters." msgstr "" #: ../../library/socket.rst:1497 @@ -1728,8 +1723,8 @@ msgstr "" #: ../../library/socket.rst:1505 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " -"*sock*. Return ``(msg, list(fds), flags, addr)``. " -"Consult :meth:`~socket.recvmsg` for the documentation of these parameters." +"*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`~socket." +"recvmsg` for the documentation of these parameters." msgstr "" #: ../../library/socket.rst:1511 @@ -1748,9 +1743,8 @@ msgstr "Socket 物件" #: ../../library/socket.rst:1526 msgid "" -"Socket objects have the following methods. Except " -"for :meth:`~socket.makefile`, these correspond to Unix system calls " -"applicable to sockets." +"Socket objects have the following methods. Except for :meth:`~socket." +"makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" #: ../../library/socket.rst:1530 @@ -1778,8 +1772,8 @@ msgstr "" #: ../../library/socket.rst:1974 ../../library/socket.rst:2019 msgid "" "If the system call is interrupted and the signal handler does not raise an " -"exception, the method now retries the system call instead of raising " -"an :exc:`InterruptedError` exception (see :pep:`475` for the rationale)." +"exception, the method now retries the system call instead of raising an :exc:" +"`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" #: ../../library/socket.rst:1555 @@ -1814,8 +1808,8 @@ msgstr "" #: ../../library/socket.rst:1575 msgid "" -":exc:`OSError` is now raised if an error occurs when the " -"underlying :c:func:`close` call is made." +":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" +"`close` call is made." msgstr "" #: ../../library/socket.rst:1581 @@ -1836,9 +1830,9 @@ msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`TimeoutError` on timeout, if the " "signal handler doesn't raise an exception and the socket is blocking or has " -"a timeout. For non-blocking sockets, the method raises " -"an :exc:`InterruptedError` exception if the connection is interrupted by a " -"signal (or the exception raised by the signal handler)." +"a timeout. For non-blocking sockets, the method raises an :exc:" +"`InterruptedError` exception if the connection is interrupted by a signal " +"(or the exception raised by the signal handler)." msgstr "" #: ../../library/socket.rst:1599 ../../library/socket.rst:1619 @@ -1851,8 +1845,8 @@ msgstr "" #: ../../library/socket.rst:1601 msgid "" -"The method now waits until the connection completes instead of raising " -"an :exc:`InterruptedError` exception if the connection is interrupted by a " +"The method now waits until the connection completes instead of raising an :" +"exc:`InterruptedError` exception if the connection is interrupted by a " "signal, the signal handler doesn't raise an exception and the socket is " "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" @@ -1915,15 +1909,15 @@ msgstr "" #: ../../library/socket.rst:1679 msgid "" -"Return the value of the given socket option (see the Unix man " -"page :manpage:`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\\* " -"etc. `) are defined in this module. If *buflen* is " -"absent, an integer option is assumed and its integer value is returned by " -"the function. If *buflen* is present, it specifies the maximum length of " -"the buffer used to receive the option in, and this buffer is returned as a " -"bytes object. It is up to the caller to decode the contents of the buffer " -"(see the optional built-in module :mod:`struct` for a way to decode C " -"structures encoded as byte strings)." +"Return the value of the given socket option (see the Unix man page :manpage:" +"`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\\* etc. `) are defined in this module. If *buflen* is absent, an " +"integer option is assumed and its integer value is returned by the " +"function. If *buflen* is present, it specifies the maximum length of the " +"buffer used to receive the option in, and this buffer is returned as a bytes " +"object. It is up to the caller to decode the contents of the buffer (see " +"the optional built-in module :mod:`struct` for a way to decode C structures " +"encoded as byte strings)." msgstr "" #: ../../library/socket.rst:1693 @@ -1938,16 +1932,15 @@ msgstr "這等同於檢查 ``socket.gettimeout() != 0``。" #: ../../library/socket.rst:1703 msgid "" "Return the timeout in seconds (float) associated with socket operations, or " -"``None`` if no timeout is set. This reflects the last call " -"to :meth:`setblocking` or :meth:`settimeout`." +"``None`` if no timeout is set. This reflects the last call to :meth:" +"`setblocking` or :meth:`settimeout`." msgstr "" #: ../../library/socket.rst:1710 msgid "" "The :meth:`ioctl` method is a limited interface to the WSAIoctl system " -"interface. Please refer to the `Win32 documentation `_ for more " -"information." +"interface. Please refer to the `Win32 documentation `_ for more information." msgstr "" #: ../../library/socket.rst:1715 @@ -1993,8 +1986,8 @@ msgstr "" #: ../../library/socket.rst:1755 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " -"original socket unless all other file objects have been closed " -"and :meth:`socket.close` has been called on the socket object." +"original socket unless all other file objects have been closed and :meth:" +"`socket.close` has been called on the socket object." msgstr "" #: ../../library/socket.rst:1761 @@ -2009,9 +2002,9 @@ msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " "at once is specified by *bufsize*. A returned empty bytes object indicates " -"that the client has disconnected. See the Unix manual " -"page :manpage:`recv(2)` for the meaning of the optional argument *flags*; it " -"defaults to zero." +"that the client has disconnected. See the Unix manual page :manpage:" +"`recv(2)` for the meaning of the optional argument *flags*; it defaults to " +"zero." msgstr "" #: ../../library/socket.rst:1782 @@ -2027,8 +2020,8 @@ msgstr "" #: ../../library/socket.rst:1793 msgid "" "For multicast IPv6 address, first item of *address* does not contain " -"``%scope_id`` part anymore. In order to get full IPv6 address " -"use :func:`getnameinfo`." +"``%scope_id`` part anymore. In order to get full IPv6 address use :func:" +"`getnameinfo`." msgstr "" #: ../../library/socket.rst:1800 @@ -2063,21 +2056,20 @@ msgid "" "file descriptors between processes over an :const:`AF_UNIX` socket. When " "this facility is used (it is often restricted to :const:`SOCK_STREAM` " "sockets), :meth:`recvmsg` will return, in its ancillary data, items of the " -"form ``(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)``, where *fds* is " -"a :class:`bytes` object representing the new file descriptors as a binary " -"array of the native C :c:expr:`int` type. If :meth:`recvmsg` raises an " -"exception after the system call returns, it will first attempt to close any " -"file descriptors received via this mechanism." +"form ``(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)``, where *fds* is a :" +"class:`bytes` object representing the new file descriptors as a binary array " +"of the native C :c:expr:`int` type. If :meth:`recvmsg` raises an exception " +"after the system call returns, it will first attempt to close any file " +"descriptors received via this mechanism." msgstr "" #: ../../library/socket.rst:1835 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " -"beyond the end of the buffer, :meth:`recvmsg` will issue " -"a :exc:`RuntimeWarning`, and will return the part of it which is inside the " -"buffer provided it has not been truncated before the start of its associated " -"data." +"beyond the end of the buffer, :meth:`recvmsg` will issue a :exc:" +"`RuntimeWarning`, and will return the part of it which is inside the buffer " +"provided it has not been truncated before the start of its associated data." msgstr "" #: ../../library/socket.rst:1842 @@ -2085,8 +2077,8 @@ msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " "data and a list containing the descriptors (while ignoring unexpected " -"conditions such as unrelated control messages being received). See " -"also :meth:`sendmsg`. ::" +"conditions such as unrelated control messages being received). See also :" +"meth:`sendmsg`. ::" msgstr "" #: ../../library/socket.rst:1848 @@ -2098,26 +2090,25 @@ msgid "" " msg, ancdata, flags, addr = sock.recvmsg(msglen, socket.CMSG_LEN(maxfds " "* fds.itemsize))\n" " for cmsg_level, cmsg_type, cmsg_data in ancdata:\n" -" if cmsg_level == socket.SOL_SOCKET and cmsg_type == " -"socket.SCM_RIGHTS:\n" +" if cmsg_level == socket.SOL_SOCKET and cmsg_type == socket." +"SCM_RIGHTS:\n" " # Append data, ignoring any truncated integers at the end.\n" -" fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % " -"fds.itemsize)])\n" +" fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds." +"itemsize)])\n" " return msg, list(fds)" msgstr "" #: ../../library/socket.rst:1873 msgid "" -"Receive normal data and ancillary data from the socket, behaving " -"as :meth:`recvmsg` would, but scatter the non-ancillary data into a series " -"of buffers instead of returning a new bytes object. The *buffers* argument " -"must be an iterable of objects that export writable buffers " -"(e.g. :class:`bytearray` objects); these will be filled with successive " -"chunks of the non-ancillary data until it has all been written or there are " -"no more buffers. The operating system may set a limit (:func:`~os.sysconf` " -"value ``SC_IOV_MAX``) on the number of buffers that can be used. The " -"*ancbufsize* and *flags* arguments have the same meaning as " -"for :meth:`recvmsg`." +"Receive normal data and ancillary data from the socket, behaving as :meth:" +"`recvmsg` would, but scatter the non-ancillary data into a series of buffers " +"instead of returning a new bytes object. The *buffers* argument must be an " +"iterable of objects that export writable buffers (e.g. :class:`bytearray` " +"objects); these will be filled with successive chunks of the non-ancillary " +"data until it has all been written or there are no more buffers. The " +"operating system may set a limit (:func:`~os.sysconf` value ``SC_IOV_MAX``) " +"on the number of buffers that can be used. The *ancbufsize* and *flags* " +"arguments have the same meaning as for :meth:`recvmsg`." msgstr "" #: ../../library/socket.rst:1884 @@ -2224,9 +2215,9 @@ msgstr "" msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " -"The *buffers* argument specifies the non-ancillary data as an iterable " -"of :term:`bytes-like objects ` (e.g. :class:`bytes` " -"objects); the operating system may set a limit (:func:`~os.sysconf` value " +"The *buffers* argument specifies the non-ancillary data as an iterable of :" +"term:`bytes-like objects ` (e.g. :class:`bytes` objects); " +"the operating system may set a limit (:func:`~os.sysconf` value " "``SC_IOV_MAX``) on the number of buffers that can be used. The *ancdata* " "argument specifies the ancillary data (control messages) as an iterable of " "zero or more tuples ``(cmsg_level, cmsg_type, cmsg_data)``, where " @@ -2242,8 +2233,8 @@ msgstr "" #: ../../library/socket.rst:2002 msgid "" -"The following function sends the list of file descriptors *fds* over " -"an :const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " +"The following function sends the list of file descriptors *fds* over an :" +"const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" @@ -2252,14 +2243,14 @@ msgid "" "import socket, array\n" "\n" "def send_fds(sock, msg, fds):\n" -" return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, " -"array.array(\"i\", fds))])" +" return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array." +"array(\"i\", fds))])" msgstr "" "import socket, array\n" "\n" "def send_fds(sock, msg, fds):\n" -" return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, " -"array.array(\"i\", fds))])" +" return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array." +"array(\"i\", fds))])" #: ../../library/socket.rst:2015 msgid "" @@ -2278,17 +2269,16 @@ msgstr "" #: ../../library/socket.rst:2035 msgid "" -"Send a file until EOF is reached by using high-" -"performance :mod:`os.sendfile` and return the total number of bytes which " -"were sent. *file* must be a regular file object opened in binary mode. " -"If :mod:`os.sendfile` is not available (e.g. Windows) or *file* is not a " -"regular file :meth:`send` will be used instead. *offset* tells from where to " -"start reading the file. If specified, *count* is the total number of bytes " -"to transmit as opposed to sending the file until EOF is reached. File " -"position is updated on return or also in case of error in which " -"case :meth:`file.tell() ` can be used to figure out the " -"number of bytes which were sent. The socket must be of :const:`SOCK_STREAM` " -"type. Non-blocking sockets are not supported." +"Send a file until EOF is reached by using high-performance :mod:`os." +"sendfile` and return the total number of bytes which were sent. *file* must " +"be a regular file object opened in binary mode. If :mod:`os.sendfile` is not " +"available (e.g. Windows) or *file* is not a regular file :meth:`send` will " +"be used instead. *offset* tells from where to start reading the file. If " +"specified, *count* is the total number of bytes to transmit as opposed to " +"sending the file until EOF is reached. File position is updated on return or " +"also in case of error in which case :meth:`file.tell() ` can " +"be used to figure out the number of bytes which were sent. The socket must " +"be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" #: ../../library/socket.rst:2051 @@ -2318,17 +2308,17 @@ msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" #: ../../library/socket.rst:2068 msgid "" -"The method no longer applies :const:`SOCK_NONBLOCK` flag " -"on :attr:`socket.type`." +"The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." +"type`." msgstr "" #: ../../library/socket.rst:2075 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating-point number expressing seconds, or ``None``. If a non-" -"zero value is given, subsequent socket operations will raise " -"a :exc:`timeout` exception if the timeout period *value* has elapsed before " -"the operation has completed. If zero is given, the socket is put in non-" +"zero value is given, subsequent socket operations will raise a :exc:" +"`timeout` exception if the timeout period *value* has elapsed before the " +"operation has completed. If zero is given, the socket is put in non-" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" @@ -2340,90 +2330,88 @@ msgstr "" #: ../../library/socket.rst:2084 msgid "" -"The method no longer toggles :const:`SOCK_NONBLOCK` flag " -"on :attr:`socket.type`." +"The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." +"type`." msgstr "" -#: ../../library/socket.rst:2097 +#: ../../library/socket.rst:2094 msgid "" -"Set the value of the given socket option (see the Unix manual " -"page :manpage:`setsockopt(2)`). The needed symbolic constants are defined " -"in this module (:ref:`!SO_\\* etc. `). The value can " -"be an integer, ``None`` or a :term:`bytes-like object` representing a " -"buffer. In the later case it is up to the caller to ensure that the " -"bytestring contains the proper bits (see the optional built-in " -"module :mod:`struct` for a way to encode C structures as bytestrings). When " -"*value* is set to ``None``, *optlen* argument is required. It's equivalent " -"to call :c:func:`setsockopt` C function with ``optval=NULL`` and " -"``optlen=optlen``." +"Set the value of the given socket option (see the Unix manual page :manpage:" +"`setsockopt(2)`). The needed symbolic constants are defined in this module " +"(:ref:`!SO_\\* etc. `). The value can be an integer, " +"``None`` or a :term:`bytes-like object` representing a buffer. In the later " +"case it is up to the caller to ensure that the bytestring contains the " +"proper bits (see the optional built-in module :mod:`struct` for a way to " +"encode C structures as bytestrings). When *value* is set to ``None``, " +"*optlen* argument is required. It's equivalent to call :c:func:`setsockopt` " +"C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:2110 +#: ../../library/socket.rst:2107 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:2118 +#: ../../library/socket.rst:2115 msgid "" -"Shut down one or both halves of the connection. If *how* " -"is :const:`SHUT_RD`, further receives are disallowed. If *how* " -"is :const:`SHUT_WR`, further sends are disallowed. If *how* " -"is :const:`SHUT_RDWR`, further sends and receives are disallowed." +"Shut down one or both halves of the connection. If *how* is :const:" +"`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " +"further sends are disallowed. If *how* is :const:`SHUT_RDWR`, further sends " +"and receives are disallowed." msgstr "" -#: ../../library/socket.rst:2128 +#: ../../library/socket.rst:2125 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " "object can then be passed to the target process using some form of " -"interprocess communication and the socket can be recreated there " -"using :func:`fromshare`. Once this method has been called, it is safe to " -"close the socket since the operating system has already duplicated it for " -"the target process." +"interprocess communication and the socket can be recreated there using :func:" +"`fromshare`. Once this method has been called, it is safe to close the " +"socket since the operating system has already duplicated it for the target " +"process." msgstr "" -#: ../../library/socket.rst:2140 +#: ../../library/socket.rst:2137 msgid "" -"Note that there are no methods :meth:`read` or :meth:`write`; " -"use :meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument " -"instead." +"Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" +"`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:2143 +#: ../../library/socket.rst:2140 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:2149 +#: ../../library/socket.rst:2146 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:2154 +#: ../../library/socket.rst:2151 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:2159 +#: ../../library/socket.rst:2156 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2166 +#: ../../library/socket.rst:2163 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2168 +#: ../../library/socket.rst:2165 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:2172 +#: ../../library/socket.rst:2169 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2175 +#: ../../library/socket.rst:2172 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2431,14 +2419,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2180 +#: ../../library/socket.rst:2177 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:2185 +#: ../../library/socket.rst:2182 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2447,38 +2435,38 @@ msgid "" "you decide to use the :meth:`~socket.fileno` of a socket." msgstr "" -#: ../../library/socket.rst:2192 +#: ../../library/socket.rst:2189 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2194 +#: ../../library/socket.rst:2191 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " -"before calling :meth:`~socket.connect` or pass a timeout parameter " -"to :meth:`create_connection`. However, the system network stack may also " -"return a connection timeout error of its own regardless of any Python socket " -"timeout setting." +"before calling :meth:`~socket.connect` or pass a timeout parameter to :meth:" +"`create_connection`. However, the system network stack may also return a " +"connection timeout error of its own regardless of any Python socket timeout " +"setting." msgstr "" -#: ../../library/socket.rst:2202 +#: ../../library/socket.rst:2199 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2204 +#: ../../library/socket.rst:2201 msgid "" -"If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by " -"the :meth:`~socket.accept` method inherit that timeout. Otherwise, the " -"behaviour depends on settings of the listening socket:" +"If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" +"meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " +"depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:2208 +#: ../../library/socket.rst:2205 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:2211 +#: ../../library/socket.rst:2208 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2486,29 +2474,28 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2220 +#: ../../library/socket.rst:2217 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2222 +#: ../../library/socket.rst:2219 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " -"a client using it. Note that a server must perform the " -"sequence :func:`~socket.socket`, :meth:`~socket.bind`, :meth:`~socket.listen`, :meth:`~socket.accept` " -"(possibly repeating the :meth:`~socket.accept` to service more than one " -"client), while a client only needs the " -"sequence :func:`~socket.socket`, :meth:`~socket.connect`. Also note that " -"the server does not :meth:`~socket.sendall`/:meth:`~socket.recv` on the " -"socket it is listening on but on the new socket returned " -"by :meth:`~socket.accept`." +"a client using it. Note that a server must perform the sequence :func:" +"`~socket.socket`, :meth:`~socket.bind`, :meth:`~socket.listen`, :meth:" +"`~socket.accept` (possibly repeating the :meth:`~socket.accept` to service " +"more than one client), while a client only needs the sequence :func:`~socket." +"socket`, :meth:`~socket.connect`. Also note that the server does not :meth:" +"`~socket.sendall`/:meth:`~socket.recv` on the socket it is listening on but " +"on the new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2232 +#: ../../library/socket.rst:2229 msgid "The first two examples support IPv4 only. ::" msgstr "前兩個範例只支援 IPv4: ::" -#: ../../library/socket.rst:2234 +#: ../../library/socket.rst:2231 msgid "" "# Echo server program\n" "import socket\n" @@ -2527,7 +2514,7 @@ msgid "" " conn.sendall(data)" msgstr "" -#: ../../library/socket.rst:2252 +#: ../../library/socket.rst:2249 msgid "" "# Echo client program\n" "import socket\n" @@ -2541,7 +2528,7 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2263 +#: ../../library/socket.rst:2260 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2551,7 +2538,7 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2270 +#: ../../library/socket.rst:2267 msgid "" "# Echo server program\n" "import socket\n" @@ -2588,7 +2575,7 @@ msgid "" " conn.send(data)" msgstr "" -#: ../../library/socket.rst:2306 +#: ../../library/socket.rst:2303 msgid "" "# Echo client program\n" "import socket\n" @@ -2597,8 +2584,8 @@ msgid "" "HOST = 'daring.cwi.nl' # The remote host\n" "PORT = 50007 # The same port as used by the server\n" "s = None\n" -"for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, " -"socket.SOCK_STREAM):\n" +"for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket." +"SOCK_STREAM):\n" " af, socktype, proto, canonname, sa = res\n" " try:\n" " s = socket.socket(af, socktype, proto)\n" @@ -2621,14 +2608,14 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2335 +#: ../../library/socket.rst:2332 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:2339 +#: ../../library/socket.rst:2336 msgid "" "import socket\n" "\n" @@ -2652,29 +2639,29 @@ msgid "" "s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)" msgstr "" -#: ../../library/socket.rst:2360 +#: ../../library/socket.rst:2357 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:2364 +#: ../../library/socket.rst:2361 msgid "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" msgstr "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" -#: ../../library/socket.rst:2366 +#: ../../library/socket.rst:2363 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:2370 +#: ../../library/socket.rst:2367 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2372 +#: ../../library/socket.rst:2369 msgid "" "import socket\n" "import struct\n" @@ -2716,29 +2703,29 @@ msgid "" " print('Error sending CAN frame')" msgstr "" -#: ../../library/socket.rst:2410 +#: ../../library/socket.rst:2407 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2413 +#: ../../library/socket.rst:2410 msgid "OSError: [Errno 98] Address already in use" msgstr "OSError: [Errno 98] Address already in use" -#: ../../library/socket.rst:2415 +#: ../../library/socket.rst:2412 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2418 +#: ../../library/socket.rst:2415 msgid "" -"There is a :mod:`socket` flag to set, in order to prevent " -"this, :const:`socket.SO_REUSEADDR`::" +"There is a :mod:`socket` flag to set, in order to prevent this, :const:" +"`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2421 +#: ../../library/socket.rst:2418 msgid "" "s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" @@ -2748,30 +2735,30 @@ msgstr "" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" "s.bind((HOST, PORT))" -#: ../../library/socket.rst:2425 +#: ../../library/socket.rst:2422 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2431 +#: ../../library/socket.rst:2428 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2433 +#: ../../library/socket.rst:2430 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2435 +#: ../../library/socket.rst:2432 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2438 +#: ../../library/socket.rst:2435 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " @@ -2798,11 +2785,11 @@ msgstr "I/O control(I/O 控制)" msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:2095 +#: ../../library/socket.rst:2092 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:2095 +#: ../../library/socket.rst:2092 msgid "struct" msgstr "struct" diff --git a/library/ssl.po b/library/ssl.po index c586dcc23f..16eea3e0f1 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4056,7 +4056,8 @@ msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" msgstr ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" #: ../../library/ssl.rst:2828 -msgid "Donald E., Jeffrey I. Schiller" +#, fuzzy +msgid "Donald E. Eastlake, Jeffrey I. Schiller, Steve Crocker" msgstr "Donald E., Jeffrey I. Schiller" #: ../../library/ssl.rst:2830 @@ -4068,8 +4069,9 @@ msgstr "" "Certificate Revocation List (CRL) Profile <5280>`" #: ../../library/ssl.rst:2831 -msgid "D. Cooper" -msgstr "D. Cooper" +#, fuzzy +msgid "David Cooper et al." +msgstr "T. Dierks et. al." #: ../../library/ssl.rst:2833 msgid "" @@ -4080,15 +4082,16 @@ msgstr "" "<5246>`" #: ../../library/ssl.rst:2834 -msgid "T. Dierks et. al." -msgstr "T. Dierks et. al." +msgid "Tim Dierks and Eric Rescorla." +msgstr "" #: ../../library/ssl.rst:2836 msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgstr ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" #: ../../library/ssl.rst:2837 -msgid "D. Eastlake" +#, fuzzy +msgid "Donald E. Eastlake" msgstr "D. Eastlake" #: ../../library/ssl.rst:2839 @@ -4158,3 +4161,6 @@ msgstr "certificates(憑證)" #: ../../library/ssl.rst:2159 msgid "X509 certificate" msgstr "X509 certificate(X509 憑證)" + +#~ msgid "D. Cooper" +#~ msgstr "D. Cooper" diff --git a/library/subprocess.po b/library/subprocess.po index 68ed5a8c6d..ff180dc20c 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-09 00:15+0000\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,7 +53,7 @@ msgstr ":pep:`324` -- 提議 subprocess 模組的 PEP" #: ../../library/subprocess.rst:598 ../../library/subprocess.rst:605 #: ../../library/subprocess.rst:615 ../../library/subprocess.rst:624 #: ../../library/subprocess.rst:633 ../../library/subprocess.rst:639 -#: ../../library/subprocess.rst:1494 ../../library/subprocess.rst:1516 +#: ../../library/subprocess.rst:1496 ../../library/subprocess.rst:1518 #: ../../includes/wasm-mobile-notavail.rst:3 msgid "Availability" msgstr "可用性" @@ -193,8 +193,8 @@ msgid "" msgstr "" #: ../../library/subprocess.rst:122 ../../library/subprocess.rst:506 -#: ../../library/subprocess.rst:1214 ../../library/subprocess.rst:1254 -#: ../../library/subprocess.rst:1317 +#: ../../library/subprocess.rst:1216 ../../library/subprocess.rst:1256 +#: ../../library/subprocess.rst:1319 msgid "" "Changed Windows shell search order for ``shell=True``. The current directory " "and ``%PATH%`` are replaced with ``%COMSPEC%`` and ``%SystemRoot%" @@ -218,7 +218,7 @@ msgid "" "that it ran successfully." msgstr "" -#: ../../library/subprocess.rst:141 ../../library/subprocess.rst:945 +#: ../../library/subprocess.rst:141 ../../library/subprocess.rst:947 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." @@ -395,8 +395,8 @@ msgid "" "binary streams. No encoding or line ending conversion is performed." msgstr "" -#: ../../library/subprocess.rst:314 ../../library/subprocess.rst:1503 -#: ../../library/subprocess.rst:1521 +#: ../../library/subprocess.rst:314 ../../library/subprocess.rst:1505 +#: ../../library/subprocess.rst:1523 msgid "Added the *encoding* and *errors* parameters." msgstr "新增 *encoding* 與 *errors* 參數。" @@ -860,7 +860,7 @@ msgstr "" msgid "*encoding* and *errors* were added." msgstr "新增 *encoding* 與 *errors*。" -#: ../../library/subprocess.rst:665 ../../library/subprocess.rst:1312 +#: ../../library/subprocess.rst:665 ../../library/subprocess.rst:1314 msgid "*text* was added as a more readable alias for *universal_newlines*." msgstr "" @@ -1096,9 +1096,9 @@ msgid "" "create_subprocess_exec`." msgstr "" -#: ../../library/subprocess.rst:811 ../../library/subprocess.rst:852 -#: ../../library/subprocess.rst:1209 ../../library/subprocess.rst:1249 -#: ../../library/subprocess.rst:1303 +#: ../../library/subprocess.rst:811 ../../library/subprocess.rst:854 +#: ../../library/subprocess.rst:1211 ../../library/subprocess.rst:1251 +#: ../../library/subprocess.rst:1305 msgid "*timeout* was added." msgstr "新增 *timeout*。" @@ -1130,17 +1130,19 @@ msgstr "" msgid "" "If the process does not terminate after *timeout* seconds, a :exc:" "`TimeoutExpired` exception will be raised. Catching this exception and " -"retrying communication will not lose any output." +"retrying communication will not lose any output. Supplying *input* to a " +"subsequent post-timeout :meth:`communicate` call is in undefined behavior " +"and may become an error in the future." msgstr "" -#: ../../library/subprocess.rst:836 +#: ../../library/subprocess.rst:838 msgid "" "The child process is not killed if the timeout expires, so in order to " "cleanup properly a well-behaved application should kill the child process " "and finish communication::" msgstr "" -#: ../../library/subprocess.rst:840 +#: ../../library/subprocess.rst:842 msgid "" "proc = subprocess.Popen(...)\n" "try:\n" @@ -1156,53 +1158,53 @@ msgstr "" " proc.kill()\n" " outs, errs = proc.communicate()" -#: ../../library/subprocess.rst:849 +#: ../../library/subprocess.rst:851 msgid "" "The data read is buffered in memory, so do not use this method if the data " "size is large or unlimited." msgstr "" -#: ../../library/subprocess.rst:858 +#: ../../library/subprocess.rst:860 msgid "Sends the signal *signal* to the child." msgstr "" -#: ../../library/subprocess.rst:860 +#: ../../library/subprocess.rst:862 msgid "Do nothing if the process completed." msgstr "" -#: ../../library/subprocess.rst:864 +#: ../../library/subprocess.rst:866 msgid "" "On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and " "CTRL_BREAK_EVENT can be sent to processes started with a *creationflags* " "parameter which includes ``CREATE_NEW_PROCESS_GROUP``." msgstr "" -#: ../../library/subprocess.rst:871 +#: ../../library/subprocess.rst:873 msgid "" "Stop the child. On POSIX OSs the method sends :py:const:`~signal.SIGTERM` to " "the child. On Windows the Win32 API function :c:func:`!TerminateProcess` is " "called to stop the child." msgstr "" -#: ../../library/subprocess.rst:878 +#: ../../library/subprocess.rst:880 msgid "" "Kills the child. On POSIX OSs the function sends SIGKILL to the child. On " "Windows :meth:`kill` is an alias for :meth:`terminate`." msgstr "" -#: ../../library/subprocess.rst:882 +#: ../../library/subprocess.rst:884 msgid "" "The following attributes are also set by the class for you to access. " "Reassigning them to new values is unsupported:" msgstr "" -#: ../../library/subprocess.rst:887 +#: ../../library/subprocess.rst:889 msgid "" "The *args* argument as it was passed to :class:`Popen` -- a sequence of " "program arguments or else a single string." msgstr "" -#: ../../library/subprocess.rst:894 +#: ../../library/subprocess.rst:896 msgid "" "If the *stdin* argument was :data:`PIPE`, this attribute is a writeable " "stream object as returned by :func:`open`. If the *encoding* or *errors* " @@ -1211,7 +1213,7 @@ msgid "" "*stdin* argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:903 +#: ../../library/subprocess.rst:905 msgid "" "If the *stdout* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " @@ -1221,7 +1223,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:913 +#: ../../library/subprocess.rst:915 msgid "" "If the *stderr* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " @@ -1231,7 +1233,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:922 +#: ../../library/subprocess.rst:924 msgid "" "Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write `, :attr:`.stdout.read ` or :attr:`.stderr.read `__ structure is used for :class:`Popen` " @@ -1280,17 +1282,17 @@ msgid "" "only arguments." msgstr "" -#: ../../library/subprocess.rst:963 +#: ../../library/subprocess.rst:965 msgid "Keyword-only argument support was added." msgstr "" -#: ../../library/subprocess.rst:968 +#: ../../library/subprocess.rst:970 msgid "" "A bit field that determines whether certain :class:`STARTUPINFO` attributes " "are used when the process creates a window. ::" msgstr "" -#: ../../library/subprocess.rst:971 +#: ../../library/subprocess.rst:973 msgid "" "si = subprocess.STARTUPINFO()\n" "si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess." @@ -1300,28 +1302,28 @@ msgstr "" "si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess." "STARTF_USESHOWWINDOW" -#: ../../library/subprocess.rst:976 +#: ../../library/subprocess.rst:978 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` " "is not specified, the default for standard input is the keyboard buffer." msgstr "" -#: ../../library/subprocess.rst:983 +#: ../../library/subprocess.rst:985 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard output handle for the process. Otherwise, this attribute is " "ignored and the default for standard output is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:990 +#: ../../library/subprocess.rst:992 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard error handle for the process. Otherwise, this attribute is " "ignored and the default for standard error is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:996 +#: ../../library/subprocess.rst:998 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute " "can be any of the values that can be specified in the ``nCmdShow`` parameter " @@ -1330,34 +1332,34 @@ msgid "" "Otherwise, this attribute is ignored." msgstr "" -#: ../../library/subprocess.rst:1003 +#: ../../library/subprocess.rst:1005 msgid "" ":data:`SW_HIDE` is provided for this attribute. It is used when :class:" "`Popen` is called with ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:1008 +#: ../../library/subprocess.rst:1010 msgid "" "A dictionary of additional attributes for process creation as given in " "``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" -#: ../../library/subprocess.rst:1012 +#: ../../library/subprocess.rst:1014 msgid "Supported attributes:" msgstr "" -#: ../../library/subprocess.rst:1014 +#: ../../library/subprocess.rst:1016 msgid "**handle_list**" msgstr "**handle_list**" -#: ../../library/subprocess.rst:1015 +#: ../../library/subprocess.rst:1017 msgid "" "Sequence of handles that will be inherited. *close_fds* must be true if non-" "empty." msgstr "" -#: ../../library/subprocess.rst:1018 +#: ../../library/subprocess.rst:1020 msgid "" "The handles must be temporarily made inheritable by :func:`os." "set_handle_inheritable` when passed to the :class:`Popen` constructor, else :" @@ -1365,7 +1367,7 @@ msgid "" "``ERROR_INVALID_PARAMETER`` (87)." msgstr "" -#: ../../library/subprocess.rst:1025 +#: ../../library/subprocess.rst:1027 msgid "" "In a multithreaded process, use caution to avoid leaking handles that are " "marked inheritable when combining this feature with concurrent calls to " @@ -1374,110 +1376,110 @@ msgid "" "temporarily creates inheritable handles." msgstr "" -#: ../../library/subprocess.rst:1035 +#: ../../library/subprocess.rst:1037 msgid "Windows Constants" msgstr "" -#: ../../library/subprocess.rst:1037 +#: ../../library/subprocess.rst:1039 msgid "The :mod:`subprocess` module exposes the following constants." msgstr "" -#: ../../library/subprocess.rst:1041 +#: ../../library/subprocess.rst:1043 msgid "" "The standard input device. Initially, this is the console input buffer, " "``CONIN$``." msgstr "" -#: ../../library/subprocess.rst:1046 +#: ../../library/subprocess.rst:1048 msgid "" "The standard output device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1051 +#: ../../library/subprocess.rst:1053 msgid "" "The standard error device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1056 +#: ../../library/subprocess.rst:1058 msgid "Hides the window. Another window will be activated." msgstr "" -#: ../../library/subprocess.rst:1060 +#: ../../library/subprocess.rst:1062 msgid "" "Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO." "hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional " "information." msgstr "" -#: ../../library/subprocess.rst:1066 +#: ../../library/subprocess.rst:1068 msgid "" "Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains " "additional information." msgstr "" -#: ../../library/subprocess.rst:1071 +#: ../../library/subprocess.rst:1073 msgid "" "A :attr:`STARTUPINFO.dwFlags` parameter to specify that the *Working in " "Background* mouse cursor will be displayed while a process is launching. " "This is the default behavior for GUI processes." msgstr "" -#: ../../library/subprocess.rst:1080 +#: ../../library/subprocess.rst:1082 msgid "" "A :attr:`STARTUPINFO.dwFlags` parameter to specify that the mouse cursor " "will not be changed when launching a process." msgstr "" -#: ../../library/subprocess.rst:1087 +#: ../../library/subprocess.rst:1089 msgid "" "The new process has a new console, instead of inheriting its parent's " "console (the default)." msgstr "" -#: ../../library/subprocess.rst:1092 +#: ../../library/subprocess.rst:1094 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "group will be created. This flag is necessary for using :func:`os.kill` on " "the subprocess." msgstr "" -#: ../../library/subprocess.rst:1096 +#: ../../library/subprocess.rst:1098 msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" -#: ../../library/subprocess.rst:1100 +#: ../../library/subprocess.rst:1102 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an above average priority." msgstr "" -#: ../../library/subprocess.rst:1107 +#: ../../library/subprocess.rst:1109 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a below average priority." msgstr "" -#: ../../library/subprocess.rst:1114 +#: ../../library/subprocess.rst:1116 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a high priority." msgstr "" -#: ../../library/subprocess.rst:1121 +#: ../../library/subprocess.rst:1123 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an idle (lowest) priority." msgstr "" -#: ../../library/subprocess.rst:1128 +#: ../../library/subprocess.rst:1130 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a normal priority. (default)" msgstr "" -#: ../../library/subprocess.rst:1135 +#: ../../library/subprocess.rst:1137 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have realtime priority. You should almost never use " @@ -1487,20 +1489,20 @@ msgid "" "perform brief tasks that should have limited interruptions." msgstr "" -#: ../../library/subprocess.rst:1146 +#: ../../library/subprocess.rst:1148 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not create a window." msgstr "" -#: ../../library/subprocess.rst:1153 +#: ../../library/subprocess.rst:1155 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not inherit its parent's console. This value cannot be used with " "CREATE_NEW_CONSOLE." msgstr "" -#: ../../library/subprocess.rst:1161 +#: ../../library/subprocess.rst:1163 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "does not inherit the error mode of the calling process. Instead, the new " @@ -1508,43 +1510,43 @@ msgid "" "multithreaded shell applications that run with hard errors disabled." msgstr "" -#: ../../library/subprocess.rst:1171 +#: ../../library/subprocess.rst:1173 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "is not associated with the job." msgstr "" -#: ../../library/subprocess.rst:1179 +#: ../../library/subprocess.rst:1181 msgid "Older high-level API" msgstr "" -#: ../../library/subprocess.rst:1181 +#: ../../library/subprocess.rst:1183 msgid "" "Prior to Python 3.5, these three functions comprised the high level API to " "subprocess. You can now use :func:`run` in many cases, but lots of existing " "code calls these functions." msgstr "" -#: ../../library/subprocess.rst:1188 +#: ../../library/subprocess.rst:1190 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return the :attr:`~Popen.returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:1191 ../../library/subprocess.rst:1231 +#: ../../library/subprocess.rst:1193 ../../library/subprocess.rst:1233 msgid "" "Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" -#: ../../library/subprocess.rst:1193 +#: ../../library/subprocess.rst:1195 msgid "run(...).returncode" msgstr "run(...).returncode" -#: ../../library/subprocess.rst:1195 ../../library/subprocess.rst:1235 +#: ../../library/subprocess.rst:1197 ../../library/subprocess.rst:1237 msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." msgstr "" -#: ../../library/subprocess.rst:1197 ../../library/subprocess.rst:1237 +#: ../../library/subprocess.rst:1199 ../../library/subprocess.rst:1239 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is the same as that of the :class:`Popen` constructor - this " @@ -1552,14 +1554,14 @@ msgid "" "to that interface." msgstr "" -#: ../../library/subprocess.rst:1204 ../../library/subprocess.rst:1244 +#: ../../library/subprocess.rst:1206 ../../library/subprocess.rst:1246 msgid "" "Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. The child " "process will block if it generates enough output to a pipe to fill up the OS " "pipe buffer as the pipes are not being read from." msgstr "" -#: ../../library/subprocess.rst:1224 +#: ../../library/subprocess.rst:1226 msgid "" "Run command with arguments. Wait for command to complete. If the return " "code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" @@ -1568,15 +1570,15 @@ msgid "" "to start the process it will propagate the exception that was raised." msgstr "" -#: ../../library/subprocess.rst:1233 +#: ../../library/subprocess.rst:1235 msgid "run(..., check=True)" msgstr "run(..., check=True)" -#: ../../library/subprocess.rst:1266 +#: ../../library/subprocess.rst:1268 msgid "Run command with arguments and return its output." msgstr "" -#: ../../library/subprocess.rst:1268 +#: ../../library/subprocess.rst:1270 msgid "" "If the return code was non-zero it raises a :exc:`CalledProcessError`. The :" "exc:`CalledProcessError` object will have the return code in the :attr:" @@ -1584,15 +1586,15 @@ msgid "" "`~CalledProcessError.output` attribute." msgstr "" -#: ../../library/subprocess.rst:1273 +#: ../../library/subprocess.rst:1275 msgid "This is equivalent to::" msgstr "這等同於: ::" -#: ../../library/subprocess.rst:1275 +#: ../../library/subprocess.rst:1277 msgid "run(..., check=True, stdout=PIPE).stdout" msgstr "run(..., check=True, stdout=PIPE).stdout" -#: ../../library/subprocess.rst:1277 +#: ../../library/subprocess.rst:1279 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is largely the same as that of :func:`run` - most arguments are " @@ -1602,27 +1604,27 @@ msgid "" "using the parent's standard input file handle." msgstr "" -#: ../../library/subprocess.rst:1284 +#: ../../library/subprocess.rst:1286 msgid "" "By default, this function will return the data as encoded bytes. The actual " "encoding of the output data may depend on the command being invoked, so the " "decoding to text will often need to be handled at the application level." msgstr "" -#: ../../library/subprocess.rst:1288 +#: ../../library/subprocess.rst:1290 msgid "" "This behaviour may be overridden by setting *text*, *encoding*, *errors*, or " "*universal_newlines* to ``True`` as described in :ref:`frequently-used-" "arguments` and :func:`run`." msgstr "" -#: ../../library/subprocess.rst:1292 +#: ../../library/subprocess.rst:1294 msgid "" "To also capture standard error in the result, use ``stderr=subprocess." "STDOUT``::" msgstr "" -#: ../../library/subprocess.rst:1295 +#: ../../library/subprocess.rst:1297 msgid "" ">>> subprocess.check_output(\n" "... \"ls non_existent_file; exit 0\",\n" @@ -1636,32 +1638,32 @@ msgstr "" "... shell=True)\n" "'ls: non_existent_file: No such file or directory\\n'" -#: ../../library/subprocess.rst:1306 +#: ../../library/subprocess.rst:1308 msgid "Support for the *input* keyword argument was added." msgstr "新增 *input* 關鍵字引數的支援。" -#: ../../library/subprocess.rst:1309 +#: ../../library/subprocess.rst:1311 msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "新增 *encoding* 與 *errors*。細節請見 :func:`run`。" -#: ../../library/subprocess.rst:1327 +#: ../../library/subprocess.rst:1329 msgid "Replacing Older Functions with the :mod:`subprocess` Module" msgstr "" -#: ../../library/subprocess.rst:1329 +#: ../../library/subprocess.rst:1331 msgid "" "In this section, \"a becomes b\" means that b can be used as a replacement " "for a." msgstr "" -#: ../../library/subprocess.rst:1333 +#: ../../library/subprocess.rst:1335 msgid "" "All \"a\" functions in this section fail (more or less) silently if the " "executed program cannot be found; the \"b\" replacements raise :exc:" "`OSError` instead." msgstr "" -#: ../../library/subprocess.rst:1337 +#: ../../library/subprocess.rst:1339 msgid "" "In addition, the replacements using :func:`check_output` will fail with a :" "exc:`CalledProcessError` if the requested operation produces a non-zero " @@ -1669,38 +1671,38 @@ msgid "" "output` attribute of the raised exception." msgstr "" -#: ../../library/subprocess.rst:1342 +#: ../../library/subprocess.rst:1344 msgid "" "In the following examples, we assume that the relevant functions have " "already been imported from the :mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1347 +#: ../../library/subprocess.rst:1349 msgid "Replacing :program:`/bin/sh` shell command substitution" msgstr "" -#: ../../library/subprocess.rst:1349 +#: ../../library/subprocess.rst:1351 msgid "output=$(mycmd myarg)" msgstr "output=$(mycmd myarg)" -#: ../../library/subprocess.rst:1353 ../../library/subprocess.rst:1364 -#: ../../library/subprocess.rst:1381 +#: ../../library/subprocess.rst:1355 ../../library/subprocess.rst:1366 +#: ../../library/subprocess.rst:1383 msgid "becomes::" msgstr "變成: ::" -#: ../../library/subprocess.rst:1355 +#: ../../library/subprocess.rst:1357 msgid "output = check_output([\"mycmd\", \"myarg\"])" msgstr "output = check_output([\"mycmd\", \"myarg\"])" -#: ../../library/subprocess.rst:1358 +#: ../../library/subprocess.rst:1360 msgid "Replacing shell pipeline" msgstr "" -#: ../../library/subprocess.rst:1360 ../../library/subprocess.rst:1377 +#: ../../library/subprocess.rst:1362 ../../library/subprocess.rst:1379 msgid "output=$(dmesg | grep hda)" msgstr "output=$(dmesg | grep hda)" -#: ../../library/subprocess.rst:1366 +#: ../../library/subprocess.rst:1368 msgid "" "p1 = Popen([\"dmesg\"], stdout=PIPE)\n" "p2 = Popen([\"grep\", \"hda\"], stdin=p1.stdout, stdout=PIPE)\n" @@ -1708,27 +1710,27 @@ msgid "" "output = p2.communicate()[0]" msgstr "" -#: ../../library/subprocess.rst:1371 +#: ../../library/subprocess.rst:1373 msgid "" "The ``p1.stdout.close()`` call after starting the p2 is important in order " "for p1 to receive a SIGPIPE if p2 exits before p1." msgstr "" -#: ../../library/subprocess.rst:1374 +#: ../../library/subprocess.rst:1376 msgid "" "Alternatively, for trusted input, the shell's own pipeline support may still " "be used directly:" msgstr "" -#: ../../library/subprocess.rst:1383 +#: ../../library/subprocess.rst:1385 msgid "output = check_output(\"dmesg | grep hda\", shell=True)" msgstr "output = check_output(\"dmesg | grep hda\", shell=True)" -#: ../../library/subprocess.rst:1387 +#: ../../library/subprocess.rst:1389 msgid "Replacing :func:`os.system`" msgstr "取代 :func:`os.system`" -#: ../../library/subprocess.rst:1391 +#: ../../library/subprocess.rst:1393 msgid "" "sts = os.system(\"mycmd\" + \" myarg\")\n" "# becomes\n" @@ -1738,32 +1740,32 @@ msgstr "" "# 變成\n" "retcode = call(\"mycmd\" + \" myarg\", shell=True)" -#: ../../library/subprocess.rst:1395 +#: ../../library/subprocess.rst:1397 msgid "Notes:" msgstr "註解:" -#: ../../library/subprocess.rst:1397 +#: ../../library/subprocess.rst:1399 msgid "Calling the program through the shell is usually not required." msgstr "" -#: ../../library/subprocess.rst:1398 +#: ../../library/subprocess.rst:1400 msgid "" "The :func:`call` return value is encoded differently to that of :func:`os." "system`." msgstr "" -#: ../../library/subprocess.rst:1401 +#: ../../library/subprocess.rst:1403 msgid "" "The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " "command is running, but the caller must do this separately when using the :" "mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1405 +#: ../../library/subprocess.rst:1407 msgid "A more realistic example would look like this::" msgstr "" -#: ../../library/subprocess.rst:1407 +#: ../../library/subprocess.rst:1409 msgid "" "try:\n" " retcode = call(\"mycmd\" + \" myarg\", shell=True)\n" @@ -1785,15 +1787,15 @@ msgstr "" "except OSError as e:\n" " print(\"Execution failed:\", e, file=sys.stderr)" -#: ../../library/subprocess.rst:1418 +#: ../../library/subprocess.rst:1420 msgid "Replacing the :func:`os.spawn ` family" msgstr "" -#: ../../library/subprocess.rst:1420 +#: ../../library/subprocess.rst:1422 msgid "P_NOWAIT example::" msgstr "P_NOWAIT 範例: ::" -#: ../../library/subprocess.rst:1422 +#: ../../library/subprocess.rst:1424 msgid "" "pid = os.spawnlp(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n" "==>\n" @@ -1803,11 +1805,11 @@ msgstr "" "==>\n" "pid = Popen([\"/bin/mycmd\", \"myarg\"]).pid" -#: ../../library/subprocess.rst:1426 +#: ../../library/subprocess.rst:1428 msgid "P_WAIT example::" msgstr "P_WAIT 範例: ::" -#: ../../library/subprocess.rst:1428 +#: ../../library/subprocess.rst:1430 msgid "" "retcode = os.spawnlp(os.P_WAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n" "==>\n" @@ -1817,11 +1819,11 @@ msgstr "" "==>\n" "retcode = call([\"/bin/mycmd\", \"myarg\"])" -#: ../../library/subprocess.rst:1432 +#: ../../library/subprocess.rst:1434 msgid "Vector example::" msgstr "向量範例: ::" -#: ../../library/subprocess.rst:1434 +#: ../../library/subprocess.rst:1436 msgid "" "os.spawnvp(os.P_NOWAIT, path, args)\n" "==>\n" @@ -1831,11 +1833,11 @@ msgstr "" "==>\n" "Popen([path] + args[1:])" -#: ../../library/subprocess.rst:1438 +#: ../../library/subprocess.rst:1440 msgid "Environment example::" msgstr "環境範例: ::" -#: ../../library/subprocess.rst:1440 +#: ../../library/subprocess.rst:1442 msgid "" "os.spawnlpe(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\", env)\n" "==>\n" @@ -1845,15 +1847,15 @@ msgstr "" "==>\n" "Popen([\"/bin/mycmd\", \"myarg\"], env={\"PATH\": \"/usr/bin\"})" -#: ../../library/subprocess.rst:1447 +#: ../../library/subprocess.rst:1449 msgid "Replacing :func:`os.popen`" msgstr "取代 :func:`os.popen`" -#: ../../library/subprocess.rst:1449 +#: ../../library/subprocess.rst:1451 msgid "Return code handling translates as follows::" msgstr "" -#: ../../library/subprocess.rst:1451 +#: ../../library/subprocess.rst:1453 msgid "" "pipe = os.popen(cmd, 'w')\n" "...\n" @@ -1879,11 +1881,11 @@ msgstr "" "if process.wait() != 0:\n" " print(\"There were some errors\")" -#: ../../library/subprocess.rst:1465 +#: ../../library/subprocess.rst:1467 msgid "Legacy Shell Invocation Functions" msgstr "" -#: ../../library/subprocess.rst:1467 +#: ../../library/subprocess.rst:1469 msgid "" "This module also provides the following legacy functions from the 2.x " "``commands`` module. These operations implicitly invoke the system shell and " @@ -1891,24 +1893,24 @@ msgid "" "handling consistency are valid for these functions." msgstr "" -#: ../../library/subprocess.rst:1474 +#: ../../library/subprocess.rst:1476 msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1476 +#: ../../library/subprocess.rst:1478 msgid "" "Execute the string *cmd* in a shell with :func:`check_output` and return a 2-" "tuple ``(exitcode, output)``. *encoding* and *errors* are used to decode " "output; see the notes on :ref:`frequently-used-arguments` for more details." msgstr "" -#: ../../library/subprocess.rst:1481 +#: ../../library/subprocess.rst:1483 msgid "" "A trailing newline is stripped from the output. The exit code for the " "command can be interpreted as the return code of subprocess. Example::" msgstr "" -#: ../../library/subprocess.rst:1485 +#: ../../library/subprocess.rst:1487 msgid "" ">>> subprocess.getstatusoutput('ls /bin/ls')\n" "(0, '/bin/ls')\n" @@ -1928,28 +1930,28 @@ msgstr "" ">>> subprocess.getstatusoutput('/bin/kill $$')\n" "(-15, '')" -#: ../../library/subprocess.rst:1496 +#: ../../library/subprocess.rst:1498 msgid "Windows support was added." msgstr "新增對 Windows 的支援。" -#: ../../library/subprocess.rst:1499 +#: ../../library/subprocess.rst:1501 msgid "" "The function now returns (exitcode, output) instead of (status, output) as " "it did in Python 3.3.3 and earlier. exitcode has the same value as :attr:" "`~Popen.returncode`." msgstr "" -#: ../../library/subprocess.rst:1508 +#: ../../library/subprocess.rst:1510 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1510 +#: ../../library/subprocess.rst:1512 msgid "" "Like :func:`getstatusoutput`, except the exit code is ignored and the return " "value is a string containing the command's output. Example::" msgstr "" -#: ../../library/subprocess.rst:1513 +#: ../../library/subprocess.rst:1515 msgid "" ">>> subprocess.getoutput('ls /bin/ls')\n" "'/bin/ls'" @@ -1957,26 +1959,26 @@ msgstr "" ">>> subprocess.getoutput('ls /bin/ls')\n" "'/bin/ls'" -#: ../../library/subprocess.rst:1518 +#: ../../library/subprocess.rst:1520 msgid "Windows support added" msgstr "新增對 Windows 的支援" -#: ../../library/subprocess.rst:1526 +#: ../../library/subprocess.rst:1528 msgid "Notes" msgstr "註解" -#: ../../library/subprocess.rst:1531 +#: ../../library/subprocess.rst:1533 msgid "Timeout Behavior" msgstr "" -#: ../../library/subprocess.rst:1533 +#: ../../library/subprocess.rst:1535 msgid "" "When using the ``timeout`` parameter in functions like :func:`run`, :meth:" "`Popen.wait`, or :meth:`Popen.communicate`, users should be aware of the " "following behaviors:" msgstr "" -#: ../../library/subprocess.rst:1537 +#: ../../library/subprocess.rst:1539 msgid "" "**Process Creation Delay**: The initial process creation itself cannot be " "interrupted on many platform APIs. This means that even when specifying a " @@ -1984,7 +1986,7 @@ msgid "" "after however long process creation takes." msgstr "" -#: ../../library/subprocess.rst:1542 +#: ../../library/subprocess.rst:1544 msgid "" "**Extremely Small Timeout Values**: Setting very small timeout values (such " "as a few milliseconds) may result in almost immediate :exc:`TimeoutExpired` " @@ -1992,42 +1994,42 @@ msgid "" "time." msgstr "" -#: ../../library/subprocess.rst:1549 +#: ../../library/subprocess.rst:1551 msgid "Converting an argument sequence to a string on Windows" msgstr "" -#: ../../library/subprocess.rst:1551 +#: ../../library/subprocess.rst:1553 msgid "" "On Windows, an *args* sequence is converted to a string that can be parsed " "using the following rules (which correspond to the rules used by the MS C " "runtime):" msgstr "" -#: ../../library/subprocess.rst:1555 +#: ../../library/subprocess.rst:1557 msgid "" "Arguments are delimited by white space, which is either a space or a tab." msgstr "" -#: ../../library/subprocess.rst:1558 +#: ../../library/subprocess.rst:1560 msgid "" "A string surrounded by double quotation marks is interpreted as a single " "argument, regardless of white space contained within. A quoted string can " "be embedded in an argument." msgstr "" -#: ../../library/subprocess.rst:1563 +#: ../../library/subprocess.rst:1565 msgid "" "A double quotation mark preceded by a backslash is interpreted as a literal " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1566 +#: ../../library/subprocess.rst:1568 msgid "" "Backslashes are interpreted literally, unless they immediately precede a " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1569 +#: ../../library/subprocess.rst:1571 msgid "" "If backslashes immediately precede a double quotation mark, every pair of " "backslashes is interpreted as a literal backslash. If the number of " @@ -2035,19 +2037,19 @@ msgid "" "mark as described in rule 3." msgstr "" -#: ../../library/subprocess.rst:1578 +#: ../../library/subprocess.rst:1580 msgid ":mod:`shlex`" msgstr ":mod:`shlex`" -#: ../../library/subprocess.rst:1579 +#: ../../library/subprocess.rst:1581 msgid "Module which provides function to parse and escape command lines." msgstr "" -#: ../../library/subprocess.rst:1585 +#: ../../library/subprocess.rst:1587 msgid "Disable use of ``posix_spawn()``" msgstr "停用 ``posix_spawn()``" -#: ../../library/subprocess.rst:1587 +#: ../../library/subprocess.rst:1589 msgid "" "On Linux, :mod:`subprocess` defaults to using the ``vfork()`` system call " "internally when it is safe to do so rather than ``fork()``. This greatly " @@ -2056,11 +2058,11 @@ msgstr "" "在 Linux 上,:mod:`subprocess` 在安全的情況下預設會在內部使用 ``vfork()`` 系" "統呼叫,而不是 ``fork()``,這顯著地提高了性能。" -#: ../../library/subprocess.rst:1593 +#: ../../library/subprocess.rst:1595 msgid "subprocess._USE_POSIX_SPAWN = False # See CPython issue gh-NNNNNN." msgstr "subprocess._USE_POSIX_SPAWN = False # 見 CPython 問題 gh-NNNNNN。" -#: ../../library/subprocess.rst:1595 +#: ../../library/subprocess.rst:1597 msgid "" "It is safe to set this to false on any Python version. It will have no " "effect on older or newer versions where unsupported. Do not assume the " @@ -2071,7 +2073,7 @@ msgstr "" "沒有支援的新版本沒有影響。不要假設屬性可供讀取。儘管它的名稱是這樣,真實值並" "不表示將使用相應的函式,而只是表示可能會使用。" -#: ../../library/subprocess.rst:1600 +#: ../../library/subprocess.rst:1602 msgid "" "Please file issues any time you have to use these private knobs with a way " "to reproduce the issue you were seeing. Link to that issue from a comment in " @@ -2080,7 +2082,7 @@ msgstr "" "每當你需要使用這些私有開關以重現你所看到的問題時,請隨時提出問題 (file " "issues)。從程式碼中的註解連結到該問題。" -#: ../../library/subprocess.rst:1604 +#: ../../library/subprocess.rst:1606 msgid "``_USE_POSIX_SPAWN``" msgstr "``_USE_POSIX_SPAWN``" diff --git a/library/xml.sax.handler.po b/library/xml.sax.handler.po index d808995c74..2dea812f61 100644 --- a/library/xml.sax.handler.po +++ b/library/xml.sax.handler.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-04 00:15+0000\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -95,8 +95,8 @@ msgstr "" #: ../../library/xml.sax.handler.rst:66 ../../library/xml.sax.handler.rst:76 #: ../../library/xml.sax.handler.rst:85 ../../library/xml.sax.handler.rst:94 -#: ../../library/xml.sax.handler.rst:102 ../../library/xml.sax.handler.rst:112 -#: ../../library/xml.sax.handler.rst:144 +#: ../../library/xml.sax.handler.rst:110 ../../library/xml.sax.handler.rst:120 +#: ../../library/xml.sax.handler.rst:152 msgid "access: (parsing) read-only; (not parsing) read/write" msgstr "" @@ -145,123 +145,131 @@ msgstr "" msgid "false: Do not report validation errors." msgstr "" -#: ../../library/xml.sax.handler.rst:99 +#: ../../library/xml.sax.handler.rst:101 +msgid "" +"Enabling opens a vulnerability to `external entity attacks `_ if the parser is used with " +"user-provided XML content. Please reflect on your `threat model `_ before enabling this feature." +msgstr "" + +#: ../../library/xml.sax.handler.rst:107 msgid "value: ``\"http://xml.org/sax/features/external-general-entities\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:100 +#: ../../library/xml.sax.handler.rst:108 msgid "true: Include all external general (text) entities." msgstr "" -#: ../../library/xml.sax.handler.rst:101 +#: ../../library/xml.sax.handler.rst:109 msgid "false: Do not include external general entities." msgstr "" -#: ../../library/xml.sax.handler.rst:107 +#: ../../library/xml.sax.handler.rst:115 msgid "value: ``\"http://xml.org/sax/features/external-parameter-entities\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:109 +#: ../../library/xml.sax.handler.rst:117 msgid "" "true: Include all external parameter entities, including the external DTD " "subset." msgstr "" -#: ../../library/xml.sax.handler.rst:111 +#: ../../library/xml.sax.handler.rst:119 msgid "" "false: Do not include any external parameter entities, even the external DTD " "subset." msgstr "" -#: ../../library/xml.sax.handler.rst:117 +#: ../../library/xml.sax.handler.rst:125 msgid "List of all features." msgstr "" -#: ../../library/xml.sax.handler.rst:122 +#: ../../library/xml.sax.handler.rst:130 msgid "value: ``\"http://xml.org/sax/properties/lexical-handler\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:123 +#: ../../library/xml.sax.handler.rst:131 msgid "data type: xml.sax.handler.LexicalHandler (not supported in Python 2)" msgstr "" -#: ../../library/xml.sax.handler.rst:125 +#: ../../library/xml.sax.handler.rst:133 msgid "" "description: An optional extension handler for lexical events like comments." msgstr "" -#: ../../library/xml.sax.handler.rst:126 ../../library/xml.sax.handler.rst:135 +#: ../../library/xml.sax.handler.rst:134 ../../library/xml.sax.handler.rst:143 msgid "access: read/write" msgstr "" -#: ../../library/xml.sax.handler.rst:131 +#: ../../library/xml.sax.handler.rst:139 msgid "value: ``\"http://xml.org/sax/properties/declaration-handler\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:132 +#: ../../library/xml.sax.handler.rst:140 msgid "data type: xml.sax.sax2lib.DeclHandler (not supported in Python 2)" msgstr "" -#: ../../library/xml.sax.handler.rst:134 +#: ../../library/xml.sax.handler.rst:142 msgid "" "description: An optional extension handler for DTD-related events other than " "notations and unparsed entities." msgstr "" -#: ../../library/xml.sax.handler.rst:140 +#: ../../library/xml.sax.handler.rst:148 msgid "value: ``\"http://xml.org/sax/properties/dom-node\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:141 +#: ../../library/xml.sax.handler.rst:149 msgid "data type: org.w3c.dom.Node (not supported in Python 2)" msgstr "" -#: ../../library/xml.sax.handler.rst:143 +#: ../../library/xml.sax.handler.rst:151 msgid "" "description: When parsing, the current DOM node being visited if this is a " "DOM iterator; when not parsing, the root DOM node for iteration." msgstr "" -#: ../../library/xml.sax.handler.rst:149 +#: ../../library/xml.sax.handler.rst:157 msgid "value: ``\"http://xml.org/sax/properties/xml-string\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:150 +#: ../../library/xml.sax.handler.rst:158 msgid "data type: Bytes" msgstr "" -#: ../../library/xml.sax.handler.rst:152 +#: ../../library/xml.sax.handler.rst:160 msgid "" "description: The literal string of characters that was the source for the " "current event." msgstr "" -#: ../../library/xml.sax.handler.rst:153 +#: ../../library/xml.sax.handler.rst:161 msgid "access: read-only" msgstr "" -#: ../../library/xml.sax.handler.rst:158 +#: ../../library/xml.sax.handler.rst:166 msgid "List of all known property names." msgstr "" -#: ../../library/xml.sax.handler.rst:164 +#: ../../library/xml.sax.handler.rst:172 msgid "ContentHandler Objects" msgstr "ContentHandler 物件" -#: ../../library/xml.sax.handler.rst:166 +#: ../../library/xml.sax.handler.rst:174 msgid "" "Users are expected to subclass :class:`ContentHandler` to support their " "application. The following methods are called by the parser on the " "appropriate events in the input document:" msgstr "" -#: ../../library/xml.sax.handler.rst:173 +#: ../../library/xml.sax.handler.rst:181 msgid "" "Called by the parser to give the application a locator for locating the " "origin of document events." msgstr "" -#: ../../library/xml.sax.handler.rst:176 +#: ../../library/xml.sax.handler.rst:184 msgid "" "SAX parsers are strongly encouraged (though not absolutely required) to " "supply a locator: if it does so, it must supply the locator to the " @@ -269,7 +277,7 @@ msgid "" "in the DocumentHandler interface." msgstr "" -#: ../../library/xml.sax.handler.rst:181 +#: ../../library/xml.sax.handler.rst:189 msgid "" "The locator allows the application to determine the end position of any " "document-related event, even if the parser is not reporting an error. " @@ -279,28 +287,28 @@ msgid "" "sufficient for use with a search engine." msgstr "" -#: ../../library/xml.sax.handler.rst:188 +#: ../../library/xml.sax.handler.rst:196 msgid "" "Note that the locator will return correct information only during the " "invocation of the events in this interface. The application should not " "attempt to use it at any other time." msgstr "" -#: ../../library/xml.sax.handler.rst:195 +#: ../../library/xml.sax.handler.rst:203 msgid "Receive notification of the beginning of a document." msgstr "" -#: ../../library/xml.sax.handler.rst:197 +#: ../../library/xml.sax.handler.rst:205 msgid "" "The SAX parser will invoke this method only once, before any other methods " "in this interface or in DTDHandler (except for :meth:`setDocumentLocator`)." msgstr "" -#: ../../library/xml.sax.handler.rst:203 +#: ../../library/xml.sax.handler.rst:211 msgid "Receive notification of the end of a document." msgstr "" -#: ../../library/xml.sax.handler.rst:205 +#: ../../library/xml.sax.handler.rst:213 msgid "" "The SAX parser will invoke this method only once, and it will be the last " "method invoked during the parse. The parser shall not invoke this method " @@ -308,11 +316,11 @@ msgid "" "reached the end of input." msgstr "" -#: ../../library/xml.sax.handler.rst:213 +#: ../../library/xml.sax.handler.rst:221 msgid "Begin the scope of a prefix-URI Namespace mapping." msgstr "" -#: ../../library/xml.sax.handler.rst:215 +#: ../../library/xml.sax.handler.rst:223 msgid "" "The information from this event is not necessary for normal Namespace " "processing: the SAX XML reader will automatically replace prefixes for " @@ -320,7 +328,7 @@ msgid "" "enabled (the default)." msgstr "" -#: ../../library/xml.sax.handler.rst:220 +#: ../../library/xml.sax.handler.rst:228 msgid "" "There are cases, however, when applications need to use prefixes in " "character data or in attribute values, where they cannot safely be expanded " @@ -329,7 +337,7 @@ msgid "" "contexts itself, if necessary." msgstr "" -#: ../../library/xml.sax.handler.rst:228 +#: ../../library/xml.sax.handler.rst:236 msgid "" "Note that :meth:`startPrefixMapping` and :meth:`endPrefixMapping` events are " "not guaranteed to be properly nested relative to each-other: all :meth:" @@ -339,22 +347,22 @@ msgid "" "guaranteed." msgstr "" -#: ../../library/xml.sax.handler.rst:238 +#: ../../library/xml.sax.handler.rst:246 msgid "End the scope of a prefix-URI mapping." msgstr "" -#: ../../library/xml.sax.handler.rst:240 +#: ../../library/xml.sax.handler.rst:248 msgid "" "See :meth:`startPrefixMapping` for details. This event will always occur " "after the corresponding :meth:`endElement` event, but the order of :meth:" "`endPrefixMapping` events is not otherwise guaranteed." msgstr "" -#: ../../library/xml.sax.handler.rst:247 +#: ../../library/xml.sax.handler.rst:255 msgid "Signals the start of an element in non-namespace mode." msgstr "" -#: ../../library/xml.sax.handler.rst:249 +#: ../../library/xml.sax.handler.rst:257 msgid "" "The *name* parameter contains the raw XML 1.0 name of the element type as a " "string and the *attrs* parameter holds an object of the :ref:`Attributes " @@ -365,21 +373,21 @@ msgid "" "object." msgstr "" -#: ../../library/xml.sax.handler.rst:260 +#: ../../library/xml.sax.handler.rst:268 msgid "Signals the end of an element in non-namespace mode." msgstr "" -#: ../../library/xml.sax.handler.rst:262 +#: ../../library/xml.sax.handler.rst:270 msgid "" "The *name* parameter contains the name of the element type, just as with " "the :meth:`startElement` event." msgstr "" -#: ../../library/xml.sax.handler.rst:268 +#: ../../library/xml.sax.handler.rst:276 msgid "Signals the start of an element in namespace mode." msgstr "" -#: ../../library/xml.sax.handler.rst:270 +#: ../../library/xml.sax.handler.rst:278 msgid "" "The *name* parameter contains the name of the element type as a ``(uri, " "localname)`` tuple, the *qname* parameter contains the raw XML 1.0 name used " @@ -392,27 +400,27 @@ msgid "" "attributes, use the :meth:`copy` method of the *attrs* object." msgstr "" -#: ../../library/xml.sax.handler.rst:280 +#: ../../library/xml.sax.handler.rst:288 msgid "" "Parsers may set the *qname* parameter to ``None``, unless the " "``feature_namespace_prefixes`` feature is activated." msgstr "" -#: ../../library/xml.sax.handler.rst:286 +#: ../../library/xml.sax.handler.rst:294 msgid "Signals the end of an element in namespace mode." msgstr "" -#: ../../library/xml.sax.handler.rst:288 +#: ../../library/xml.sax.handler.rst:296 msgid "" "The *name* parameter contains the name of the element type, just as with " "the :meth:`startElementNS` method, likewise the *qname* parameter." msgstr "" -#: ../../library/xml.sax.handler.rst:294 +#: ../../library/xml.sax.handler.rst:302 msgid "Receive notification of character data." msgstr "" -#: ../../library/xml.sax.handler.rst:296 +#: ../../library/xml.sax.handler.rst:304 msgid "" "The Parser will call this method to report each chunk of character data. SAX " "parsers may return all contiguous character data in a single chunk, or they " @@ -421,13 +429,13 @@ msgid "" "provides useful information." msgstr "" -#: ../../library/xml.sax.handler.rst:302 +#: ../../library/xml.sax.handler.rst:310 msgid "" "*content* may be a string or bytes instance; the ``expat`` reader module " "always produces strings." msgstr "" -#: ../../library/xml.sax.handler.rst:307 +#: ../../library/xml.sax.handler.rst:315 msgid "" "The earlier SAX 1 interface provided by the Python XML Special Interest " "Group used a more Java-like interface for this method. Since most parsers " @@ -437,11 +445,11 @@ msgid "" "and *length* parameters." msgstr "" -#: ../../library/xml.sax.handler.rst:316 +#: ../../library/xml.sax.handler.rst:324 msgid "Receive notification of ignorable whitespace in element content." msgstr "" -#: ../../library/xml.sax.handler.rst:318 +#: ../../library/xml.sax.handler.rst:326 msgid "" "Validating Parsers must use this method to report each chunk of ignorable " "whitespace (see the W3C XML 1.0 recommendation, section 2.10): non-" @@ -449,7 +457,7 @@ msgid "" "and using content models." msgstr "" -#: ../../library/xml.sax.handler.rst:323 +#: ../../library/xml.sax.handler.rst:331 msgid "" "SAX parsers may return all contiguous whitespace in a single chunk, or they " "may split it into several chunks; however, all of the characters in any " @@ -457,28 +465,28 @@ msgid "" "provides useful information." msgstr "" -#: ../../library/xml.sax.handler.rst:331 +#: ../../library/xml.sax.handler.rst:339 msgid "Receive notification of a processing instruction." msgstr "" -#: ../../library/xml.sax.handler.rst:333 +#: ../../library/xml.sax.handler.rst:341 msgid "" "The Parser will invoke this method once for each processing instruction " "found: note that processing instructions may occur before or after the main " "document element." msgstr "" -#: ../../library/xml.sax.handler.rst:337 +#: ../../library/xml.sax.handler.rst:345 msgid "" "A SAX parser should never report an XML declaration (XML 1.0, section 2.8) " "or a text declaration (XML 1.0, section 4.3.1) using this method." msgstr "" -#: ../../library/xml.sax.handler.rst:343 +#: ../../library/xml.sax.handler.rst:351 msgid "Receive notification of a skipped entity." msgstr "" -#: ../../library/xml.sax.handler.rst:345 +#: ../../library/xml.sax.handler.rst:353 msgid "" "The Parser will invoke this method once for each entity skipped. Non-" "validating processors may skip entities if they have not seen the " @@ -488,38 +496,38 @@ msgid "" "properties." msgstr "" -#: ../../library/xml.sax.handler.rst:355 +#: ../../library/xml.sax.handler.rst:363 msgid "DTDHandler Objects" msgstr "DTDHandler 物件" -#: ../../library/xml.sax.handler.rst:357 +#: ../../library/xml.sax.handler.rst:365 msgid ":class:`DTDHandler` instances provide the following methods:" msgstr "" -#: ../../library/xml.sax.handler.rst:362 +#: ../../library/xml.sax.handler.rst:370 msgid "Handle a notation declaration event." msgstr "" -#: ../../library/xml.sax.handler.rst:367 +#: ../../library/xml.sax.handler.rst:375 msgid "Handle an unparsed entity declaration event." msgstr "" -#: ../../library/xml.sax.handler.rst:373 +#: ../../library/xml.sax.handler.rst:381 msgid "EntityResolver Objects" msgstr "EntityResolver 物件" -#: ../../library/xml.sax.handler.rst:378 +#: ../../library/xml.sax.handler.rst:386 msgid "" "Resolve the system identifier of an entity and return either the system " "identifier to read from as a string, or an InputSource to read from. The " "default implementation returns *systemId*." msgstr "" -#: ../../library/xml.sax.handler.rst:386 +#: ../../library/xml.sax.handler.rst:394 msgid "ErrorHandler Objects" msgstr "ErrorHandler 物件" -#: ../../library/xml.sax.handler.rst:388 +#: ../../library/xml.sax.handler.rst:396 msgid "" "Objects with this interface are used to receive error and warning " "information from the :class:`~xml.sax.xmlreader.XMLReader`. If you create " @@ -532,7 +540,7 @@ msgid "" "the passed-in exception object." msgstr "" -#: ../../library/xml.sax.handler.rst:401 +#: ../../library/xml.sax.handler.rst:409 msgid "" "Called when the parser encounters a recoverable error. If this method does " "not raise an exception, parsing may continue, but further document " @@ -541,13 +549,13 @@ msgid "" "document." msgstr "" -#: ../../library/xml.sax.handler.rst:409 +#: ../../library/xml.sax.handler.rst:417 msgid "" "Called when the parser encounters an error it cannot recover from; parsing " "is expected to terminate when this method returns." msgstr "" -#: ../../library/xml.sax.handler.rst:415 +#: ../../library/xml.sax.handler.rst:423 msgid "" "Called when the parser presents minor warning information to the " "application. Parsing is expected to continue when this method returns, and " @@ -555,15 +563,15 @@ msgid "" "an exception in this method will cause parsing to end." msgstr "" -#: ../../library/xml.sax.handler.rst:424 +#: ../../library/xml.sax.handler.rst:432 msgid "LexicalHandler Objects" msgstr "LexicalHandler 物件" -#: ../../library/xml.sax.handler.rst:425 +#: ../../library/xml.sax.handler.rst:433 msgid "Optional SAX2 handler for lexical events." msgstr "" -#: ../../library/xml.sax.handler.rst:427 +#: ../../library/xml.sax.handler.rst:435 msgid "" "This handler is used to obtain lexical information about an XML document. " "Lexical information includes information describing the document encoding " @@ -572,38 +580,38 @@ msgid "" "used in the same manner as content handlers." msgstr "" -#: ../../library/xml.sax.handler.rst:433 +#: ../../library/xml.sax.handler.rst:441 msgid "" "Set the LexicalHandler of an XMLReader by using the setProperty method with " "the property identifier ``'http://xml.org/sax/properties/lexical-handler'``." msgstr "" -#: ../../library/xml.sax.handler.rst:440 +#: ../../library/xml.sax.handler.rst:448 msgid "" "Reports a comment anywhere in the document (including the DTD and outside " "the document element)." msgstr "" -#: ../../library/xml.sax.handler.rst:445 +#: ../../library/xml.sax.handler.rst:453 msgid "" "Reports the start of the DTD declarations if the document has an associated " "DTD." msgstr "" -#: ../../library/xml.sax.handler.rst:450 +#: ../../library/xml.sax.handler.rst:458 msgid "Reports the end of DTD declaration." msgstr "" -#: ../../library/xml.sax.handler.rst:454 +#: ../../library/xml.sax.handler.rst:462 msgid "Reports the start of a CDATA marked section." msgstr "" -#: ../../library/xml.sax.handler.rst:456 +#: ../../library/xml.sax.handler.rst:464 msgid "" "The contents of the CDATA marked section will be reported through the " "characters handler." msgstr "" -#: ../../library/xml.sax.handler.rst:461 +#: ../../library/xml.sax.handler.rst:469 msgid "Reports the end of a CDATA marked section." msgstr "" diff --git a/library/zipfile.po b/library/zipfile.po index e229539354..5894863653 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2025-06-26 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,12 +39,13 @@ msgstr "" "Application Note`_ 中定義的格式有所理解。" #: ../../library/zipfile.rst:19 +#, fuzzy msgid "" -"This module does not currently handle multi-disk ZIP files. It can handle " -"ZIP files that use the ZIP64 extensions (that is ZIP files that are more " -"than 4 GiB in size). It supports decryption of encrypted files in ZIP " -"archives, but it currently cannot create an encrypted file. Decryption is " -"extremely slow as it is implemented in native Python rather than C." +"This module does not handle multipart ZIP files. It can handle ZIP files " +"that use the ZIP64 extensions (that is ZIP files that are more than 4 GiB in " +"size). It supports decryption of encrypted files in ZIP archives, but it " +"cannot create an encrypted file. Decryption is extremely slow as it is " +"implemented in native Python rather than C." msgstr "" "本模組目前不處理多磁碟 ZIP 檔案。它可以處理使用 ZIP64 擴充(即大於 4 GiB 的 " "ZIP 檔案)的 ZIP 檔案。它支援解密 ZIP 封存檔案中的加密檔案,但目前無法建立加" @@ -220,7 +221,8 @@ msgid "" msgstr "關於 Info-ZIP 專案的 ZIP 封存程式和開發函式庫的資訊。" #: ../../library/zipfile.rst:179 -msgid "ZipFile Objects" +#, fuzzy +msgid "ZipFile objects" msgstr "ZipFile 物件" #: ../../library/zipfile.rst:186 @@ -354,9 +356,10 @@ msgstr "" " myzip.write('eggs.txt')" #: ../../library/zipfile.rst:250 +#, fuzzy msgid "" "*metadata_encoding* is an instance-wide setting for the ZipFile. It is not " -"currently possible to set this on a per-member basis." +"possible to set this on a per-member basis." msgstr "" "*metadata_encoding* 是 ZipFile 的一個實例範圍設定。目前無法以每個成員為基礎來" "設定此項。" @@ -858,7 +861,8 @@ msgstr "" "65535 位元組。超過此長度的註解將被截斷。" #: ../../library/zipfile.rst:575 -msgid "Path Objects" +#, fuzzy +msgid "Path objects" msgstr "Path 物件" #: ../../library/zipfile.rst:579 @@ -1033,7 +1037,8 @@ msgstr "" "用 ``zipp.Path`` 來取代 ``zipfile.Path`` 以提早使用變更。" #: ../../library/zipfile.rst:711 -msgid "PyZipFile Objects" +#, fuzzy +msgid "PyZipFile objects" msgstr "PyZipFile 物件" #: ../../library/zipfile.rst:713 @@ -1163,7 +1168,8 @@ msgid "Recursion sorts directory entries." msgstr "遞迴會對目錄條目進行排序。" #: ../../library/zipfile.rst:788 -msgid "ZipInfo Objects" +#, fuzzy +msgid "ZipInfo objects" msgstr "ZipInfo 物件" #: ../../library/zipfile.rst:790 @@ -1378,7 +1384,8 @@ msgid "Size of the uncompressed file." msgstr "未壓縮檔案的大小。" #: ../../library/zipfile.rst:958 -msgid "Command-Line Interface" +#, fuzzy +msgid "Command-line interface" msgstr "命令列介面" #: ../../library/zipfile.rst:960 @@ -1476,7 +1483,8 @@ msgstr "" "失敗。" #: ../../library/zipfile.rst:1033 -msgid "File System limitations" +#, fuzzy +msgid "File system limitations" msgstr "檔案系統限制" #: ../../library/zipfile.rst:1035 diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 4de853b5b4..96dcf434a6 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1463,7 +1463,7 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:1125 -msgid "I. The keyword is looked up as an attribute on the subject." +msgid "The keyword is looked up as an attribute on the subject." msgstr "" #: ../../reference/compound_stmts.rst:1127 @@ -1484,7 +1484,7 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:1137 -msgid "II. If all keyword patterns succeed, the class pattern succeeds." +msgid "If all keyword patterns succeed, the class pattern succeeds." msgstr "" #: ../../reference/compound_stmts.rst:1139 @@ -1495,8 +1495,7 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:1143 -msgid "" -"I. The equivalent of ``getattr(cls, \"__match_args__\", ())`` is called." +msgid "The equivalent of ``getattr(cls, \"__match_args__\", ())`` is called." msgstr "" #: ../../reference/compound_stmts.rst:1145 @@ -1532,11 +1531,8 @@ msgstr ":ref:`class-pattern-matching`" #: ../../reference/compound_stmts.rst:1161 msgid "" -"II. Once all positional patterns have been converted to keyword patterns," -msgstr "" - -#: ../../reference/compound_stmts.rst:1162 -msgid "the match proceeds as if there were only keyword patterns." +"Once all positional patterns have been converted to keyword patterns, the " +"match proceeds as if there were only keyword patterns." msgstr "" #: ../../reference/compound_stmts.rst:1164 diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index feb5b3c04f..a49e6dff1c 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-10 20:44+0800\n" +"POT-Creation-Date: 2025-11-30 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,7 +26,8 @@ msgid "Author" msgstr "作者" #: ../../whatsnew/3.4.rst:5 -msgid "R. David Murray (Editor)" +#, fuzzy +msgid "\\R. David Murray (Editor)" msgstr "R. David Murray (編輯者)" #: ../../whatsnew/3.4.rst:63 @@ -71,8 +72,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:89 msgid "" -"command line option for :ref:`isolated mode ` " -"(:issue:`16499`)." +"command line option for :ref:`isolated mode ` (:" +"issue:`16499`)." msgstr "" #: ../../whatsnew/3.4.rst:91 @@ -83,8 +84,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:93 msgid "" -":ref:`A ModuleSpec Type ` for the Import System " -"(:pep:`451`). (Affects importer authors.)" +":ref:`A ModuleSpec Type ` for the Import System (:pep:" +"`451`). (Affects importer authors.)" msgstr "" #: ../../whatsnew/3.4.rst:95 @@ -102,35 +103,35 @@ msgid "" ":mod:`asyncio`: :ref:`New provisional API for asynchronous IO ` (:pep:`3156`)." msgstr "" -":mod:`asyncio`: :ref:`新的用於非同步 IO 的臨時 API ` " -"(:pep:`3156`)。" +":mod:`asyncio`: :ref:`新的用於非同步 IO 的臨時 API ` (:" +"pep:`3156`)。" #: ../../whatsnew/3.4.rst:102 msgid "" ":mod:`ensurepip`: :ref:`Bootstrapping the pip installer ` (:pep:`453`)." msgstr "" -":mod:`ensurepip`: :ref:`初始建置 pip 安裝程式 ` " -"(:pep:`453`)。" +":mod:`ensurepip`: :ref:`初始建置 pip 安裝程式 ` (:pep:" +"`453`)。" #: ../../whatsnew/3.4.rst:104 msgid "" -":mod:`enum`: :ref:`Support for enumeration types ` " -"(:pep:`435`)." +":mod:`enum`: :ref:`Support for enumeration types ` (:pep:" +"`435`)." msgstr ":mod:`enum`: :ref:`支援列舉型別 ` (:pep:`435`)。" #: ../../whatsnew/3.4.rst:106 msgid "" -":mod:`pathlib`: :ref:`Object-oriented filesystem paths ` " -"(:pep:`428`)." +":mod:`pathlib`: :ref:`Object-oriented filesystem paths ` (:" +"pep:`428`)." msgstr "" ":mod:`pathlib`: :ref:`物件導向檔案系統路徑 ` (:pep:`428`)。" #: ../../whatsnew/3.4.rst:108 msgid "" ":mod:`selectors`: :ref:`High-level and efficient I/O multiplexing `, built upon the :mod:`select` module primitives (part " -"of :pep:`3156`)." +"selectors>`, built upon the :mod:`select` module primitives (part of :pep:" +"`3156`)." msgstr "" #: ../../whatsnew/3.4.rst:111 @@ -144,8 +145,8 @@ msgid "" ":mod:`tracemalloc`: :ref:`Trace Python memory allocations ` (:pep:`454`)." msgstr "" -":mod:`tracemalloc`: :ref:`追蹤 Python 記憶體配置 ` " -"(:pep:`454`)。" +":mod:`tracemalloc`: :ref:`追蹤 Python 記憶體配置 ` (:" +"pep:`454`)。" #: ../../whatsnew/3.4.rst:116 msgid "Significantly improved library modules:" @@ -153,8 +154,8 @@ msgstr "顯著改進的函式庫模組:" #: ../../whatsnew/3.4.rst:118 msgid "" -":ref:`Single-dispatch generic functions ` " -"in :mod:`functools` (:pep:`443`)." +":ref:`Single-dispatch generic functions ` in :mod:" +"`functools` (:pep:`443`)." msgstr "" #: ../../whatsnew/3.4.rst:120 @@ -172,10 +173,10 @@ msgstr "" #: ../../whatsnew/3.4.rst:123 msgid "" -":mod:`email` has a new submodule, :mod:`~email.contentmanager`, and a " -"new :mod:`~email.message.Message` subclass " -"(:class:`~email.message.EmailMessage`) that :ref:`simplify MIME handling " -"` (:issue:`18891`)." +":mod:`email` has a new submodule, :mod:`~email.contentmanager`, and a new :" +"mod:`~email.message.Message` subclass (:class:`~email.message.EmailMessage`) " +"that :ref:`simplify MIME handling ` (:issue:" +"`18891`)." msgstr "" #: ../../whatsnew/3.4.rst:127 @@ -195,8 +196,8 @@ msgstr "安全性改進:" #: ../../whatsnew/3.4.rst:134 msgid "" -":ref:`Secure and interchangeable hash algorithm ` " -"(:pep:`456`)." +":ref:`Secure and interchangeable hash algorithm ` (:pep:" +"`456`)." msgstr "" #: ../../whatsnew/3.4.rst:136 @@ -207,11 +208,11 @@ msgstr "" #: ../../whatsnew/3.4.rst:138 msgid "" -"New command line option for :ref:`isolated mode `, " -"(:issue:`16499`)." +"New command line option for :ref:`isolated mode `, (:" +"issue:`16499`)." msgstr "" -"用於\\ :ref:`隔離模式 `\\ 的新命令列選項 " -"(:issue:`16499`)。" +"用於\\ :ref:`隔離模式 `\\ 的新命令列選項 (:issue:" +"`16499`)。" #: ../../whatsnew/3.4.rst:140 msgid "" @@ -259,9 +260,9 @@ msgstr "" #: ../../whatsnew/3.4.rst:155 msgid "" "All modules in the standard library that support SSL now support server " -"certificate verification, including hostname matching (:func:`!" -"ssl.match_hostname`) and CRLs (Certificate Revocation lists, " -"see :func:`ssl.SSLContext.load_verify_locations`)." +"certificate verification, including hostname matching (:func:`!ssl." +"match_hostname`) and CRLs (Certificate Revocation lists, see :func:`ssl." +"SSLContext.load_verify_locations`)." msgstr "" #: ../../whatsnew/3.4.rst:160 @@ -391,8 +392,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:247 msgid "" "However, as this migration is currently still incomplete, the legacy " -"versions of those guides remaining available as :ref:`install-index` " -"and :ref:`setuptools-index`." +"versions of those guides remaining available as :ref:`install-index` and :" +"ref:`setuptools-index`." msgstr "" #: ../../whatsnew/3.4.rst:253 @@ -433,8 +434,10 @@ msgid ":func:`os.get_handle_inheritable`, :func:`os.set_handle_inheritable`" msgstr ":func:`os.get_handle_inheritable`、:func:`os.set_handle_inheritable`" #: ../../whatsnew/3.4.rst:274 -msgid ":meth:`socket.socket.get_inheritable`, :meth:`socket.socket.set_inheritable`" -msgstr ":meth:`socket.socket.get_inheritable`、:meth:`socket.socket.set_inheritable`" +msgid "" +":meth:`socket.socket.get_inheritable`, :meth:`socket.socket.set_inheritable`" +msgstr "" +":meth:`socket.socket.get_inheritable`、:meth:`socket.socket.set_inheritable`" #: ../../whatsnew/3.4.rst:278 msgid ":pep:`446` -- Make newly created file descriptors non-inheritable" @@ -459,20 +462,19 @@ msgstr "" #: ../../whatsnew/3.4.rst:294 msgid "" -"As a key step in clarifying the situation, the :meth:`codecs.encode` " -"and :meth:`codecs.decode` convenience functions are now properly documented " -"in Python 2.7, 3.3 and 3.4. These functions have existed in " -"the :mod:`codecs` module (and have been covered by the regression test " -"suite) since Python 2.4, but were previously only discoverable through " -"runtime introspection." +"As a key step in clarifying the situation, the :meth:`codecs.encode` and :" +"meth:`codecs.decode` convenience functions are now properly documented in " +"Python 2.7, 3.3 and 3.4. These functions have existed in the :mod:`codecs` " +"module (and have been covered by the regression test suite) since Python " +"2.4, but were previously only discoverable through runtime introspection." msgstr "" #: ../../whatsnew/3.4.rst:300 msgid "" -"Unlike the convenience methods on :class:`str`, :class:`bytes` " -"and :class:`bytearray`, the :mod:`codecs` convenience functions support " -"arbitrary codecs in both Python 2 and Python 3, rather than being limited to " -"Unicode text encodings (in Python 3) or ``basestring`` <-> ``basestring`` " +"Unlike the convenience methods on :class:`str`, :class:`bytes` and :class:" +"`bytearray`, the :mod:`codecs` convenience functions support arbitrary " +"codecs in both Python 2 and Python 3, rather than being limited to Unicode " +"text encodings (in Python 3) or ``basestring`` <-> ``basestring`` " "conversions (in Python 2)." msgstr "" @@ -625,11 +627,11 @@ msgstr "" #: ../../whatsnew/3.4.rst:373 msgid "" -"(Contributed by Nick Coghlan " -"in :issue:`7475`, :issue:`17827`, :issue:`17828` and :issue:`19619`.)" +"(Contributed by Nick Coghlan in :issue:`7475`, :issue:`17827`, :issue:" +"`17828` and :issue:`19619`.)" msgstr "" -"(由 Nick Coghlan 在 :issue:`7475`、:issue:`17827`、:issue:`17828` " -"和 :issue:`19619` 中貢獻。)" +"(由 Nick Coghlan 在 :issue:`7475`、:issue:`17827`、:issue:`17828` 和 :issue:" +"`19619` 中貢獻。)" #: ../../whatsnew/3.4.rst:380 msgid "PEP 451: A ModuleSpec Type for the Import System" @@ -650,9 +652,9 @@ msgid "" "Furthermore, they should be transparent to everyone but importer authors. " "Key finder and loader methods have been deprecated, but they will continue " "working. New importers should use the new methods described in the PEP. " -"Existing importers should be updated to implement the new methods. See " -"the :ref:`deprecated-3.4` section for a list of methods that should be " -"replaced and their replacements." +"Existing importers should be updated to implement the new methods. See the :" +"ref:`deprecated-3.4` section for a list of methods that should be replaced " +"and their replacements." msgstr "" #: ../../whatsnew/3.4.rst:400 @@ -671,8 +673,8 @@ msgstr "" msgid "" ":func:`min` and :func:`max` now accept a *default* keyword-only argument " "that can be used to specify the value they return if the iterable they are " -"evaluating has no elements. (Contributed by Julian Berman " -"in :issue:`18111`.)" +"evaluating has no elements. (Contributed by Julian Berman in :issue:" +"`18111`.)" msgstr "" #: ../../whatsnew/3.4.rst:411 @@ -682,9 +684,9 @@ msgstr "" #: ../../whatsnew/3.4.rst:413 msgid "" "Module ``__file__`` attributes (and related values) should now always " -"contain absolute paths by default, with the sole exception of " -"``__main__.__file__`` when a script has been executed directly using a " -"relative path. (Contributed by Brett Cannon in :issue:`18416`.)" +"contain absolute paths by default, with the sole exception of ``__main__." +"__file__`` when a script has been executed directly using a relative path. " +"(Contributed by Brett Cannon in :issue:`18416`.)" msgstr "" #: ../../whatsnew/3.4.rst:418 @@ -712,8 +714,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:431 msgid "" ":class:`bytes`.join() and :class:`bytearray`.join() now accept arbitrary " -"buffer objects as arguments. (Contributed by Antoine Pitrou " -"in :issue:`15958`.)" +"buffer objects as arguments. (Contributed by Antoine Pitrou in :issue:" +"`15958`.)" msgstr "" #: ../../whatsnew/3.4.rst:435 @@ -732,9 +734,9 @@ msgstr "" #: ../../whatsnew/3.4.rst:443 msgid "" -":class:`memoryview` is now registered as a :class:`Sequence " -"`, and supports the :func:`reversed` builtin. (Contributed " -"by Nick Coghlan and Claudiu Popa in :issue:`18690` and :issue:`19078`.)" +":class:`memoryview` is now registered as a :class:`Sequence `, and supports the :func:`reversed` builtin. (Contributed by Nick " +"Coghlan and Claudiu Popa in :issue:`18690` and :issue:`19078`.)" msgstr "" #: ../../whatsnew/3.4.rst:447 @@ -747,8 +749,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:451 msgid "" ":meth:`~object.__length_hint__` is now part of the formal language " -"specification (see :pep:`424`). (Contributed by Armin Ronacher " -"in :issue:`16148`.)" +"specification (see :pep:`424`). (Contributed by Armin Ronacher in :issue:" +"`16148`.)" msgstr "" #: ../../whatsnew/3.4.rst:457 @@ -785,11 +787,11 @@ msgstr "ensurepip" #: ../../whatsnew/3.4.rst:483 msgid "" -"The new :mod:`ensurepip` module is the primary infrastructure for " -"the :pep:`453` implementation. In the normal course of events end users " -"will not need to interact with this module, but it can be used to manually " -"bootstrap ``pip`` if the automated bootstrapping into an installation or " -"virtual environment was declined." +"The new :mod:`ensurepip` module is the primary infrastructure for the :pep:" +"`453` implementation. In the normal course of events end users will not " +"need to interact with this module, but it can be used to manually bootstrap " +"``pip`` if the automated bootstrapping into an installation or virtual " +"environment was declined." msgstr "" #: ../../whatsnew/3.4.rst:489 @@ -819,10 +821,10 @@ msgstr "enum" #: ../../whatsnew/3.4.rst:509 msgid "" "The new :mod:`enum` module (defined in :pep:`435`) provides a standard " -"implementation of enumeration types, allowing other modules (such " -"as :mod:`socket`) to provide more informative error messages and better " -"debugging support by replacing opaque integer constants with backwards " -"compatible enumeration values." +"implementation of enumeration types, allowing other modules (such as :mod:" +"`socket`) to provide more informative error messages and better debugging " +"support by replacing opaque integer constants with backwards compatible " +"enumeration values." msgstr "" #: ../../whatsnew/3.4.rst:517 @@ -862,9 +864,9 @@ msgstr "selectors" #: ../../whatsnew/3.4.rst:546 msgid "" -"The new :mod:`selectors` module (created as part of " -"implementing :pep:`3156`) allows high-level and efficient I/O multiplexing, " -"built upon the :mod:`select` module primitives." +"The new :mod:`selectors` module (created as part of implementing :pep:" +"`3156`) allows high-level and efficient I/O multiplexing, built upon the :" +"mod:`select` module primitives." msgstr "" #: ../../whatsnew/3.4.rst:554 @@ -964,9 +966,9 @@ msgstr "" #: ../../whatsnew/3.4.rst:615 ../../whatsnew/3.4.rst:1543 msgid "" -"The :meth:`!writeframesraw` and :meth:`!writeframes` methods now accept " -"any :term:`bytes-like object`. (Contributed by Serhiy Storchaka " -"in :issue:`8311`.)" +"The :meth:`!writeframesraw` and :meth:`!writeframes` methods now accept any :" +"term:`bytes-like object`. (Contributed by Serhiy Storchaka in :issue:" +"`8311`.)" msgstr "" #: ../../whatsnew/3.4.rst:621 @@ -1009,22 +1011,21 @@ msgstr "base64" #: ../../whatsnew/3.4.rst:646 msgid "" -"The encoding and decoding functions in :mod:`base64` now accept " -"any :term:`bytes-like object` in cases where it previously required " -"a :class:`bytes` or :class:`bytearray` instance. (Contributed by Nick " -"Coghlan in :issue:`17839`.)" +"The encoding and decoding functions in :mod:`base64` now accept any :term:" +"`bytes-like object` in cases where it previously required a :class:`bytes` " +"or :class:`bytearray` instance. (Contributed by Nick Coghlan in :issue:" +"`17839`.)" msgstr "" #: ../../whatsnew/3.4.rst:651 msgid "" -"New " -"functions :func:`~base64.a85encode`, :func:`~base64.a85decode`, :func:`~base64.b85encode`, " -"and :func:`~base64.b85decode` provide the ability to encode and decode " -"binary data from and to ``Ascii85`` and the git/mercurial ``Base85`` " -"formats, respectively. The ``a85`` functions have options that can be used " -"to make them compatible with the variants of the ``Ascii85`` encoding, " -"including the Adobe variant. (Contributed by Martin Morrison, the Mercurial " -"project, Serhiy Storchaka, and Antoine Pitrou in :issue:`17618`.)" +"New functions :func:`~base64.a85encode`, :func:`~base64.a85decode`, :func:" +"`~base64.b85encode`, and :func:`~base64.b85decode` provide the ability to " +"encode and decode binary data from and to ``Ascii85`` and the git/mercurial " +"``Base85`` formats, respectively. The ``a85`` functions have options that " +"can be used to make them compatible with the variants of the ``Ascii85`` " +"encoding, including the Adobe variant. (Contributed by Martin Morrison, the " +"Mercurial project, Serhiy Storchaka, and Antoine Pitrou in :issue:`17618`.)" msgstr "" #: ../../whatsnew/3.4.rst:661 @@ -1066,21 +1067,21 @@ msgstr "" #: ../../whatsnew/3.4.rst:686 msgid "" "The new :func:`contextlib.redirect_stdout` context manager makes it easier " -"for utility scripts to handle inflexible APIs that write their output " -"to :data:`sys.stdout` and don't provide any options to redirect it. Using " -"the context manager, the :data:`sys.stdout` output can be redirected to any " +"for utility scripts to handle inflexible APIs that write their output to :" +"data:`sys.stdout` and don't provide any options to redirect it. Using the " +"context manager, the :data:`sys.stdout` output can be redirected to any " "other stream or, in conjunction with :class:`io.StringIO`, to a string. The " "latter can be especially useful, for example, to capture output from a " "function that was written to implement a command line interface. It is " -"recommended only for utility scripts because it affects the global state " -"of :data:`sys.stdout`. (Contributed by Raymond Hettinger in :issue:`15805`.)" +"recommended only for utility scripts because it affects the global state of :" +"data:`sys.stdout`. (Contributed by Raymond Hettinger in :issue:`15805`.)" msgstr "" #: ../../whatsnew/3.4.rst:697 msgid "" -"The :mod:`contextlib` documentation has also been updated to include " -"a :ref:`discussion ` of the " -"differences between single use, reusable and reentrant context managers." +"The :mod:`contextlib` documentation has also been updated to include a :ref:" +"`discussion ` of the differences " +"between single use, reusable and reentrant context managers." msgstr "" #: ../../whatsnew/3.4.rst:703 @@ -1101,8 +1102,8 @@ msgstr "dis" #: ../../whatsnew/3.4.rst:714 msgid "" -"Functions :func:`~dis.show_code`, :func:`~dis.dis`, :func:`~dis.distb`, " -"and :func:`~dis.disassemble` now accept a keyword-only *file* argument that " +"Functions :func:`~dis.show_code`, :func:`~dis.dis`, :func:`~dis.distb`, and :" +"func:`~dis.disassemble` now accept a keyword-only *file* argument that " "controls where they write their output." msgstr "" @@ -1150,13 +1151,13 @@ msgstr "" msgid "" "In addition, a new application-friendly class :class:`~dis.Bytecode` " "provides an object-oriented API for inspecting bytecode in both in human-" -"readable form and for iterating over instructions. " -"The :class:`~dis.Bytecode` constructor takes the same arguments " -"that :func:`~dis.get_instructions` does (plus an optional *current_offset*), " -"and the resulting object can be iterated to " -"produce :class:`~dis.Instruction` objects. But it also has " -"a :mod:`~dis.Bytecode.dis` method, equivalent to calling :mod:`~dis.dis` on " -"the constructor argument, but returned as a multi-line string::" +"readable form and for iterating over instructions. The :class:`~dis." +"Bytecode` constructor takes the same arguments that :func:`~dis." +"get_instructions` does (plus an optional *current_offset*), and the " +"resulting object can be iterated to produce :class:`~dis.Instruction` " +"objects. But it also has a :mod:`~dis.Bytecode.dis` method, equivalent to " +"calling :mod:`~dis.dis` on the constructor argument, but returned as a multi-" +"line string::" msgstr "" #: ../../whatsnew/3.4.rst:748 @@ -1189,16 +1190,16 @@ msgstr "" #: ../../whatsnew/3.4.rst:761 msgid "" -":class:`~dis.Bytecode` also has a class " -"method, :meth:`~dis.Bytecode.from_traceback`, that provides the ability to " -"manipulate a traceback (that is, " -"``print(Bytecode.from_traceback(tb).dis())`` is equivalent to ``distb(tb)``)." +":class:`~dis.Bytecode` also has a class method, :meth:`~dis.Bytecode." +"from_traceback`, that provides the ability to manipulate a traceback (that " +"is, ``print(Bytecode.from_traceback(tb).dis())`` is equivalent to " +"``distb(tb)``)." msgstr "" #: ../../whatsnew/3.4.rst:766 msgid "" -"(Contributed by Nick Coghlan, Ryan Kelly and Thomas Kluyver " -"in :issue:`11816` and Claudiu Popa in :issue:`17916`.)" +"(Contributed by Nick Coghlan, Ryan Kelly and Thomas Kluyver in :issue:" +"`11816` and Claudiu Popa in :issue:`17916`.)" msgstr "" "(由 Nick Coghlan、Ryan Kelly 和 Thomas Kluyver 在 :issue:`11816` 中以及 " "Claudiu Popa 在 :issue:`17916` 中貢獻。)" @@ -1227,8 +1228,8 @@ msgid "" "two new options, ``-o`` and ``-f``. ``-o`` allows :ref:`doctest options " "` to be specified on the command line, and ``-f`` is a " "shorthand for ``-o FAIL_FAST`` (to parallel the similar option supported by " -"the :mod:`unittest` CLI). (Contributed by R. David Murray " -"in :issue:`11390`.)" +"the :mod:`unittest` CLI). (Contributed by R. David Murray in :issue:" +"`11390`.)" msgstr "" #: ../../whatsnew/3.4.rst:787 @@ -1256,10 +1257,10 @@ msgid "" "New method :meth:`~email.message.Message.as_bytes` added to produce a bytes " "representation of the message in a fashion similar to how ``as_string`` " "produces a string representation. It does not accept the *maxheaderlen* " -"argument, but does accept the *unixfrom* and *policy* arguments. " -"The :class:`~email.message.Message` :meth:`~email.message.Message.__bytes__` " -"method calls it, meaning that ``bytes(mymsg)`` will now produce the " -"intuitive result: a bytes object containing the fully formatted message. " +"argument, but does accept the *unixfrom* and *policy* arguments. The :class:" +"`~email.message.Message` :meth:`~email.message.Message.__bytes__` method " +"calls it, meaning that ``bytes(mymsg)`` will now produce the intuitive " +"result: a bytes object containing the fully formatted message. " "(Contributed by R. David Murray in :issue:`18600`.)" msgstr "" @@ -1268,8 +1269,8 @@ msgid "" "The :meth:`.Message.set_param` message now accepts a *replace* keyword " "argument. When specified, the associated header will be updated without " "changing its location in the list of headers. For backward compatibility, " -"the default is ``False``. (Contributed by R. David Murray " -"in :issue:`18891`.)" +"the default is ``False``. (Contributed by R. David Murray in :issue:" +"`18891`.)" msgstr "" #: ../../whatsnew/3.4.rst:818 @@ -1281,13 +1282,12 @@ msgid "" "documentation is currently in the new module, which is being added as part " "of email's new :term:`provisional API`. These classes provide a number of " "new methods that make extracting content from and inserting content into " -"email messages much easier. For details, see " -"the :mod:`~email.contentmanager` documentation and the :ref:`email-" -"examples`. These API additions complete the bulk of the work that was " -"planned as part of the email6 project. The currently provisional API is " -"scheduled to become final in Python 3.5 (possibly with a few minor additions " -"in the area of error handling). (Contributed by R. David Murray " -"in :issue:`18891`.)" +"email messages much easier. For details, see the :mod:`~email." +"contentmanager` documentation and the :ref:`email-examples`. These API " +"additions complete the bulk of the work that was planned as part of the " +"email6 project. The currently provisional API is scheduled to become final " +"in Python 3.5 (possibly with a few minor additions in the area of error " +"handling). (Contributed by R. David Murray in :issue:`18891`.)" msgstr "" #: ../../whatsnew/3.4.rst:834 @@ -1308,8 +1308,8 @@ msgstr "" msgid "" "New module attribute :const:`~filecmp.DEFAULT_IGNORES` provides the list of " "directories that are used as the default value for the *ignore* parameter of " -"the :func:`~filecmp.dircmp` function. (Contributed by Eli Bendersky " -"in :issue:`15442`.)" +"the :func:`~filecmp.dircmp` function. (Contributed by Eli Bendersky in :" +"issue:`15442`.)" msgstr "" #: ../../whatsnew/3.4.rst:850 @@ -1346,9 +1346,9 @@ msgstr "由 Łukasz Langa 撰寫 PEP 與實作。" #: ../../whatsnew/3.4.rst:873 msgid "" -":func:`~functools.total_ordering` now supports a return value " -"of :data:`NotImplemented` from the underlying comparison function. " -"(Contributed by Katie Miller in :issue:`10042`.)" +":func:`~functools.total_ordering` now supports a return value of :data:" +"`NotImplemented` from the underlying comparison function. (Contributed by " +"Katie Miller in :issue:`10042`.)" msgstr "" #: ../../whatsnew/3.4.rst:877 @@ -1393,17 +1393,17 @@ msgid "" "(Contributed by Christian Heimes in :issue:`18582`.)" msgstr "" "新的 :func:`hashlib.pbkdf2_hmac` 函式提供了\\ `基於密碼的 PKCS#5 密鑰生成函" -"式 2 `_。(由 Christian Heimes " -"在 :issue:`18582` 中貢獻。)" +"式 2 `_。(由 Christian Heimes 在 :" +"issue:`18582` 中貢獻。)" #: ../../whatsnew/3.4.rst:907 msgid "" "The :attr:`~hashlib.hash.name` attribute of :mod:`hashlib` hash objects is " -"now a formally supported interface. It has always existed in " -"CPython's :mod:`hashlib` (although it did not return lower case names for " -"all supported hashes), but it was not a public interface and so some other " -"Python implementations have not previously supported it. (Contributed by " -"Jason R. Coombs in :issue:`18532`.)" +"now a formally supported interface. It has always existed in CPython's :mod:" +"`hashlib` (although it did not return lower case names for all supported " +"hashes), but it was not a public interface and so some other Python " +"implementations have not previously supported it. (Contributed by Jason R. " +"Coombs in :issue:`18532`.)" msgstr "" #: ../../whatsnew/3.4.rst:916 @@ -1430,11 +1430,10 @@ msgstr "" #: ../../whatsnew/3.4.rst:930 msgid "" -"With the addition of :attr:`~hmac.HMAC.block_size` " -"and :attr:`~hmac.HMAC.name` attributes (and the formal documentation of " -"the :attr:`~hmac.HMAC.digest_size` attribute), the :mod:`hmac` module now " -"conforms fully to the :pep:`247` API. (Contributed by Christian Heimes " -"in :issue:`18775`.)" +"With the addition of :attr:`~hmac.HMAC.block_size` and :attr:`~hmac.HMAC." +"name` attributes (and the formal documentation of the :attr:`~hmac.HMAC." +"digest_size` attribute), the :mod:`hmac` module now conforms fully to the :" +"pep:`247` API. (Contributed by Christian Heimes in :issue:`18775`.)" msgstr "" #: ../../whatsnew/3.4.rst:937 @@ -1473,10 +1472,10 @@ msgid "" ":meth:`~http.server.BaseHTTPRequestHandler.send_error` now accepts an " "optional additional *explain* parameter which can be used to provide an " "extended error description, overriding the hardcoded default if there is " -"one. This extended error description will be formatted using " -"the :attr:`~http.server.BaseHTTPRequestHandler.error_message_format` " -"attribute and sent as the body of the error response. (Contributed by Karl " -"Cow in :issue:`12921`.)" +"one. This extended error description will be formatted using the :attr:" +"`~http.server.BaseHTTPRequestHandler.error_message_format` attribute and " +"sent as the body of the error response. (Contributed by Karl Cow in :issue:" +"`12921`.)" msgstr "" #: ../../whatsnew/3.4.rst:965 @@ -1493,10 +1492,10 @@ msgstr "idlelib 與 IDLE" #: ../../whatsnew/3.4.rst:973 msgid "" "Since idlelib implements the IDLE shell and editor and is not intended for " -"import by other programs, it gets improvements with every release. " -"See :file:`Lib/idlelib/NEWS.txt` for a cumulative list of changes since " -"3.3.0, as well as changes made in future 3.4.x releases. This file is also " -"available from the IDLE :menuselection:`Help --> About IDLE` dialog." +"import by other programs, it gets improvements with every release. See :file:" +"`Lib/idlelib/NEWS.txt` for a cumulative list of changes since 3.3.0, as well " +"as changes made in future 3.4.x releases. This file is also available from " +"the IDLE :menuselection:`Help --> About IDLE` dialog." msgstr "" #: ../../whatsnew/3.4.rst:981 @@ -1505,12 +1504,11 @@ msgstr "importlib" #: ../../whatsnew/3.4.rst:983 msgid "" -"The :class:`~importlib.abc.InspectLoader` ABC defines a new " -"method, :meth:`~importlib.abc.InspectLoader.source_to_code` that accepts " -"source data and a path and returns a code object. The default " -"implementation is equivalent to ``compile(data, path, 'exec', " -"dont_inherit=True)``. (Contributed by Eric Snow and Brett Cannon " -"in :issue:`15627`.)" +"The :class:`~importlib.abc.InspectLoader` ABC defines a new method, :meth:" +"`~importlib.abc.InspectLoader.source_to_code` that accepts source data and a " +"path and returns a code object. The default implementation is equivalent to " +"``compile(data, path, 'exec', dont_inherit=True)``. (Contributed by Eric " +"Snow and Brett Cannon in :issue:`15627`.)" msgstr "" #: ../../whatsnew/3.4.rst:989 @@ -1523,9 +1521,9 @@ msgstr "" #: ../../whatsnew/3.4.rst:994 msgid "" -"The :func:`~importlib.reload` function has been moved from :mod:`!imp` " -"to :mod:`importlib` as part of the :mod:`!imp` module deprecation. " -"(Contributed by Berker Peksag in :issue:`18193`.)" +"The :func:`~importlib.reload` function has been moved from :mod:`!imp` to :" +"mod:`importlib` as part of the :mod:`!imp` module deprecation. (Contributed " +"by Berker Peksag in :issue:`18193`.)" msgstr "" #: ../../whatsnew/3.4.rst:998 @@ -1538,35 +1536,34 @@ msgstr "" #: ../../whatsnew/3.4.rst:1003 msgid "" -"New :mod:`importlib.util` " -"functions :func:`~importlib.util.cache_from_source` " -"and :func:`~importlib.util.source_from_cache` replace the same-named " -"functions in the deprecated :mod:`!imp` module. (Contributed by Brett " -"Cannon in :issue:`18194`.)" +"New :mod:`importlib.util` functions :func:`~importlib.util." +"cache_from_source` and :func:`~importlib.util.source_from_cache` replace the " +"same-named functions in the deprecated :mod:`!imp` module. (Contributed by " +"Brett Cannon in :issue:`18194`.)" msgstr "" #: ../../whatsnew/3.4.rst:1008 msgid "" "The :mod:`importlib` bootstrap :class:`.NamespaceLoader` now conforms to " -"the :class:`.InspectLoader` ABC, which means that ``runpy`` and ``python " -"-m`` can now be used with namespace packages. (Contributed by Brett Cannon " +"the :class:`.InspectLoader` ABC, which means that ``runpy`` and ``python -" +"m`` can now be used with namespace packages. (Contributed by Brett Cannon " "in :issue:`18058`.)" msgstr "" #: ../../whatsnew/3.4.rst:1013 msgid "" -":mod:`importlib.util` has a new " -"function :func:`~importlib.util.decode_source` that decodes source from " -"bytes using universal newline processing. This is useful for " -"implementing :meth:`.InspectLoader.get_source` methods." +":mod:`importlib.util` has a new function :func:`~importlib.util." +"decode_source` that decodes source from bytes using universal newline " +"processing. This is useful for implementing :meth:`.InspectLoader." +"get_source` methods." msgstr "" #: ../../whatsnew/3.4.rst:1017 msgid "" -":class:`importlib.machinery.ExtensionFileLoader` now has " -"a :meth:`~importlib.machinery.ExtensionFileLoader.get_filename` method. " -"This was inadvertently omitted in the original implementation. (Contributed " -"by Eric Snow in :issue:`19152`.)" +":class:`importlib.machinery.ExtensionFileLoader` now has a :meth:`~importlib." +"machinery.ExtensionFileLoader.get_filename` method. This was inadvertently " +"omitted in the original implementation. (Contributed by Eric Snow in :issue:" +"`19152`.)" msgstr "" #: ../../whatsnew/3.4.rst:1024 @@ -1591,23 +1588,21 @@ msgstr "" #: ../../whatsnew/3.4.rst:1036 msgid "" -"As part of the implementation of the new :mod:`enum` module, " -"the :mod:`inspect` module now has substantially better support for custom " -"``__dir__`` methods and dynamic class attributes provided through " -"metaclasses. (Contributed by Ethan Furman in :issue:`18929` " -"and :issue:`19030`.)" +"As part of the implementation of the new :mod:`enum` module, the :mod:" +"`inspect` module now has substantially better support for custom ``__dir__`` " +"methods and dynamic class attributes provided through metaclasses. " +"(Contributed by Ethan Furman in :issue:`18929` and :issue:`19030`.)" msgstr "" #: ../../whatsnew/3.4.rst:1042 msgid "" -":func:`~inspect.getfullargspec` and :func:`!getargspec` now use " -"the :func:`~inspect.signature` API. This allows them to support a much " -"broader range of callables, including those with ``__signature__`` " -"attributes, those with metadata provided by argument " -"clinic, :func:`functools.partial` objects and more. Note that, " -"unlike :func:`~inspect.signature`, these functions still ignore " -"``__wrapped__`` attributes, and report the already bound first argument for " -"bound methods, so it is still necessary to update your code to " +":func:`~inspect.getfullargspec` and :func:`!getargspec` now use the :func:" +"`~inspect.signature` API. This allows them to support a much broader range " +"of callables, including those with ``__signature__`` attributes, those with " +"metadata provided by argument clinic, :func:`functools.partial` objects and " +"more. Note that, unlike :func:`~inspect.signature`, these functions still " +"ignore ``__wrapped__`` attributes, and report the already bound first " +"argument for bound methods, so it is still necessary to update your code to " "use :func:`~inspect.signature` directly if those features are desired. " "(Contributed by Yury Selivanov in :issue:`17481`.)" msgstr "" @@ -1625,18 +1620,17 @@ msgstr "ipaddress" #: ../../whatsnew/3.4.rst:1061 msgid "" -":mod:`ipaddress` was added to the standard library in Python 3.3 as " -"a :term:`provisional API`. With the release of Python 3.4, this " -"qualification has been removed: :mod:`ipaddress` is now considered a stable " -"API, covered by the normal standard library requirements to maintain " -"backwards compatibility." +":mod:`ipaddress` was added to the standard library in Python 3.3 as a :term:" +"`provisional API`. With the release of Python 3.4, this qualification has " +"been removed: :mod:`ipaddress` is now considered a stable API, covered by " +"the normal standard library requirements to maintain backwards compatibility." msgstr "" #: ../../whatsnew/3.4.rst:1067 msgid "" "A new :attr:`~ipaddress.IPv4Address.is_global` property is ``True`` if an " -"address is globally routeable. (Contributed by Peter Moody " -"in :issue:`17400`.)" +"address is globally routeable. (Contributed by Peter Moody in :issue:" +"`17400`.)" msgstr "" #: ../../whatsnew/3.4.rst:1073 @@ -1652,29 +1646,27 @@ msgstr "" #: ../../whatsnew/3.4.rst:1079 msgid "" -":class:`~logging.handlers.SocketHandler` " -"and :class:`~logging.handlers.DatagramHandler` now support Unix domain " -"sockets (by setting *port* to ``None``). (Contributed by Vinay Sajip in " -"commit ce46195b56a9.)" +":class:`~logging.handlers.SocketHandler` and :class:`~logging.handlers." +"DatagramHandler` now support Unix domain sockets (by setting *port* to " +"``None``). (Contributed by Vinay Sajip in commit ce46195b56a9.)" msgstr "" #: ../../whatsnew/3.4.rst:1084 msgid "" -":func:`~logging.config.fileConfig` now accepts " -"a :class:`configparser.RawConfigParser` subclass instance for the *fname* " -"parameter. This facilitates using a configuration file when logging " -"configuration is just a part of the overall application configuration, or " -"where the application modifies the configuration before passing it " -"to :func:`~logging.config.fileConfig`. (Contributed by Vinay Sajip " -"in :issue:`16110`.)" +":func:`~logging.config.fileConfig` now accepts a :class:`configparser." +"RawConfigParser` subclass instance for the *fname* parameter. This " +"facilitates using a configuration file when logging configuration is just a " +"part of the overall application configuration, or where the application " +"modifies the configuration before passing it to :func:`~logging.config." +"fileConfig`. (Contributed by Vinay Sajip in :issue:`16110`.)" msgstr "" #: ../../whatsnew/3.4.rst:1092 msgid "" -"Logging configuration data received from a socket via " -"the :func:`logging.config.listen` function can now be validated before being " -"processed by supplying a verification function as the argument to the new " -"*verify* keyword argument. (Contributed by Vinay Sajip in :issue:`15452`.)" +"Logging configuration data received from a socket via the :func:`logging." +"config.listen` function can now be validated before being processed by " +"supplying a verification function as the argument to the new *verify* " +"keyword argument. (Contributed by Vinay Sajip in :issue:`15452`.)" msgstr "" #: ../../whatsnew/3.4.rst:1101 @@ -1687,11 +1679,11 @@ msgid "" "implementing the new version restores the Python2 behavior of recording only " "one copy of interned strings and preserving the interning on " "deserialization, and extends this \"one copy\" ability to any object type " -"(including handling recursive references). This reduces both the size of " -"``.pyc`` files and the amount of memory a module occupies in memory when it " -"is loaded from a ``.pyc`` (or ``.pyo``) file. (Contributed by Kristján " -"Valur Jónsson in :issue:`16475`, with additional speedups by Antoine Pitrou " -"in :issue:`19219`.)" +"(including handling recursive references). This reduces both the size of ``." +"pyc`` files and the amount of memory a module occupies in memory when it is " +"loaded from a ``.pyc`` (or ``.pyo``) file. (Contributed by Kristján Valur " +"Jónsson in :issue:`16475`, with additional speedups by Antoine Pitrou in :" +"issue:`19219`.)" msgstr "" #: ../../whatsnew/3.4.rst:1114 @@ -1711,13 +1703,12 @@ msgstr "multiprocessing" #: ../../whatsnew/3.4.rst:1125 msgid "" "On Unix two new :ref:`start methods `, " -"``spawn`` and ``forkserver``, have been added for starting processes " -"using :mod:`multiprocessing`. These make the mixing of processes with " -"threads more robust, and the ``spawn`` method matches the semantics that " -"multiprocessing has always used on Windows. New " -"function :func:`~multiprocessing.get_all_start_methods` reports all start " -"methods available on the platform, :func:`~multiprocessing.get_start_method` " -"reports the current start method, " +"``spawn`` and ``forkserver``, have been added for starting processes using :" +"mod:`multiprocessing`. These make the mixing of processes with threads more " +"robust, and the ``spawn`` method matches the semantics that multiprocessing " +"has always used on Windows. New function :func:`~multiprocessing." +"get_all_start_methods` reports all start methods available on the platform, :" +"func:`~multiprocessing.get_start_method` reports the current start method, " "and :func:`~multiprocessing.set_start_method` sets the start method. " "(Contributed by Richard Oudkerk in :issue:`8713`.)" msgstr "" @@ -1725,22 +1716,21 @@ msgstr "" #: ../../whatsnew/3.4.rst:1135 msgid "" ":mod:`multiprocessing` also now has the concept of a ``context``, which " -"determines how child processes are created. New " -"function :func:`~multiprocessing.get_context` returns a context that uses a " -"specified start method. It has the same API as the :mod:`multiprocessing` " -"module itself, so you can use it to " -"create :class:`~multiprocessing.pool.Pool`\\ s and other objects that will " -"operate within that context. This allows a framework and an application or " -"different parts of the same application to use multiprocessing without " -"interfering with each other. (Contributed by Richard Oudkerk " -"in :issue:`18999`.)" +"determines how child processes are created. New function :func:" +"`~multiprocessing.get_context` returns a context that uses a specified start " +"method. It has the same API as the :mod:`multiprocessing` module itself, so " +"you can use it to create :class:`~multiprocessing.pool.Pool`\\ s and other " +"objects that will operate within that context. This allows a framework and " +"an application or different parts of the same application to use " +"multiprocessing without interfering with each other. (Contributed by " +"Richard Oudkerk in :issue:`18999`.)" msgstr "" #: ../../whatsnew/3.4.rst:1145 msgid "" "Except when using the old *fork* start method, child processes no longer " -"inherit unneeded handles/file descriptors from their parents (part " -"of :issue:`8713`)." +"inherit unneeded handles/file descriptors from their parents (part of :issue:" +"`8713`)." msgstr "" #: ../../whatsnew/3.4.rst:1149 @@ -1779,9 +1769,9 @@ msgstr "os" #: ../../whatsnew/3.4.rst:1173 msgid "" "There are new functions to get and set the :ref:`inheritable flag " -"` of a file descriptor " -"(:func:`os.get_inheritable`, :func:`os.set_inheritable`) or a Windows handle " -"(:func:`os.get_handle_inheritable`, :func:`os.set_handle_inheritable`)." +"` of a file descriptor (:func:`os.get_inheritable`, :func:" +"`os.set_inheritable`) or a Windows handle (:func:`os." +"get_handle_inheritable`, :func:`os.set_handle_inheritable`)." msgstr "" #: ../../whatsnew/3.4.rst:1178 @@ -1790,14 +1780,14 @@ msgid "" "the platform on which Python is running (or ``None`` if the count can't be " "determined). The :func:`multiprocessing.cpu_count` function is now " "implemented in terms of this function). (Contributed by Trent Nelson, " -"Yogesh Chaudhari, Victor Stinner, and Charles-François Natali " -"in :issue:`17914`.)" +"Yogesh Chaudhari, Victor Stinner, and Charles-François Natali in :issue:" +"`17914`.)" msgstr "" #: ../../whatsnew/3.4.rst:1184 msgid "" -":func:`os.path.samestat` is now available on the Windows platform (and " -"the :func:`os.path.samefile` implementation is now shared between Unix and " +":func:`os.path.samestat` is now available on the Windows platform (and the :" +"func:`os.path.samefile` implementation is now shared between Unix and " "Windows). (Contributed by Brian Curtin in :issue:`11939`.)" msgstr "" @@ -1809,12 +1799,12 @@ msgstr "" #: ../../whatsnew/3.4.rst:1191 msgid "" -":func:`os.open` supports two new flags on platforms that provide " -"them, :const:`~os.O_PATH` (un-opened file descriptor), " -"and :const:`~os.O_TMPFILE` (unnamed temporary file; as of 3.4.0 release " -"available only on Linux systems with a kernel version of 3.11 or newer that " -"have uapi headers). (Contributed by Christian Heimes in :issue:`18673` and " -"Benjamin Peterson, respectively.)" +":func:`os.open` supports two new flags on platforms that provide them, :" +"const:`~os.O_PATH` (un-opened file descriptor), and :const:`~os.O_TMPFILE` " +"(unnamed temporary file; as of 3.4.0 release available only on Linux systems " +"with a kernel version of 3.11 or newer that have uapi headers). " +"(Contributed by Christian Heimes in :issue:`18673` and Benjamin Peterson, " +"respectively.)" msgstr "" #: ../../whatsnew/3.4.rst:1199 @@ -1851,9 +1841,9 @@ msgid "" ":mod:`pickle` now supports (but does not use by default) a new pickle " "protocol, protocol 4. This new protocol addresses a number of issues that " "were present in previous protocols, such as the serialization of nested " -"classes, very large strings and containers, and classes " -"whose :meth:`~object.__new__` method takes keyword-only arguments. It also " -"provides some efficiency improvements." +"classes, very large strings and containers, and classes whose :meth:`~object." +"__new__` method takes keyword-only arguments. It also provides some " +"efficiency improvements." msgstr "" #: ../../whatsnew/3.4.rst:1230 @@ -1871,13 +1861,12 @@ msgstr "plistlib" #: ../../whatsnew/3.4.rst:1237 msgid "" ":mod:`plistlib` now has an API that is similar to the standard pattern for " -"stdlib serialization protocols, with " -"new :func:`~plistlib.load`, :func:`~plistlib.dump`, :func:`~plistlib.loads`, " -"and :func:`~plistlib.dumps` functions. (The older API is now deprecated.) " -"In addition to the already supported XML plist format " -"(:const:`~plistlib.FMT_XML`), it also now supports the binary plist format " -"(:const:`~plistlib.FMT_BINARY`). (Contributed by Ronald Oussoren and others " -"in :issue:`14455`.)" +"stdlib serialization protocols, with new :func:`~plistlib.load`, :func:" +"`~plistlib.dump`, :func:`~plistlib.loads`, and :func:`~plistlib.dumps` " +"functions. (The older API is now deprecated.) In addition to the already " +"supported XML plist format (:const:`~plistlib.FMT_XML`), it also now " +"supports the binary plist format (:const:`~plistlib.FMT_BINARY`). " +"(Contributed by Ronald Oussoren and others in :issue:`14455`.)" msgstr "" #: ../../whatsnew/3.4.rst:1247 @@ -1887,9 +1876,9 @@ msgstr "poplib" #: ../../whatsnew/3.4.rst:1249 msgid "" "Two new methods have been added to :mod:`poplib`: :meth:`~poplib.POP3.capa`, " -"which returns the list of capabilities advertised by the POP server, " -"and :meth:`~poplib.POP3.stls`, which switches a clear-text POP3 session into " -"an encrypted POP3 session if the POP server supports it. (Contributed by " +"which returns the list of capabilities advertised by the POP server, and :" +"meth:`~poplib.POP3.stls`, which switches a clear-text POP3 session into an " +"encrypted POP3 session if the POP server supports it. (Contributed by " "Lorenzo Catucci in :issue:`4473`.)" msgstr "" @@ -1899,8 +1888,8 @@ msgstr "pprint" #: ../../whatsnew/3.4.rst:1259 msgid "" -"The :mod:`pprint` module's :class:`~pprint.PrettyPrinter` class and " -"its :func:`~pprint.pformat`, and :func:`~pprint.pprint` functions have a new " +"The :mod:`pprint` module's :class:`~pprint.PrettyPrinter` class and its :" +"func:`~pprint.pformat`, and :func:`~pprint.pprint` functions have a new " "option, *compact*, that controls how the output is formatted. Currently " "setting *compact* to ``True`` means that sequences will be printed with as " "many sequence elements as will fit within *width* on each (indented) line. " @@ -1929,28 +1918,27 @@ msgstr "pydoc" #: ../../whatsnew/3.4.rst:1280 msgid "" -"The :mod:`pydoc` module is now based directly on " -"the :func:`inspect.signature` introspection API, allowing it to provide " -"signature information for a wider variety of callable objects. This change " -"also means that ``__wrapped__`` attributes are now taken into account when " -"displaying help information. (Contributed by Larry Hastings " -"in :issue:`19674`.)" +"The :mod:`pydoc` module is now based directly on the :func:`inspect." +"signature` introspection API, allowing it to provide signature information " +"for a wider variety of callable objects. This change also means that " +"``__wrapped__`` attributes are now taken into account when displaying help " +"information. (Contributed by Larry Hastings in :issue:`19674`.)" msgstr "" #: ../../whatsnew/3.4.rst:1286 msgid "" "The :mod:`pydoc` module no longer displays the ``self`` parameter for " "already bound methods. Instead, it aims to always display the exact current " -"signature of the supplied callable. (Contributed by Larry Hastings " -"in :issue:`20710`.)" +"signature of the supplied callable. (Contributed by Larry Hastings in :" +"issue:`20710`.)" msgstr "" #: ../../whatsnew/3.4.rst:1291 msgid "" "In addition to the changes that have been made to :mod:`pydoc` directly, its " "handling of custom ``__dir__`` methods and various descriptor behaviours has " -"also been improved substantially by the underlying changes in " -"the :mod:`inspect` module." +"also been improved substantially by the underlying changes in the :mod:" +"`inspect` module." msgstr "" #: ../../whatsnew/3.4.rst:1296 @@ -1996,18 +1984,17 @@ msgstr "" #: ../../whatsnew/3.4.rst:1325 msgid "" "On Linux kernel version 2.6.36 or later, there are also some new Linux " -"specific " -"constants: :const:`~resource.RLIMIT_MSGQUEUE`, :const:`~resource.RLIMIT_NICE`, :const:`~resource.RLIMIT_RTPRIO`, :const:`~resource.RLIMIT_RTTIME`, " -"and :const:`~resource.RLIMIT_SIGPENDING`. (Contributed by Christian Heimes " -"in :issue:`19324`.)" +"specific constants: :const:`~resource.RLIMIT_MSGQUEUE`, :const:`~resource." +"RLIMIT_NICE`, :const:`~resource.RLIMIT_RTPRIO`, :const:`~resource." +"RLIMIT_RTTIME`, and :const:`~resource.RLIMIT_SIGPENDING`. (Contributed by " +"Christian Heimes in :issue:`19324`.)" msgstr "" #: ../../whatsnew/3.4.rst:1331 msgid "" -"On FreeBSD version 9 and later, there some new FreeBSD specific " -"constants: :const:`~resource.RLIMIT_SBSIZE`, :const:`~resource.RLIMIT_SWAP`, " -"and :const:`~resource.RLIMIT_NPTS`. (Contributed by Claudiu Popa " -"in :issue:`19343`.)" +"On FreeBSD version 9 and later, there some new FreeBSD specific constants: :" +"const:`~resource.RLIMIT_SBSIZE`, :const:`~resource.RLIMIT_SWAP`, and :const:" +"`~resource.RLIMIT_NPTS`. (Contributed by Claudiu Popa in :issue:`19343`.)" msgstr "" #: ../../whatsnew/3.4.rst:1338 @@ -2025,9 +2012,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:1345 msgid "" ":class:`~select.devpoll` objects now have :meth:`~select.devpoll.fileno` " -"and :meth:`~select.devpoll.close` methods, as well as a new " -"attribute :attr:`~select.devpoll.closed`. (Contributed by Victor Stinner " -"in :issue:`18794`.)" +"and :meth:`~select.devpoll.close` methods, as well as a new attribute :attr:" +"`~select.devpoll.closed`. (Contributed by Victor Stinner in :issue:`18794`.)" msgstr "" #: ../../whatsnew/3.4.rst:1352 @@ -2050,8 +2036,8 @@ msgid "" ":func:`~shutil.copyfile` now raises a specific :exc:`~shutil.Error` " "subclass, :exc:`~shutil.SameFileError`, when the source and destination are " "the same file, which allows an application to take appropriate action on " -"this specific error. (Contributed by Atsuo Ishimoto and Hynek Schlawack " -"in :issue:`1492704`.)" +"this specific error. (Contributed by Atsuo Ishimoto and Hynek Schlawack in :" +"issue:`1492704`.)" msgstr "" #: ../../whatsnew/3.4.rst:1370 @@ -2063,8 +2049,8 @@ msgid "" "The :class:`!SMTPServer` and :class:`!SMTPChannel` classes now accept a " "*map* keyword argument which, if specified, is passed in to :class:`!" "asynchat.async_chat` as its *map* argument. This allows an application to " -"avoid affecting the global socket map. (Contributed by Vinay Sajip " -"in :issue:`11959`.)" +"avoid affecting the global socket map. (Contributed by Vinay Sajip in :" +"issue:`11959`.)" msgstr "" #: ../../whatsnew/3.4.rst:1380 @@ -2092,8 +2078,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:1394 msgid "" "Socket objects have new methods to get or set their :ref:`inheritable flag " -"`, :meth:`~socket.socket.get_inheritable` " -"and :meth:`~socket.socket.set_inheritable`." +"`, :meth:`~socket.socket.get_inheritable` and :meth:`~socket." +"socket.set_inheritable`." msgstr "" #: ../../whatsnew/3.4.rst:1398 @@ -2145,40 +2131,37 @@ msgid "" "more stringent than the defaults provided by the :class:`~ssl.SSLContext` " "constructor, and may be adjusted in the future, without prior deprecation, " "if best-practice security requirements change. The new recommended best " -"practice for using stdlib libraries that support SSL is to " -"use :func:`~ssl.create_default_context` to obtain " -"an :class:`~ssl.SSLContext` object, modify it if needed, and then pass it as " -"the *context* argument of the appropriate stdlib API. (Contributed by " -"Christian Heimes in :issue:`19689`.)" +"practice for using stdlib libraries that support SSL is to use :func:`~ssl." +"create_default_context` to obtain an :class:`~ssl.SSLContext` object, modify " +"it if needed, and then pass it as the *context* argument of the appropriate " +"stdlib API. (Contributed by Christian Heimes in :issue:`19689`.)" msgstr "" #: ../../whatsnew/3.4.rst:1441 msgid "" -":class:`~ssl.SSLContext` " -"method :meth:`~ssl.SSLContext.load_verify_locations` accepts a new optional " -"argument *cadata*, which can be used to provide PEM or DER encoded " -"certificates directly via strings or bytes, respectively. (Contributed by " -"Christian Heimes in :issue:`18138`.)" +":class:`~ssl.SSLContext` method :meth:`~ssl.SSLContext." +"load_verify_locations` accepts a new optional argument *cadata*, which can " +"be used to provide PEM or DER encoded certificates directly via strings or " +"bytes, respectively. (Contributed by Christian Heimes in :issue:`18138`.)" msgstr "" #: ../../whatsnew/3.4.rst:1446 msgid "" "New function :func:`~ssl.get_default_verify_paths` returns a named tuple of " -"the paths and environment variables that " -"the :meth:`~ssl.SSLContext.set_default_verify_paths` method uses to set " -"OpenSSL's default ``cafile`` and ``capath``. This can be an aid in " -"debugging default verification issues. (Contributed by Christian Heimes " -"in :issue:`18143`.)" +"the paths and environment variables that the :meth:`~ssl.SSLContext." +"set_default_verify_paths` method uses to set OpenSSL's default ``cafile`` " +"and ``capath``. This can be an aid in debugging default verification " +"issues. (Contributed by Christian Heimes in :issue:`18143`.)" msgstr "" #: ../../whatsnew/3.4.rst:1453 msgid "" -":class:`~ssl.SSLContext` has a new " -"method, :meth:`~ssl.SSLContext.cert_store_stats`, that reports the number of " -"loaded ``X.509`` certs, ``X.509 CA`` certs, and certificate revocation lists " -"(``crl``\\ s), as well as a :meth:`~ssl.SSLContext.get_ca_certs` method that " -"returns a list of the loaded ``CA`` certificates. (Contributed by Christian " -"Heimes in :issue:`18147`.)" +":class:`~ssl.SSLContext` has a new method, :meth:`~ssl.SSLContext." +"cert_store_stats`, that reports the number of loaded ``X.509`` certs, " +"``X.509 CA`` certs, and certificate revocation lists (``crl``\\ s), as well " +"as a :meth:`~ssl.SSLContext.get_ca_certs` method that returns a list of the " +"loaded ``CA`` certificates. (Contributed by Christian Heimes in :issue:" +"`18147`.)" msgstr "" #: ../../whatsnew/3.4.rst:1460 @@ -2186,46 +2169,45 @@ msgid "" "If OpenSSL 0.9.8 or later is available, :class:`~ssl.SSLContext` has a new " "attribute :attr:`~ssl.SSLContext.verify_flags` that can be used to control " "the certificate verification process by setting it to some combination of " -"the new " -"constants :const:`~ssl.VERIFY_DEFAULT`, :const:`~ssl.VERIFY_CRL_CHECK_LEAF`, :const:`~ssl.VERIFY_CRL_CHECK_CHAIN`, " -"or :const:`~ssl.VERIFY_X509_STRICT`. OpenSSL does not do any CRL " -"verification by default. (Contributed by Christien Heimes in :issue:`8813`.)" +"the new constants :const:`~ssl.VERIFY_DEFAULT`, :const:`~ssl." +"VERIFY_CRL_CHECK_LEAF`, :const:`~ssl.VERIFY_CRL_CHECK_CHAIN`, or :const:" +"`~ssl.VERIFY_X509_STRICT`. OpenSSL does not do any CRL verification by " +"default. (Contributed by Christien Heimes in :issue:`8813`.)" msgstr "" #: ../../whatsnew/3.4.rst:1468 msgid "" -"New :class:`~ssl.SSLContext` " -"method :meth:`~ssl.SSLContext.load_default_certs` loads a set of default " -"\"certificate authority\" (CA) certificates from default locations, which " -"vary according to the platform. It can be used to load both TLS web server " -"authentication certificates (``purpose=``:data:`~ssl.Purpose.SERVER_AUTH`) " -"for a client to use to verify a server, and certificates for a server to use " -"in verifying client certificates " -"(``purpose=``:data:`~ssl.Purpose.CLIENT_AUTH`). (Contributed by Christian " -"Heimes in :issue:`19292`.)" +"New :class:`~ssl.SSLContext` method :meth:`~ssl.SSLContext." +"load_default_certs` loads a set of default \"certificate authority\" (CA) " +"certificates from default locations, which vary according to the platform. " +"It can be used to load both TLS web server authentication certificates " +"(``purpose=``:data:`~ssl.Purpose.SERVER_AUTH`) for a client to use to verify " +"a server, and certificates for a server to use in verifying client " +"certificates (``purpose=``:data:`~ssl.Purpose.CLIENT_AUTH`). (Contributed " +"by Christian Heimes in :issue:`19292`.)" msgstr "" #: ../../whatsnew/3.4.rst:1479 msgid "" -"Two new windows-only functions, :func:`~ssl.enum_certificates` " -"and :func:`~ssl.enum_crls` provide the ability to retrieve certificates, " -"certificate information, and CRLs from the Windows cert store. (Contributed " -"by Christian Heimes in :issue:`17134`.)" +"Two new windows-only functions, :func:`~ssl.enum_certificates` and :func:" +"`~ssl.enum_crls` provide the ability to retrieve certificates, certificate " +"information, and CRLs from the Windows cert store. (Contributed by " +"Christian Heimes in :issue:`17134`.)" msgstr "" #: ../../whatsnew/3.4.rst:1486 msgid "" -"Support for server-side SNI (Server Name Indication) using the " -"new :meth:`ssl.SSLContext.set_servername_callback` method. (Contributed by " -"Daniel Black in :issue:`8109`.)" +"Support for server-side SNI (Server Name Indication) using the new :meth:" +"`ssl.SSLContext.set_servername_callback` method. (Contributed by Daniel " +"Black in :issue:`8109`.)" msgstr "" #: ../../whatsnew/3.4.rst:1490 msgid "" "The dictionary returned by :meth:`.SSLSocket.getpeercert` contains " "additional ``X509v3`` extension items: ``crlDistributionPoints``, " -"``calIssuers``, and ``OCSP`` URIs. (Contributed by Christian Heimes " -"in :issue:`18379`.)" +"``calIssuers``, and ``OCSP`` URIs. (Contributed by Christian Heimes in :" +"issue:`18379`.)" msgstr "" #: ../../whatsnew/3.4.rst:1496 @@ -2241,10 +2223,9 @@ msgstr "" #: ../../whatsnew/3.4.rst:1502 msgid "" -"The module supports new :mod:`~stat.ST_MODE` " -"flags, :mod:`~stat.S_IFDOOR`, :const:`~stat.S_IFPORT`, " -"and :const:`~stat.S_IFWHT`. (Contributed by Christian Hiemes " -"in :issue:`11016`.)" +"The module supports new :mod:`~stat.ST_MODE` flags, :mod:`~stat.S_IFDOOR`, :" +"const:`~stat.S_IFPORT`, and :const:`~stat.S_IFWHT`. (Contributed by " +"Christian Hiemes in :issue:`11016`.)" msgstr "" #: ../../whatsnew/3.4.rst:1508 @@ -2253,10 +2234,10 @@ msgstr "struct" #: ../../whatsnew/3.4.rst:1510 msgid "" -"New function :mod:`~struct.iter_unpack` and a " -"new :meth:`struct.Struct.iter_unpack` method on compiled formats provide " -"streamed unpacking of a buffer containing repeated instances of a given " -"format of data. (Contributed by Antoine Pitrou in :issue:`17804`.)" +"New function :mod:`~struct.iter_unpack` and a new :meth:`struct.Struct." +"iter_unpack` method on compiled formats provide streamed unpacking of a " +"buffer containing repeated instances of a given format of data. (Contributed " +"by Antoine Pitrou in :issue:`17804`.)" msgstr "" #: ../../whatsnew/3.4.rst:1517 @@ -2310,10 +2291,10 @@ msgstr "sys" msgid "" "New function :func:`sys.getallocatedblocks` returns the current number of " "blocks allocated by the interpreter. (In CPython with the default ``--with-" -"pymalloc`` setting, this is allocations made through " -"the :c:func:`PyObject_Malloc` API.) This can be useful for tracking memory " -"leaks, especially if automated via a test suite. (Contributed by Antoine " -"Pitrou in :issue:`13390`.)" +"pymalloc`` setting, this is allocations made through the :c:func:" +"`PyObject_Malloc` API.) This can be useful for tracking memory leaks, " +"especially if automated via a test suite. (Contributed by Antoine Pitrou " +"in :issue:`13390`.)" msgstr "" #: ../../whatsnew/3.4.rst:1558 @@ -2326,10 +2307,10 @@ msgid "" "The :mod:`site` module :ref:`sets it ` to a function " "that enables tab completion and history saving (in :file:`~/.python-" "history`) if the platform supports :mod:`readline`. If you do not want this " -"(new) behavior, you can override it " -"in :envvar:`PYTHONSTARTUP`, :mod:`sitecustomize`, or :mod:`usercustomize` by " -"deleting this attribute from :mod:`sys` (or setting it to some other " -"callable). (Contributed by Éric Araujo and Antoine Pitrou in :issue:`5845`.)" +"(new) behavior, you can override it in :envvar:`PYTHONSTARTUP`, :mod:" +"`sitecustomize`, or :mod:`usercustomize` by deleting this attribute from :" +"mod:`sys` (or setting it to some other callable). (Contributed by Éric " +"Araujo and Antoine Pitrou in :issue:`5845`.)" msgstr "" #: ../../whatsnew/3.4.rst:1573 @@ -2340,8 +2321,8 @@ msgstr "tarfile" msgid "" "The :mod:`tarfile` module now supports a simple :ref:`tarfile-commandline` " "when called as a script directly or via ``-m``. This can be used to create " -"and extract tarfile archives. (Contributed by Berker Peksag " -"in :issue:`13477`.)" +"and extract tarfile archives. (Contributed by Berker Peksag in :issue:" +"`13477`.)" msgstr "" #: ../../whatsnew/3.4.rst:1581 @@ -2358,8 +2339,8 @@ msgid "" "convenience function :func:`~textwrap.shorten` collapses all of the " "whitespace in the input to single spaces and produces a single line of a " "given *width* that ends with the *placeholder* (by default, ``[...]``). " -"(Contributed by Antoine Pitrou and Serhiy Storchaka in :issue:`18585` " -"and :issue:`18725`.)" +"(Contributed by Antoine Pitrou and Serhiy Storchaka in :issue:`18585` and :" +"issue:`18725`.)" msgstr "" #: ../../whatsnew/3.4.rst:1595 @@ -2382,8 +2363,8 @@ msgstr "traceback" msgid "" "A new :func:`traceback.clear_frames` function takes a traceback object and " "clears the local variables in all of the frames it references, reducing the " -"amount of memory consumed. (Contributed by Andrew Kuchling " -"in :issue:`1565525`.)" +"amount of memory consumed. (Contributed by Andrew Kuchling in :issue:" +"`1565525`.)" msgstr "" #: ../../whatsnew/3.4.rst:1613 @@ -2406,41 +2387,40 @@ msgstr "urllib" #: ../../whatsnew/3.4.rst:1626 msgid "" -":mod:`urllib.request` now supports ``data:`` URLs via " -"the :class:`~urllib.request.DataHandler` class. (Contributed by Mathias " -"Panzenböck in :issue:`16423`.)" +":mod:`urllib.request` now supports ``data:`` URLs via the :class:`~urllib." +"request.DataHandler` class. (Contributed by Mathias Panzenböck in :issue:" +"`16423`.)" msgstr "" #: ../../whatsnew/3.4.rst:1630 msgid "" "The http method that will be used by a :class:`~urllib.request.Request` " -"class can now be specified by setting " -"a :class:`~urllib.request.Request.method` class attribute on the subclass. " -"(Contributed by Jason R Coombs in :issue:`18978`.)" +"class can now be specified by setting a :class:`~urllib.request.Request." +"method` class attribute on the subclass. (Contributed by Jason R Coombs in :" +"issue:`18978`.)" msgstr "" #: ../../whatsnew/3.4.rst:1635 msgid "" -":class:`~urllib.request.Request` objects are now reusable: if " -"the :attr:`~urllib.request.Request.full_url` " -"or :attr:`~urllib.request.Request.data` attributes are modified, all " -"relevant internal properties are updated. This means, for example, that it " -"is now possible to use the same :class:`~urllib.request.Request` object in " -"more than one :meth:`.OpenerDirector.open` call with different *data* " -"arguments, or to modify a :class:`~urllib.request.Request`\\ 's ``url`` " -"rather than recomputing it from scratch. There is also a " -"new :meth:`~urllib.request.Request.remove_header` method that can be used to " -"remove headers from a :class:`~urllib.request.Request`. (Contributed by " -"Alexey Kachayev in :issue:`16464`, Daniel Wozniak in :issue:`17485`, and " -"Damien Brecht and Senthil Kumaran in :issue:`17272`.)" +":class:`~urllib.request.Request` objects are now reusable: if the :attr:" +"`~urllib.request.Request.full_url` or :attr:`~urllib.request.Request.data` " +"attributes are modified, all relevant internal properties are updated. This " +"means, for example, that it is now possible to use the same :class:`~urllib." +"request.Request` object in more than one :meth:`.OpenerDirector.open` call " +"with different *data* arguments, or to modify a :class:`~urllib.request." +"Request`\\ 's ``url`` rather than recomputing it from scratch. There is " +"also a new :meth:`~urllib.request.Request.remove_header` method that can be " +"used to remove headers from a :class:`~urllib.request.Request`. " +"(Contributed by Alexey Kachayev in :issue:`16464`, Daniel Wozniak in :issue:" +"`17485`, and Damien Brecht and Senthil Kumaran in :issue:`17272`.)" msgstr "" #: ../../whatsnew/3.4.rst:1648 msgid "" -":class:`~urllib.error.HTTPError` objects now have " -"a :attr:`~urllib.error.HTTPError.headers` attribute that provides access to " -"the HTTP response headers associated with the error. (Contributed by Berker " -"Peksag in :issue:`15701`.)" +":class:`~urllib.error.HTTPError` objects now have a :attr:`~urllib.error." +"HTTPError.headers` attribute that provides access to the HTTP response " +"headers associated with the error. (Contributed by Berker Peksag in :issue:" +"`15701`.)" msgstr "" #: ../../whatsnew/3.4.rst:1655 @@ -2449,13 +2429,13 @@ msgstr "unittest" #: ../../whatsnew/3.4.rst:1657 msgid "" -"The :class:`~unittest.TestCase` class has a new " -"method, :meth:`~unittest.TestCase.subTest`, that produces a context manager " -"whose :keyword:`with` block becomes a \"sub-test\". This context manager " -"allows a test method to dynamically generate subtests by, say, calling the " -"``subTest`` context manager inside a loop. A single test method can thereby " -"produce an indefinite number of separately identified and separately counted " -"tests, all of which will run even if one or more of them fail. For example::" +"The :class:`~unittest.TestCase` class has a new method, :meth:`~unittest." +"TestCase.subTest`, that produces a context manager whose :keyword:`with` " +"block becomes a \"sub-test\". This context manager allows a test method to " +"dynamically generate subtests by, say, calling the ``subTest`` context " +"manager inside a loop. A single test method can thereby produce an " +"indefinite number of separately identified and separately counted tests, all " +"of which will run even if one or more of them fail. For example::" msgstr "" #: ../../whatsnew/3.4.rst:1665 @@ -2515,9 +2495,9 @@ msgstr "" #: ../../whatsnew/3.4.rst:1696 msgid "" "A new test assertion context-manager, :meth:`~unittest.TestCase.assertLogs`, " -"will ensure that a given block of code emits a log message using " -"the :mod:`logging` module. By default the message can come from any logger " -"and have a priority of ``INFO`` or higher, but both the logger name and an " +"will ensure that a given block of code emits a log message using the :mod:" +"`logging` module. By default the message can come from any logger and have " +"a priority of ``INFO`` or higher, but both the logger name and an " "alternative minimum logging level may be specified. The object returned by " "the context manager can be queried for the :class:`~logging.LogRecord`\\ s " "and/or formatted messages that were logged. (Contributed by Antoine Pitrou " @@ -2559,8 +2539,8 @@ msgid "" ":class:`~venv.EnvBuilder` and the :func:`~venv.create` convenience function " "take a new keyword argument *with_pip*, which defaults to ``False``, that " "controls whether or not :class:`~venv.EnvBuilder` ensures that ``pip`` is " -"installed in the virtual environment. (Contributed by Nick Coghlan " -"in :issue:`19552` as part of the :pep:`453` implementation.)" +"installed in the virtual environment. (Contributed by Nick Coghlan in :" +"issue:`19552` as part of the :pep:`453` implementation.)" msgstr "" #: ../../whatsnew/3.4.rst:1731 @@ -2588,9 +2568,9 @@ msgstr "" #: ../../whatsnew/3.4.rst:1743 msgid "" -"The :meth:`~wave.Wave_write.writeframesraw` " -"and :meth:`~wave.Wave_write.writeframes` methods now accept any :term:`bytes-" -"like object`. (Contributed by Serhiy Storchaka in :issue:`8311`.)" +"The :meth:`~wave.Wave_write.writeframesraw` and :meth:`~wave.Wave_write." +"writeframes` methods now accept any :term:`bytes-like object`. (Contributed " +"by Serhiy Storchaka in :issue:`8311`.)" msgstr "" #: ../../whatsnew/3.4.rst:1749 @@ -2625,21 +2605,21 @@ msgstr "xml.etree" #: ../../whatsnew/3.4.rst:1767 msgid "" "A new parser, :class:`~xml.etree.ElementTree.XMLPullParser`, allows a non-" -"blocking applications to parse XML documents. An example can be seen " -"at :ref:`elementtree-pull-parsing`. (Contributed by Antoine Pitrou " -"in :issue:`17741`.)" +"blocking applications to parse XML documents. An example can be seen at :" +"ref:`elementtree-pull-parsing`. (Contributed by Antoine Pitrou in :issue:" +"`17741`.)" msgstr "" #: ../../whatsnew/3.4.rst:1772 msgid "" "The :mod:`xml.etree.ElementTree` :func:`~xml.etree.ElementTree.tostring` " -"and :func:`~xml.etree.ElementTree.tostringlist` functions, and " -"the :class:`~xml.etree.ElementTree.ElementTree` :meth:`~xml.etree.ElementTree.ElementTree.write` " -"method, now have a *short_empty_elements* :ref:`keyword-only parameter " -"` providing control over whether elements with no " -"content are written in abbreviated (````) or expanded (````) form. (Contributed by Ariel Poliak and Serhiy Storchaka " -"in :issue:`14377`.)" +"and :func:`~xml.etree.ElementTree.tostringlist` functions, and the :class:" +"`~xml.etree.ElementTree.ElementTree` :meth:`~xml.etree.ElementTree." +"ElementTree.write` method, now have a *short_empty_elements* :ref:`keyword-" +"only parameter ` providing control over whether " +"elements with no content are written in abbreviated (````) or " +"expanded (````) form. (Contributed by Ariel Poliak and Serhiy " +"Storchaka in :issue:`14377`.)" msgstr "" #: ../../whatsnew/3.4.rst:1783 @@ -2648,18 +2628,18 @@ msgstr "zipfile" #: ../../whatsnew/3.4.rst:1785 msgid "" -"The :meth:`~zipfile.PyZipFile.writepy` method of " -"the :class:`~zipfile.PyZipFile` class has a new *filterfunc* option that can " -"be used to control which directories and files are added to the archive. " -"For example, this could be used to exclude test files from the archive. " -"(Contributed by Christian Tismer in :issue:`19274`.)" +"The :meth:`~zipfile.PyZipFile.writepy` method of the :class:`~zipfile." +"PyZipFile` class has a new *filterfunc* option that can be used to control " +"which directories and files are added to the archive. For example, this " +"could be used to exclude test files from the archive. (Contributed by " +"Christian Tismer in :issue:`19274`.)" msgstr "" #: ../../whatsnew/3.4.rst:1791 msgid "" -"The *allowZip64* parameter to :class:`~zipfile.ZipFile` " -"and :class:`~zipfile.PyZipFile` is now ``True`` by default. (Contributed by " -"William Mallard in :issue:`17201`.)" +"The *allowZip64* parameter to :class:`~zipfile.ZipFile` and :class:`~zipfile." +"PyZipFile` is now ``True`` by default. (Contributed by William Mallard in :" +"issue:`17201`.)" msgstr "" #: ../../whatsnew/3.4.rst:1798 @@ -2694,12 +2674,11 @@ msgstr "" #: ../../whatsnew/3.4.rst:1825 msgid "" -"As part of this change, module globals are no longer forcibly set " -"to :const:`None` during interpreter shutdown in most cases, instead relying " -"on the normal operation of the cyclic garbage collector. This avoids a " -"whole class of interpreter-shutdown-time errors, usually involving " -"``__del__`` methods, that have plagued Python since the cyclic GC was first " -"introduced." +"As part of this change, module globals are no longer forcibly set to :const:" +"`None` during interpreter shutdown in most cases, instead relying on the " +"normal operation of the cyclic garbage collector. This avoids a whole class " +"of interpreter-shutdown-time errors, usually involving ``__del__`` methods, " +"that have plagued Python since the cyclic GC was first introduced." msgstr "" #: ../../whatsnew/3.4.rst:1834 @@ -2812,33 +2791,31 @@ msgstr "" #: ../../whatsnew/3.4.rst:1910 msgid "" -"New function :c:func:`PyStructSequence_InitType2` supplements the " -"existing :c:func:`PyStructSequence_InitType` function. The difference is " -"that it returns ``0`` on success and ``-1`` on failure." +"New function :c:func:`PyStructSequence_InitType2` supplements the existing :" +"c:func:`PyStructSequence_InitType` function. The difference is that it " +"returns ``0`` on success and ``-1`` on failure." msgstr "" #: ../../whatsnew/3.4.rst:1914 msgid "" "The CPython source can now be compiled using the address sanity checking " "features of recent versions of GCC and clang: the false alarms in the small " -"object allocator have been silenced. (Contributed by Dhiru Kholia " -"in :issue:`18596`.)" +"object allocator have been silenced. (Contributed by Dhiru Kholia in :issue:" +"`18596`.)" msgstr "" #: ../../whatsnew/3.4.rst:1919 msgid "" -"The Windows build now uses `Address Space Layout Randomization `_ and `Data " -"Execution Prevention `_. (Contributed by Christian Heimes " -"in :issue:`16632`.)" +"The Windows build now uses `Address Space Layout Randomization `_ and `Data Execution " +"Prevention `_. " +"(Contributed by Christian Heimes in :issue:`16632`.)" msgstr "" #: ../../whatsnew/3.4.rst:1924 msgid "" -"New function :c:func:`PyObject_LengthHint` is the C API equivalent " -"of :func:`operator.length_hint`. (Contributed by Armin Ronacher " -"in :issue:`16148`.)" +"New function :c:func:`PyObject_LengthHint` is the C API equivalent of :func:" +"`operator.length_hint`. (Contributed by Armin Ronacher in :issue:`16148`.)" msgstr "" #: ../../whatsnew/3.4.rst:1932 @@ -2879,8 +2856,8 @@ msgstr "" msgid "" "The CPython Windows installer now adds ``.py`` to the :envvar:`PATHEXT` " "variable when extensions are registered, allowing users to run a python " -"script at the windows command prompt by just typing its name without the " -"``.py`` extension. (Contributed by Paul Moore in :issue:`18569`.)" +"script at the windows command prompt by just typing its name without the ``." +"py`` extension. (Contributed by Paul Moore in :issue:`18569`.)" msgstr "" #: ../../whatsnew/3.4.rst:1962 @@ -2894,13 +2871,12 @@ msgstr "" #: ../../whatsnew/3.4.rst:1968 msgid "" "The ``-R`` option to the :ref:`python regression test suite ` now " -"also checks for memory allocation leaks, " -"using :func:`sys.getallocatedblocks`. (Contributed by Antoine Pitrou " -"in :issue:`13390`.)" +"also checks for memory allocation leaks, using :func:`sys." +"getallocatedblocks`. (Contributed by Antoine Pitrou in :issue:`13390`.)" msgstr "" -":ref:`python 迴歸測試套裝 ` 的 ``-R`` 選項現在也可以透過使" -"用 :func:`sys.getallocatedblocks` 來檢查記憶體配置洩漏。(由 Antoine Pitrou " -"在 :issue:`13390` 貢獻。)" +":ref:`python 迴歸測試套裝 ` 的 ``-R`` 選項現在也可以透過使用 :func:" +"`sys.getallocatedblocks` 來檢查記憶體配置洩漏。(由 Antoine Pitrou 在 :issue:" +"`13390` 貢獻。)" #: ../../whatsnew/3.4.rst:1973 msgid "``python -m`` now works with namespace packages." @@ -2924,15 +2900,15 @@ msgstr "" msgid "" "A new opcode, :opcode:`!LOAD_CLASSDEREF`, has been added to fix a bug in the " "loading of free variables in class bodies that could be triggered by certain " -"uses of :ref:`__prepare__ `. (Contributed by Benjamin Peterson " -"in :issue:`17853`.)" +"uses of :ref:`__prepare__ `. (Contributed by Benjamin Peterson in :" +"issue:`17853`.)" msgstr "" #: ../../whatsnew/3.4.rst:1988 msgid "" "A number of MemoryError-related crashes were identified and fixed by Victor " -"Stinner using his :pep:`445`-based ``pyfailmalloc`` tool " -"(:issue:`18408`, :issue:`18520`)." +"Stinner using his :pep:`445`-based ``pyfailmalloc`` tool (:issue:`18408`, :" +"issue:`18520`)." msgstr "" #: ../../whatsnew/3.4.rst:1992 @@ -2952,10 +2928,10 @@ msgstr "" #: ../../whatsnew/3.4.rst:2001 msgid "" -"The encoding name is now optional in the value set for " -"the :envvar:`PYTHONIOENCODING` environment variable. This makes it possible " -"to set just the error handler, without changing the default encoding. " -"(Contributed by Serhiy Storchaka in :issue:`18818`.)" +"The encoding name is now optional in the value set for the :envvar:" +"`PYTHONIOENCODING` environment variable. This makes it possible to set just " +"the error handler, without changing the default encoding. (Contributed by " +"Serhiy Storchaka in :issue:`18818`.)" msgstr "" #: ../../whatsnew/3.4.rst:2006 @@ -2991,13 +2967,12 @@ msgstr "" #: ../../whatsnew/3.4.rst:2028 msgid "" "The interpreter starts about 30% faster. A couple of measures lead to the " -"speedup. The interpreter loads fewer modules on startup, e.g. " -"the :mod:`re`, :mod:`collections` and :mod:`locale` modules and their " -"dependencies are no longer imported by default. The marshal module has been " -"improved to load compiled Python code faster. (Contributed by Antoine " -"Pitrou, Christian Heimes and Victor Stinner " -"in :issue:`19219`, :issue:`19218`, :issue:`19209`, :issue:`19205` " -"and :issue:`9548`.)" +"speedup. The interpreter loads fewer modules on startup, e.g. the :mod:" +"`re`, :mod:`collections` and :mod:`locale` modules and their dependencies " +"are no longer imported by default. The marshal module has been improved to " +"load compiled Python code faster. (Contributed by Antoine Pitrou, Christian " +"Heimes and Victor Stinner in :issue:`19219`, :issue:`19218`, :issue:" +"`19209`, :issue:`19205` and :issue:`9548`.)" msgstr "" #: ../../whatsnew/3.4.rst:2036 @@ -3030,8 +3005,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:2052 msgid "" -":func:`html.escape` is now 10x faster. (Contributed by Matt Bryant " -"in :issue:`18020`.)" +":func:`html.escape` is now 10x faster. (Contributed by Matt Bryant in :" +"issue:`18020`.)" msgstr "" #: ../../whatsnew/3.4.rst:2055 @@ -3056,9 +3031,9 @@ msgstr "已棄用" msgid "" "This section covers various APIs and other features that have been " "deprecated in Python 3.4, and will be removed in Python 3.5 or later. In " -"most (but not all) cases, using the deprecated APIs will produce " -"a :exc:`DeprecationWarning` when the interpreter is run with deprecation " -"warnings enabled (for example, by using ``-Wd``)." +"most (but not all) cases, using the deprecated APIs will produce a :exc:" +"`DeprecationWarning` when the interpreter is run with deprecation warnings " +"enabled (for example, by using ``-Wd``)." msgstr "" #: ../../whatsnew/3.4.rst:2077 @@ -3069,25 +3044,23 @@ msgstr "已棄用的 Python API" msgid "" "As mentioned in :ref:`whatsnew-pep-451`, a number of :mod:`importlib` " "methods and functions are deprecated: :meth:`!importlib.find_loader` is " -"replaced by :func:`importlib.util.find_spec`; :meth:`!" -"importlib.machinery.PathFinder.find_module` is replaced " -"by :meth:`importlib.machinery.PathFinder.find_spec`; :meth:`!" -"importlib.abc.MetaPathFinder.find_module` is replaced " -"by :meth:`importlib.abc.MetaPathFinder.find_spec`; :meth:`!" -"importlib.abc.PathEntryFinder.find_loader` and :meth:`!find_module` are " -"replaced by :meth:`importlib.abc.PathEntryFinder.find_spec`; all of " -"the :samp:`{xxx}Loader` ABC ``load_module`` methods (:meth:`!" -"importlib.abc.Loader.load_module`, :meth:`!" -"importlib.abc.InspectLoader.load_module`, :meth:`!" -"importlib.abc.FileLoader.load_module`, :meth:`!" -"importlib.abc.SourceLoader.load_module`) should no longer be implemented, " -"instead loaders should implement an ``exec_module`` method " -"(:meth:`importlib.abc.Loader.exec_module`, :meth:`importlib.abc.InspectLoader.exec_module` :meth:`importlib.abc.SourceLoader.exec_module`) " -"and let the import system take care of the rest; and :meth:`!" -"importlib.abc.Loader.module_repr`, :meth:`!" -"importlib.util.module_for_loader`, :meth:`!importlib.util.set_loader`, " -"and :meth:`!importlib.util.set_package` are no longer needed because their " -"functions are now handled automatically by the import system." +"replaced by :func:`importlib.util.find_spec`; :meth:`!importlib.machinery." +"PathFinder.find_module` is replaced by :meth:`importlib.machinery.PathFinder." +"find_spec`; :meth:`!importlib.abc.MetaPathFinder.find_module` is replaced " +"by :meth:`importlib.abc.MetaPathFinder.find_spec`; :meth:`!importlib.abc." +"PathEntryFinder.find_loader` and :meth:`!find_module` are replaced by :meth:" +"`importlib.abc.PathEntryFinder.find_spec`; all of the :samp:`{xxx}Loader` " +"ABC ``load_module`` methods (:meth:`!importlib.abc.Loader.load_module`, :" +"meth:`!importlib.abc.InspectLoader.load_module`, :meth:`!importlib.abc." +"FileLoader.load_module`, :meth:`!importlib.abc.SourceLoader.load_module`) " +"should no longer be implemented, instead loaders should implement an " +"``exec_module`` method (:meth:`importlib.abc.Loader.exec_module`, :meth:" +"`importlib.abc.InspectLoader.exec_module` :meth:`importlib.abc.SourceLoader." +"exec_module`) and let the import system take care of the rest; and :meth:`!" +"importlib.abc.Loader.module_repr`, :meth:`!importlib.util." +"module_for_loader`, :meth:`!importlib.util.set_loader`, and :meth:`!" +"importlib.util.set_package` are no longer needed because their functions are " +"now handled automatically by the import system." msgstr "" #: ../../whatsnew/3.4.rst:2104 @@ -3112,8 +3085,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:2114 msgid "" "The internal ``Netrc`` class in the :mod:`ftplib` module has been documented " -"as deprecated in its docstring for quite some time. It now emits " -"a :exc:`DeprecationWarning` and will be removed completely in Python 3.5." +"as deprecated in its docstring for quite some time. It now emits a :exc:" +"`DeprecationWarning` and will be removed completely in Python 3.5." msgstr "" #: ../../whatsnew/3.4.rst:2118 @@ -3132,10 +3105,10 @@ msgstr "" msgid "" "The :mod:`plistlib` :func:`!readPlist`, :func:`!writePlist`, :func:`!" "readPlistFromBytes`, and :func:`!writePlistToBytes` functions are deprecated " -"in favor of the corresponding new " -"functions :func:`~plistlib.load`, :func:`~plistlib.dump`, :func:`~plistlib.loads`, " -"and :func:`~plistlib.dumps`. :func:`!Data` is deprecated in favor of just " -"using the :class:`bytes` constructor." +"in favor of the corresponding new functions :func:`~plistlib.load`, :func:" +"`~plistlib.dump`, :func:`~plistlib.loads`, and :func:`~plistlib.dumps`. :" +"func:`!Data` is deprecated in favor of just using the :class:`bytes` " +"constructor." msgstr "" #: ../../whatsnew/3.4.rst:2131 @@ -3155,9 +3128,9 @@ msgstr "" #: ../../whatsnew/3.4.rst:2139 msgid "" "The *parser* argument of :func:`xml.etree.ElementTree.iterparse` has been " -"deprecated, as has the *html* argument " -"of :func:`~xml.etree.ElementTree.XMLParser`. To prepare for the removal of " -"the latter, all arguments to ``XMLParser`` should be passed by keyword." +"deprecated, as has the *html* argument of :func:`~xml.etree.ElementTree." +"XMLParser`. To prepare for the removal of the latter, all arguments to " +"``XMLParser`` should be passed by keyword." msgstr "" #: ../../whatsnew/3.4.rst:2146 @@ -3233,8 +3206,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:2185 msgid "" "The ``PyThreadState.tick_counter`` field has been removed; its value has " -"been meaningless since Python 3.2, when the \"new GIL\" was introduced " -"(:issue:`19199`)." +"been meaningless since Python 3.2, when the \"new GIL\" was introduced (:" +"issue:`19199`)." msgstr "" #: ../../whatsnew/3.4.rst:2189 @@ -3245,9 +3218,9 @@ msgstr "" #: ../../whatsnew/3.4.rst:2192 msgid "" -"The *strict* argument to :class:`~http.client.HTTPConnection` " -"and :class:`~http.client.HTTPSConnection` has been removed. HTTP 0.9-style " -"\"Simple Responses\" are no longer supported." +"The *strict* argument to :class:`~http.client.HTTPConnection` and :class:" +"`~http.client.HTTPSConnection` has been removed. HTTP 0.9-style \"Simple " +"Responses\" are no longer supported." msgstr "" #: ../../whatsnew/3.4.rst:2196 @@ -3260,8 +3233,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:2201 msgid "" -"Support for loading the deprecated ``TYPE_INT64`` has been removed " -"from :mod:`marshal`. (Contributed by Dan Riti in :issue:`15480`.)" +"Support for loading the deprecated ``TYPE_INT64`` has been removed from :mod:" +"`marshal`. (Contributed by Dan Riti in :issue:`15480`.)" msgstr "" #: ../../whatsnew/3.4.rst:2204 @@ -3278,16 +3251,16 @@ msgid "" "situation where previously working (but incorrect) code would start failing " "if an object gained a __format__ method, which means that your code may now " "raise a :exc:`TypeError` if you are using an ``'s'`` format code with " -"objects that do not have a __format__ method that handles it. " -"See :issue:`7994` for background." +"objects that do not have a __format__ method that handles it. See :issue:" +"`7994` for background." msgstr "" #: ../../whatsnew/3.4.rst:2216 msgid "" -":meth:`!difflib.SequenceMatcher.isbjunk` and :meth:`!" -"difflib.SequenceMatcher.isbpopular` were deprecated in 3.2, and have now " -"been removed: use ``x in sm.bjunk`` and ``x in sm.bpopular``, where *sm* is " -"a :class:`~difflib.SequenceMatcher` object (:issue:`13248`)." +":meth:`!difflib.SequenceMatcher.isbjunk` and :meth:`!difflib.SequenceMatcher." +"isbpopular` were deprecated in 3.2, and have now been removed: use ``x in sm." +"bjunk`` and ``x in sm.bpopular``, where *sm* is a :class:`~difflib." +"SequenceMatcher` object (:issue:`13248`)." msgstr "" #: ../../whatsnew/3.4.rst:2224 @@ -3331,12 +3304,12 @@ msgstr "" #: ../../whatsnew/3.4.rst:2249 msgid "" "In a posix shell, setting the :envvar:`PATH` environment variable to an " -"empty value is equivalent to not setting it at all. However, " -"setting :envvar:`PYTHONPATH` to an empty value was *not* equivalent to not " -"setting it at all: setting :envvar:`PYTHONPATH` to an empty value was " -"equivalent to setting it to ``.``, which leads to confusion when reasoning " -"by analogy to how :envvar:`PATH` works. The behavior now conforms to the " -"posix convention for :envvar:`PATH`." +"empty value is equivalent to not setting it at all. However, setting :" +"envvar:`PYTHONPATH` to an empty value was *not* equivalent to not setting it " +"at all: setting :envvar:`PYTHONPATH` to an empty value was equivalent to " +"setting it to ``.``, which leads to confusion when reasoning by analogy to " +"how :envvar:`PATH` works. The behavior now conforms to the posix convention " +"for :envvar:`PATH`." msgstr "" #: ../../whatsnew/3.4.rst:2257 @@ -3360,20 +3333,18 @@ msgstr "Python API 的變更" #: ../../whatsnew/3.4.rst:2269 msgid "" "The ABCs defined in :mod:`importlib.abc` now either raise the appropriate " -"exception or return a default value instead of " -"raising :exc:`NotImplementedError` blindly. This will only affect code " -"calling :func:`super` and falling through all the way to the ABCs. For " -"compatibility, catch both :exc:`NotImplementedError` or the appropriate " -"exception as needed." +"exception or return a default value instead of raising :exc:" +"`NotImplementedError` blindly. This will only affect code calling :func:" +"`super` and falling through all the way to the ABCs. For compatibility, " +"catch both :exc:`NotImplementedError` or the appropriate exception as needed." msgstr "" #: ../../whatsnew/3.4.rst:2275 msgid "" -"The module type now initializes the :attr:`~module.__package__` " -"and :attr:`~module.__loader__` attributes to ``None`` by default. To " -"determine if these attributes were set in a backwards-compatible fashion, " -"use e.g. ``getattr(module, '__loader__', None) is not None``. " -"(:issue:`17115`.)" +"The module type now initializes the :attr:`~module.__package__` and :attr:" +"`~module.__loader__` attributes to ``None`` by default. To determine if " +"these attributes were set in a backwards-compatible fashion, use e.g. " +"``getattr(module, '__loader__', None) is not None``. (:issue:`17115`.)" msgstr "" #: ../../whatsnew/3.4.rst:2281 @@ -3408,9 +3379,9 @@ msgid "" "incorrect for frozen modules to set the attribute as they are not loaded " "from any explicit location. If you must know that a module comes from frozen " "code then you can see if the module's ``__spec__.location`` is set to " -"``'frozen'``, check if the loader is a subclass " -"of :class:`importlib.machinery.FrozenImporter`, or if Python 2 compatibility " -"is necessary you can use :func:`!imp.is_frozen`." +"``'frozen'``, check if the loader is a subclass of :class:`importlib." +"machinery.FrozenImporter`, or if Python 2 compatibility is necessary you can " +"use :func:`!imp.is_frozen`." msgstr "" #: ../../whatsnew/3.4.rst:2306 @@ -3423,14 +3394,14 @@ msgstr "" #: ../../whatsnew/3.4.rst:2311 msgid "" -":meth:`importlib.abc.SourceLoader.get_source` no longer " -"raises :exc:`ImportError` when the source code being loaded triggers " -"a :exc:`SyntaxError` or :exc:`UnicodeDecodeError`. As :exc:`ImportError` is " -"meant to be raised only when source code cannot be found but it should, it " -"was felt to be over-reaching/overloading of that meaning when the source " -"code is found but improperly structured. If you were catching ImportError " -"before and wish to continue to ignore syntax or decoding issues, catch all " -"three exceptions now." +":meth:`importlib.abc.SourceLoader.get_source` no longer raises :exc:" +"`ImportError` when the source code being loaded triggers a :exc:" +"`SyntaxError` or :exc:`UnicodeDecodeError`. As :exc:`ImportError` is meant " +"to be raised only when source code cannot be found but it should, it was " +"felt to be over-reaching/overloading of that meaning when the source code is " +"found but improperly structured. If you were catching ImportError before and " +"wish to continue to ignore syntax or decoding issues, catch all three " +"exceptions now." msgstr "" #: ../../whatsnew/3.4.rst:2320 @@ -3447,13 +3418,12 @@ msgstr "" #: ../../whatsnew/3.4.rst:2330 msgid "" -":func:`inspect.getfullargspec` has been reimplemented on top " -"of :func:`inspect.signature` and hence handles a much wider variety of " -"callable objects than it did in the past. It is expected that additional " -"builtin and extension module callables will gain signature metadata over the " -"course of the Python 3.4 series. Code that assumes " -"that :func:`inspect.getfullargspec` will fail on non-Python callables may " -"need to be adjusted accordingly." +":func:`inspect.getfullargspec` has been reimplemented on top of :func:" +"`inspect.signature` and hence handles a much wider variety of callable " +"objects than it did in the past. It is expected that additional builtin and " +"extension module callables will gain signature metadata over the course of " +"the Python 3.4 series. Code that assumes that :func:`inspect.getfullargspec` " +"will fail on non-Python callables may need to be adjusted accordingly." msgstr "" #: ../../whatsnew/3.4.rst:2338 @@ -3466,8 +3436,8 @@ msgid "" "working directory will also now have an absolute path, including when using " "``-m`` with the interpreter (except for ``__main__.__file__`` when a script " "has been executed directly using a relative path) (Contributed by Brett " -"Cannon in :issue:`18416`). is specified on the command-line) " -"(:issue:`18416`)." +"Cannon in :issue:`18416`). is specified on the command-line) (:issue:" +"`18416`)." msgstr "" #: ../../whatsnew/3.4.rst:2349 @@ -3484,69 +3454,66 @@ msgid "" "Strings between ``from __future__ import ...`` statements now *always* raise " "a :exc:`SyntaxError`. Previously if there was no leading docstring, an " "interstitial string would sometimes be ignored. This brings CPython into " -"compliance with the language spec; Jython and PyPy already were. " -"(:issue:`17434`)." +"compliance with the language spec; Jython and PyPy already were. (:issue:" +"`17434`)." msgstr "" #: ../../whatsnew/3.4.rst:2361 msgid "" ":meth:`ssl.SSLSocket.getpeercert` and :meth:`ssl.SSLSocket.do_handshake` now " "raise an :exc:`OSError` with ``ENOTCONN`` when the ``SSLSocket`` is not " -"connected, instead of the previous behavior of raising " -"an :exc:`AttributeError`. In addition, :meth:`~ssl.SSLSocket.getpeercert` " -"will raise a :exc:`ValueError` if the handshake has not yet been done." +"connected, instead of the previous behavior of raising an :exc:" +"`AttributeError`. In addition, :meth:`~ssl.SSLSocket.getpeercert` will " +"raise a :exc:`ValueError` if the handshake has not yet been done." msgstr "" #: ../../whatsnew/3.4.rst:2367 msgid "" ":func:`base64.b32decode` now raises a :exc:`binascii.Error` when the input " "string contains non-b32-alphabet characters, instead of a :exc:`TypeError`. " -"This particular :exc:`TypeError` was missed when the " -"other :exc:`TypeError`\\ s were converted. (Contributed by Serhiy Storchaka " -"in :issue:`18011`.) Note: this change was also inadvertently applied in " -"Python 3.3.3." +"This particular :exc:`TypeError` was missed when the other :exc:" +"`TypeError`\\ s were converted. (Contributed by Serhiy Storchaka in :issue:" +"`18011`.) Note: this change was also inadvertently applied in Python 3.3.3." msgstr "" #: ../../whatsnew/3.4.rst:2374 msgid "" -"The :attr:`!file` attribute is now automatically closed when the " -"creating :class:`!cgi.FieldStorage` instance is garbage collected. If you " -"were pulling the file object out separately from the :class:`!" -"cgi.FieldStorage` instance and not keeping the instance alive, then you " -"should either store the entire :class:`!cgi.FieldStorage` instance or read " -"the contents of the file before the :class:`!cgi.FieldStorage` instance is " -"garbage collected." +"The :attr:`!file` attribute is now automatically closed when the creating :" +"class:`!cgi.FieldStorage` instance is garbage collected. If you were pulling " +"the file object out separately from the :class:`!cgi.FieldStorage` instance " +"and not keeping the instance alive, then you should either store the entire :" +"class:`!cgi.FieldStorage` instance or read the contents of the file before " +"the :class:`!cgi.FieldStorage` instance is garbage collected." msgstr "" #: ../../whatsnew/3.4.rst:2381 msgid "" "Calling ``read`` or ``write`` on a closed SSL socket now raises an " -"informative :exc:`ValueError` rather than the previous more " -"mysterious :exc:`AttributeError` (:issue:`9177`)." +"informative :exc:`ValueError` rather than the previous more mysterious :exc:" +"`AttributeError` (:issue:`9177`)." msgstr "" #: ../../whatsnew/3.4.rst:2385 msgid "" ":meth:`slice.indices` no longer produces an :exc:`OverflowError` for huge " -"values. As a consequence of this fix, :meth:`slice.indices` now raises " -"a :exc:`ValueError` if given a negative length; previously it returned " -"nonsense values (:issue:`14794`)." +"values. As a consequence of this fix, :meth:`slice.indices` now raises a :" +"exc:`ValueError` if given a negative length; previously it returned nonsense " +"values (:issue:`14794`)." msgstr "" #: ../../whatsnew/3.4.rst:2390 msgid "" "The :class:`complex` constructor, unlike the :mod:`cmath` functions, was " "incorrectly accepting :class:`float` values if an object's ``__complex__`` " -"special method returned one. This now raises a :exc:`TypeError`. " -"(:issue:`16290`.)" +"special method returned one. This now raises a :exc:`TypeError`. (:issue:" +"`16290`.)" msgstr "" #: ../../whatsnew/3.4.rst:2395 msgid "" -"The :class:`int` constructor in 3.2 and 3.3 erroneously " -"accepts :class:`float` values for the *base* parameter. It is unlikely " -"anyone was doing this, but if so, it will now raise a :exc:`TypeError` " -"(:issue:`16772`)." +"The :class:`int` constructor in 3.2 and 3.3 erroneously accepts :class:" +"`float` values for the *base* parameter. It is unlikely anyone was doing " +"this, but if so, it will now raise a :exc:`TypeError` (:issue:`16772`)." msgstr "" #: ../../whatsnew/3.4.rst:2399 @@ -3587,8 +3554,8 @@ msgid "" "isolation that :mod:`unittest` is designed to provide. However, if the lack " "of isolation is considered acceptable, the old behavior can be restored by " "creating a :mod:`~unittest.TestSuite` subclass that defines a " -"``_removeTestAtIndex`` method that does nothing " -"(see :meth:`.TestSuite.__iter__`) (:issue:`11798`)." +"``_removeTestAtIndex`` method that does nothing (see :meth:`.TestSuite." +"__iter__`) (:issue:`11798`)." msgstr "" #: ../../whatsnew/3.4.rst:2426 @@ -3621,8 +3588,8 @@ msgid "" "The new *convert_charrefs* argument to :class:`~html.parser.HTMLParser` " "currently defaults to ``False`` for backward compatibility, but will " "eventually be changed to default to ``True``. It is recommended that you " -"add this keyword, with the appropriate value, to " -"any :class:`~html.parser.HTMLParser` calls in your code (:issue:`13633`)." +"add this keyword, with the appropriate value, to any :class:`~html.parser." +"HTMLParser` calls in your code (:issue:`13633`)." msgstr "" #: ../../whatsnew/3.4.rst:2447 @@ -3646,8 +3613,8 @@ msgid "" "is ineffective in Python3 and will eventually raise an error if used. " "Depending on the function, the equivalent of its old Python2 behavior can be " "achieved using either a *newline* argument, or if necessary by wrapping the " -"stream in :mod:`~io.TextIOWrapper` to use its *newline* argument " -"(:issue:`15204`)." +"stream in :mod:`~io.TextIOWrapper` to use its *newline* argument (:issue:" +"`15204`)." msgstr "" #: ../../whatsnew/3.4.rst:2463 @@ -3677,10 +3644,10 @@ msgstr "" msgid "" "The :mod:`collections.abc` module has been slightly refactored as part of " "the Python startup improvements. As a consequence of this, it is no longer " -"the case that importing :mod:`collections` automatically " -"imports :mod:`collections.abc`. If your program depended on the " -"(undocumented) implicit import, you will need to add an explicit ``import " -"collections.abc`` (:issue:`20784`)." +"the case that importing :mod:`collections` automatically imports :mod:" +"`collections.abc`. If your program depended on the (undocumented) implicit " +"import, you will need to add an explicit ``import collections.abc`` (:issue:" +"`20784`)." msgstr "" #: ../../whatsnew/3.4.rst:2487 @@ -3689,16 +3656,16 @@ msgstr "C API 中的改動" #: ../../whatsnew/3.4.rst:2489 msgid "" -":c:func:`PyEval_EvalFrameEx`, :c:func:`PyObject_Repr`, " -"and :c:func:`PyObject_Str`, along with some other internal C APIs, now " -"include a debugging assertion that ensures they are not used in situations " -"where they may silently discard a currently active exception. In cases where " -"discarding the active exception is expected and desired (for example, " -"because it has already been saved locally with :c:func:`PyErr_Fetch` or is " -"being deliberately replaced with a different exception), an " -"explicit :c:func:`PyErr_Clear` call will be needed to avoid triggering the " -"assertion when invoking these operations (directly or indirectly) and " -"running against a version of Python that is compiled with assertions enabled." +":c:func:`PyEval_EvalFrameEx`, :c:func:`PyObject_Repr`, and :c:func:" +"`PyObject_Str`, along with some other internal C APIs, now include a " +"debugging assertion that ensures they are not used in situations where they " +"may silently discard a currently active exception. In cases where discarding " +"the active exception is expected and desired (for example, because it has " +"already been saved locally with :c:func:`PyErr_Fetch` or is being " +"deliberately replaced with a different exception), an explicit :c:func:" +"`PyErr_Clear` call will be needed to avoid triggering the assertion when " +"invoking these operations (directly or indirectly) and running against a " +"version of Python that is compiled with assertions enabled." msgstr "" #: ../../whatsnew/3.4.rst:2501 @@ -3711,10 +3678,10 @@ msgstr "" #: ../../whatsnew/3.4.rst:2505 msgid "" "The result of the :c:data:`PyOS_ReadlineFunctionPointer` callback must now " -"be a string allocated by :c:func:`PyMem_RawMalloc` " -"or :c:func:`PyMem_RawRealloc`, or ``NULL`` if an error occurred, instead of " -"a string allocated by :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc` " -"(:issue:`16742`)" +"be a string allocated by :c:func:`PyMem_RawMalloc` or :c:func:" +"`PyMem_RawRealloc`, or ``NULL`` if an error occurred, instead of a string " +"allocated by :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc` (:issue:" +"`16742`)" msgstr "" #: ../../whatsnew/3.4.rst:2511 From 9f7d890a730892142ce844a60df50bd92d4d624b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 1 Dec 2025 00:19:18 +0000 Subject: [PATCH 08/13] sync with cpython 4dbf8e14 --- c-api/bytes.po | 5 +- c-api/typeobj.po | 81 +- howto/annotations.po | 141 ++- howto/curses.po | 4 +- howto/ipaddress.po | 28 +- howto/isolating-extensions.po | 4 +- howto/regex.po | 191 ++-- howto/sockets.po | 20 +- howto/urllib2.po | 6 +- library/argparse.po | 4 +- library/asyncio.po | 4 +- library/codecs.po | 8 +- library/datetime.po | 732 ++++++++------- library/dialog.po | 16 +- library/enum.po | 6 +- library/functions.po | 191 ++-- library/logging.config.po | 6 +- library/logging.handlers.po | 6 +- library/logging.po | 6 +- library/multiprocessing.po | 736 +++++++-------- library/stdtypes.po | 8 +- library/tkinter.font.po | 26 +- library/turtle.po | 194 ++-- library/xml.sax.handler.po | 24 +- reference/executionmodel.po | 18 +- tutorial/introduction.po | 43 +- using/configure.po | 9 +- using/windows.po | 14 +- whatsnew/3.11.po | 1573 ++++++++++++++++----------------- whatsnew/3.7.po | 4 +- 30 files changed, 2055 insertions(+), 2053 deletions(-) diff --git a/c-api/bytes.po b/c-api/bytes.po index c19ff85ce1..201bf42b04 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-13 00:15+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -159,7 +159,8 @@ msgid "``%zd``" msgstr "``%zd``" #: ../../c-api/bytes.rst:84 -msgid ":c:type:`\\ Py_ssize_t`" +#, fuzzy +msgid ":c:type:` Py_ssize_t`" msgstr ":c:type:`\\ Py_ssize_t`" #: ../../c-api/bytes.rst:84 diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 234cf9e62b..285808351b 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-20 00:14+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,8 +93,8 @@ msgstr "I" msgid " :c:member:`~PyTypeObject.tp_name`" msgstr " :c:member:`~PyTypeObject.tp_name`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:44 -#: ../../c-api/typeobj.rst:86 +#: ../../c-api/typeobj.rst:44 ../../c-api/typeobj.rst:86 +#: ../../c-api/typeobj.rst:372 ../../c-api/typeobj.rst:377 msgid "const char *" msgstr "const char *" @@ -125,10 +125,11 @@ msgstr "X" msgid ":c:member:`~PyTypeObject.tp_basicsize`" msgstr ":c:member:`~PyTypeObject.tp_basicsize`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:46 -#: ../../c-api/typeobj.rst:48 ../../c-api/typeobj.rst:52 -#: ../../c-api/typeobj.rst:99 ../../c-api/typeobj.rst:120 -#: ../../c-api/typeobj.rst:417 +#: ../../c-api/typeobj.rst:46 ../../c-api/typeobj.rst:48 +#: ../../c-api/typeobj.rst:52 ../../c-api/typeobj.rst:99 +#: ../../c-api/typeobj.rst:120 ../../c-api/typeobj.rst:343 +#: ../../c-api/typeobj.rst:417 ../../c-api/typeobj.rst:448 +#: ../../c-api/typeobj.rst:453 msgid ":c:type:`Py_ssize_t`" msgstr ":c:type:`Py_ssize_t`" @@ -402,7 +403,8 @@ msgstr ":c:type:`PyGetSetDef` []" msgid ":c:member:`~PyTypeObject.tp_base`" msgstr ":c:member:`~PyTypeObject.tp_base`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:111 +#: ../../c-api/typeobj.rst:111 ../../c-api/typeobj.rst:342 +#: ../../c-api/typeobj.rst:357 msgid ":c:type:`PyTypeObject` *" msgstr ":c:type:`PyTypeObject` *" @@ -414,18 +416,32 @@ msgstr "__base__" msgid ":c:member:`~PyTypeObject.tp_dict`" msgstr ":c:member:`~PyTypeObject.tp_dict`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:113 -#: ../../c-api/typeobj.rst:132 ../../c-api/typeobj.rst:134 -#: ../../c-api/typeobj.rst:136 ../../c-api/typeobj.rst:140 -#: ../../c-api/typeobj.rst:342 ../../c-api/typeobj.rst:347 -#: ../../c-api/typeobj.rst:357 ../../c-api/typeobj.rst:369 -#: ../../c-api/typeobj.rst:371 ../../c-api/typeobj.rst:382 -#: ../../c-api/typeobj.rst:393 ../../c-api/typeobj.rst:405 -#: ../../c-api/typeobj.rst:407 ../../c-api/typeobj.rst:413 -#: ../../c-api/typeobj.rst:415 ../../c-api/typeobj.rst:417 -#: ../../c-api/typeobj.rst:430 ../../c-api/typeobj.rst:432 -#: ../../c-api/typeobj.rst:436 ../../c-api/typeobj.rst:441 -#: ../../c-api/typeobj.rst:447 +#: ../../c-api/typeobj.rst:113 ../../c-api/typeobj.rst:132 +#: ../../c-api/typeobj.rst:134 ../../c-api/typeobj.rst:136 +#: ../../c-api/typeobj.rst:140 ../../c-api/typeobj.rst:342 +#: ../../c-api/typeobj.rst:347 ../../c-api/typeobj.rst:351 +#: ../../c-api/typeobj.rst:357 ../../c-api/typeobj.rst:358 +#: ../../c-api/typeobj.rst:359 ../../c-api/typeobj.rst:363 +#: ../../c-api/typeobj.rst:364 ../../c-api/typeobj.rst:365 +#: ../../c-api/typeobj.rst:369 ../../c-api/typeobj.rst:371 +#: ../../c-api/typeobj.rst:376 ../../c-api/typeobj.rst:378 +#: ../../c-api/typeobj.rst:382 ../../c-api/typeobj.rst:383 +#: ../../c-api/typeobj.rst:387 ../../c-api/typeobj.rst:388 +#: ../../c-api/typeobj.rst:389 ../../c-api/typeobj.rst:393 +#: ../../c-api/typeobj.rst:394 ../../c-api/typeobj.rst:395 +#: ../../c-api/typeobj.rst:399 ../../c-api/typeobj.rst:400 +#: ../../c-api/typeobj.rst:401 ../../c-api/typeobj.rst:405 +#: ../../c-api/typeobj.rst:407 ../../c-api/typeobj.rst:408 +#: ../../c-api/typeobj.rst:413 ../../c-api/typeobj.rst:415 +#: ../../c-api/typeobj.rst:417 ../../c-api/typeobj.rst:419 +#: ../../c-api/typeobj.rst:425 ../../c-api/typeobj.rst:430 +#: ../../c-api/typeobj.rst:432 ../../c-api/typeobj.rst:436 +#: ../../c-api/typeobj.rst:437 ../../c-api/typeobj.rst:441 +#: ../../c-api/typeobj.rst:442 ../../c-api/typeobj.rst:443 +#: ../../c-api/typeobj.rst:447 ../../c-api/typeobj.rst:452 +#: ../../c-api/typeobj.rst:454 ../../c-api/typeobj.rst:458 +#: ../../c-api/typeobj.rst:459 ../../c-api/typeobj.rst:463 +#: ../../c-api/typeobj.rst:464 ../../c-api/typeobj.rst:465 msgid ":c:type:`PyObject` *" msgstr ":c:type:`PyObject` *" @@ -533,8 +549,8 @@ msgstr "[:c:member:`~PyTypeObject.tp_cache`]" msgid "[:c:member:`~PyTypeObject.tp_subclasses`]" msgstr "[:c:member:`~PyTypeObject.tp_subclasses`]" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:138 -#: ../../c-api/typeobj.rst:279 ../../c-api/typeobj.rst:349 +#: ../../c-api/typeobj.rst:138 ../../c-api/typeobj.rst:279 +#: ../../c-api/typeobj.rst:349 ../../c-api/typeobj.rst:353 msgid "void *" msgstr "void *" @@ -1117,8 +1133,9 @@ msgid ":c:func:`releasebufferproc`" msgstr ":c:func:`releasebufferproc`" #: ../../c-api/typeobj.rst:330 -msgid "__release_\\ buffer\\__" -msgstr "" +#, fuzzy +msgid "__release_ buffer\\__" +msgstr "__buffer__" #: ../../c-api/typeobj.rst:337 msgid "slot typedefs" @@ -1141,16 +1158,16 @@ msgstr "" msgid "void" msgstr "void" -#: ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:352 msgid ":c:type:`visitproc`" msgstr ":c:type:`visitproc`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:351 -#: ../../c-api/typeobj.rst:363 ../../c-api/typeobj.rst:376 -#: ../../c-api/typeobj.rst:387 ../../c-api/typeobj.rst:399 -#: ../../c-api/typeobj.rst:419 ../../c-api/typeobj.rst:430 -#: ../../c-api/typeobj.rst:452 ../../c-api/typeobj.rst:458 -#: ../../c-api/typeobj.rst:463 +#: ../../c-api/typeobj.rst:351 ../../c-api/typeobj.rst:363 +#: ../../c-api/typeobj.rst:376 ../../c-api/typeobj.rst:387 +#: ../../c-api/typeobj.rst:399 ../../c-api/typeobj.rst:409 +#: ../../c-api/typeobj.rst:419 ../../c-api/typeobj.rst:421 +#: ../../c-api/typeobj.rst:430 ../../c-api/typeobj.rst:452 +#: ../../c-api/typeobj.rst:458 ../../c-api/typeobj.rst:463 msgid "int" msgstr "int" @@ -1162,7 +1179,7 @@ msgstr "Py_hash_t" msgid ":c:type:`getbufferproc`" msgstr ":c:type:`getbufferproc`" -#: ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:420 ../../c-api/typeobj.rst:426 msgid ":c:type:`Py_buffer` *" msgstr ":c:type:`Py_buffer` *" diff --git a/howto/annotations.po b/howto/annotations.po index 14d53f0aea..f6a5b8f4ca 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2023-11-08 23:11+0800\n" "Last-Translator: rockleon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,7 +29,7 @@ msgstr "作者" msgid "Larry Hastings" msgstr "Larry Hastings" -#: ../../howto/annotations.rst:-1 +#: ../../howto/annotations.rst:9 msgid "Abstract" msgstr "摘要" @@ -60,8 +60,8 @@ msgstr "" msgid "" "Note that this document is specifically about working with " "``__annotations__``, not uses *for* annotations. If you're looking for " -"information on how to use \"type hints\" in your code, please see " -"the :mod:`typing` module." +"information on how to use \"type hints\" in your code, please see the :mod:" +"`typing` module." msgstr "" "請注意,本文件是特別說明 ``__annotations__`` 的使用,而非\\ *如何使用*\\ 註" "釋。如果你正在尋找如何在你的程式碼中使用「型別提示 (type hint)」的資訊,請查" @@ -73,30 +73,30 @@ msgstr "在 Python 3.10 及更高版本中存取物件的註釋字典" #: ../../howto/annotations.rst:35 msgid "" -"Python 3.10 adds a new function to the standard " -"library: :func:`inspect.get_annotations`. In Python versions 3.10 through " -"3.13, calling this function is the best practice for accessing the " -"annotations dict of any object that supports annotations. This function can " -"also \"un-stringize\" stringized annotations for you." +"Python 3.10 adds a new function to the standard library: :func:`inspect." +"get_annotations`. In Python versions 3.10 through 3.13, calling this " +"function is the best practice for accessing the annotations dict of any " +"object that supports annotations. This function can also \"un-stringize\" " +"stringized annotations for you." msgstr "" "Python 3.10 在標準函式庫中新增了一個新函式::func:`inspect.get_annotations`。" -"在 Python 3.10 到 3.13,呼叫此函式是存取任何支援註釋的物件的註釋字典的最" -"佳實踐。此函式也可以為你「取消字串化 (un-stringize)」字串化註釋。" +"在 Python 3.10 到 3.13,呼叫此函式是存取任何支援註釋的物件的註釋字典的最佳實" +"踐。此函式也可以為你「取消字串化 (un-stringize)」字串化註釋。" #: ../../howto/annotations.rst:42 msgid "" "In Python 3.14, there is a new :mod:`annotationlib` module with " -"functionality for working with annotations. This includes " -"a :func:`annotationlib.get_annotations` function, which " -"supersedes :func:`inspect.get_annotations`." +"functionality for working with annotations. This includes a :func:" +"`annotationlib.get_annotations` function, which supersedes :func:`inspect." +"get_annotations`." msgstr "" #: ../../howto/annotations.rst:47 msgid "" "If for some reason :func:`inspect.get_annotations` isn't viable for your use " "case, you may access the ``__annotations__`` data member manually. Best " -"practice for this changed in Python 3.10 as well: as of Python 3.10, " -"``o.__annotations__`` is guaranteed to *always* work on Python functions, " +"practice for this changed in Python 3.10 as well: as of Python 3.10, ``o." +"__annotations__`` is guaranteed to *always* work on Python functions, " "classes, and modules. If you're certain the object you're examining is one " "of these three *specific* objects, you may simply use ``o.__annotations__`` " "to get at the object's annotations dict." @@ -109,12 +109,11 @@ msgstr "" #: ../../howto/annotations.rst:57 msgid "" -"However, other types of callables--for example, callables created " -"by :func:`functools.partial`--may not have an ``__annotations__`` attribute " -"defined. When accessing the ``__annotations__`` of a possibly unknown " -"object, best practice in Python versions 3.10 and newer is to " -"call :func:`getattr` with three arguments, for example ``getattr(o, " -"'__annotations__', None)``." +"However, other types of callables--for example, callables created by :func:" +"`functools.partial`--may not have an ``__annotations__`` attribute defined. " +"When accessing the ``__annotations__`` of a possibly unknown object, best " +"practice in Python versions 3.10 and newer is to call :func:`getattr` with " +"three arguments, for example ``getattr(o, '__annotations__', None)``." msgstr "" "但是,其他型別的 callable(可呼叫物件)(例如,由 :func:`functools.partial` " "建立的 callable)可能沒有定義 ``__annotations__`` 屬性 (attribute)。當存取可" @@ -206,9 +205,9 @@ msgid "" msgstr "" "如果你正在檢查的物件是一個類別 (``isinstance(o, type)``),你的程式碼將必須有" "一個單獨的程式碼路徑。在這種情況下,最佳實踐依賴 Python 3.9 及之前版本的實作" -"細節 (implementation detail):如果一個類別定義了註釋,它們將儲存在該類別" -"的 :attr:`~type.__dict__` 字典中。由於類別可能定義了註釋,也可能沒有定義,因" -"此最佳實踐是在類別字典上呼叫 :meth:`~dict.get` 方法。" +"細節 (implementation detail):如果一個類別定義了註釋,它們將儲存在該類別的 :" +"attr:`~type.__dict__` 字典中。由於類別可能定義了註釋,也可能沒有定義,因此最" +"佳實踐是在類別字典上呼叫 :meth:`~dict.get` 方法。" #: ../../howto/annotations.rst:114 msgid "" @@ -234,21 +233,21 @@ msgstr "" #: ../../howto/annotations.rst:123 msgid "" "After running this code, ``ann`` should be either a dictionary or ``None``. " -"You're encouraged to double-check the type of ``ann`` " -"using :func:`isinstance` before further examination." +"You're encouraged to double-check the type of ``ann`` using :func:" +"`isinstance` before further examination." msgstr "" "運行此程式碼後,``ann`` 應該是字典或 ``None``。我們鼓勵你在進一步檢查之前使" "用 :func:`isinstance` 仔細檢查 ``ann`` 的型別。" #: ../../howto/annotations.rst:128 msgid "" -"Note that some exotic or malformed type objects may not have " -"a :attr:`~type.__dict__` attribute, so for extra safety you may also wish to " -"use :func:`getattr` to access :attr:`!__dict__`." +"Note that some exotic or malformed type objects may not have a :attr:`~type." +"__dict__` attribute, so for extra safety you may also wish to use :func:" +"`getattr` to access :attr:`!__dict__`." msgstr "" -"請注意,某些外來 (exotic) 或格式錯誤 (malform) 的型別物件可能沒" -"有 :attr:`~type.__dict__` 屬性,因此為了額外的安全,你可能還希望使" -"用 :func:`getattr` 來存取 :attr:`!__dict__`。" +"請注意,某些外來 (exotic) 或格式錯誤 (malform) 的型別物件可能沒有 :attr:" +"`~type.__dict__` 屬性,因此為了額外的安全,你可能還希望使用 :func:`getattr` " +"來存取 :attr:`!__dict__`。" #: ../../howto/annotations.rst:134 msgid "Manually Un-Stringizing Stringized Annotations" @@ -266,15 +265,14 @@ msgstr "" #: ../../howto/annotations.rst:142 msgid "" -"If you're using Python 3.9 or older, or if for some reason you can't " -"use :func:`inspect.get_annotations`, you'll need to duplicate its logic. " -"You're encouraged to examine the implementation " -"of :func:`inspect.get_annotations` in the current Python version and follow " -"a similar approach." +"If you're using Python 3.9 or older, or if for some reason you can't use :" +"func:`inspect.get_annotations`, you'll need to duplicate its logic. You're " +"encouraged to examine the implementation of :func:`inspect.get_annotations` " +"in the current Python version and follow a similar approach." msgstr "" -"如果你使用的是 Python 3.9 或更早版本,或者由於某種原因你無法使" -"用 :func:`inspect.get_annotations`,則需要複製其邏輯。我們鼓勵你檢查目前 " -"Python 版本中 :func:`inspect.get_annotations` 的實作並遵循類似的方法。" +"如果你使用的是 Python 3.9 或更早版本,或者由於某種原因你無法使用 :func:" +"`inspect.get_annotations`,則需要複製其邏輯。我們鼓勵你檢查目前 Python 版本" +"中 :func:`inspect.get_annotations` 的實作並遵循類似的方法。" #: ../../howto/annotations.rst:148 msgid "" @@ -284,8 +282,8 @@ msgstr "簡而言之,如果你希望評估任意物件 ``o`` 上的字串化 #: ../../howto/annotations.rst:151 msgid "" -"If ``o`` is a module, use ``o.__dict__`` as the ``globals`` when " -"calling :func:`eval`." +"If ``o`` is a module, use ``o.__dict__`` as the ``globals`` when calling :" +"func:`eval`." msgstr "" "如果 ``o`` 是一個模組,則在呼叫 :func:`eval` 時使用 ``o.__dict__`` 作為\\ ``" "全域變數``。" @@ -293,32 +291,31 @@ msgstr "" #: ../../howto/annotations.rst:153 msgid "" "If ``o`` is a class, use ``sys.modules[o.__module__].__dict__`` as the " -"``globals``, and ``dict(vars(o))`` as the ``locals``, when " -"calling :func:`eval`." +"``globals``, and ``dict(vars(o))`` as the ``locals``, when calling :func:" +"`eval`." msgstr "" -"如果 ``o`` 是一個類別,當呼叫 :func:`eval` 時,則使用 " -"``sys.modules[o.__module__].__dict__`` 作為\\ ``全域變數``,使用 " -"``dict(vars(o))`` 作為\\ ``區域變數``。" +"如果 ``o`` 是一個類別,當呼叫 :func:`eval` 時,則使用 ``sys.modules[o." +"__module__].__dict__`` 作為\\ ``全域變數``,使用 ``dict(vars(o))`` 作為\\ ``" +"區域變數``。" #: ../../howto/annotations.rst:156 msgid "" -"If ``o`` is a wrapped callable " -"using :func:`functools.update_wrapper`, :func:`functools.wraps`, " -"or :func:`functools.partial`, iteratively unwrap it by accessing either " -"``o.__wrapped__`` or ``o.func`` as appropriate, until you have found the " -"root unwrapped function." +"If ``o`` is a wrapped callable using :func:`functools.update_wrapper`, :func:" +"`functools.wraps`, or :func:`functools.partial`, iteratively unwrap it by " +"accessing either ``o.__wrapped__`` or ``o.func`` as appropriate, until you " +"have found the root unwrapped function." msgstr "" "如果 ``o`` 是使用 :func:`functools.update_wrapper`、:func:`functools.wraps` " -"或 :func:`functools.partial` 包裝的 callable ,請依據需求,透過存取 " -"``o.__wrapped__`` 或 ``o.func`` 來疊代解開它,直到找到根解包函式。" +"或 :func:`functools.partial` 包裝的 callable ,請依據需求,透過存取 ``o." +"__wrapped__`` 或 ``o.func`` 來疊代解開它,直到找到根解包函式。" #: ../../howto/annotations.rst:160 msgid "" -"If ``o`` is a callable (but not a class), use :attr:`o.__globals__ " -"` as the globals when calling :func:`eval`." +"If ``o`` is a callable (but not a class), use :attr:`o.__globals__ ` as the globals when calling :func:`eval`." msgstr "" -"如果 ``o`` 是 callable(但不是類別),則在呼叫 :func:`eval` 時使" -"用 :attr:`o.__globals__ ` 作為全域變數。" +"如果 ``o`` 是 callable(但不是類別),則在呼叫 :func:`eval` 時使用 :attr:`o." +"__globals__ ` 作為全域變數。" #: ../../howto/annotations.rst:164 msgid "" @@ -341,8 +338,8 @@ msgstr "" #: ../../howto/annotations.rst:173 msgid "" -"Definitions that aren't needed at runtime, only imported " -"when :const:`typing.TYPE_CHECKING` is true." +"Definitions that aren't needed at runtime, only imported when :const:`typing." +"TYPE_CHECKING` is true." msgstr "" "Runtime 中不需要的定義,僅在 :const:`typing.TYPE_CHECKING` 為 true 時匯入。" @@ -379,8 +376,8 @@ msgstr "" #: ../../howto/annotations.rst:192 msgid "" "You should avoid accessing ``__annotations__`` directly on any object. " -"Instead, use :func:`annotationlib.get_annotations` (Python 3.14+) " -"or :func:`inspect.get_annotations` (Python 3.10+)." +"Instead, use :func:`annotationlib.get_annotations` (Python 3.14+) or :func:" +"`inspect.get_annotations` (Python 3.10+)." msgstr "" #: ../../howto/annotations.rst:196 @@ -389,7 +386,8 @@ msgid "" "should ensure that it's a dictionary before attempting to examine its " "contents." msgstr "" -"如果直接存取物件的 ``__annotations__`` 成員,則應確保它是字典,然後再嘗試檢查其內容。" +"如果直接存取物件的 ``__annotations__`` 成員,則應確保它是字典,然後再嘗試檢查" +"其內容。" #: ../../howto/annotations.rst:200 msgid "You should avoid modifying ``__annotations__`` dicts." @@ -479,12 +477,11 @@ msgstr "" msgid "" "If you use a class with a custom metaclass and access ``__annotations__`` on " "the class, you may observe unexpected behavior; see :pep:`749 <749#pep749-" -"metaclasses>` for some examples. You can avoid these quirks by " -"using :func:`annotationlib.get_annotations` on Python 3.14+ " -"or :func:`inspect.get_annotations` on Python 3.10+. On earlier versions of " -"Python, you can avoid these bugs by accessing the annotations from the " -"class's :attr:`~type.__dict__` (for example, " -"``cls.__dict__.get('__annotations__', None)``)." +"metaclasses>` for some examples. You can avoid these quirks by using :func:" +"`annotationlib.get_annotations` on Python 3.14+ or :func:`inspect." +"get_annotations` on Python 3.10+. On earlier versions of Python, you can " +"avoid these bugs by accessing the annotations from the class's :attr:`~type." +"__dict__` (for example, ``cls.__dict__.get('__annotations__', None)``)." msgstr "" #: ../../howto/annotations.rst:253 @@ -492,6 +489,6 @@ msgid "" "In some versions of Python, instances of classes may have an " "``__annotations__`` attribute. However, this is not supported functionality. " "If you need the annotations of an instance, you can use :func:`type` to " -"access its class (for example, " -"``annotationlib.get_annotations(type(myinstance))`` on Python 3.14+)." +"access its class (for example, ``annotationlib." +"get_annotations(type(myinstance))`` on Python 3.14+)." msgstr "" diff --git a/howto/curses.po b/howto/curses.po index 5d6fd88051..38eb0c2a5e 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-11 00:15+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,7 +37,7 @@ msgstr "發佈版本" msgid "2.04" msgstr "2.04" -#: ../../howto/curses.rst:-1 +#: ../../howto/curses.rst:13 msgid "Abstract" msgstr "摘要" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index c6fc1ac7bb..29659813c8 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-19 00:13+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2024-07-20 16:09+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgstr "Peter Moody" msgid "Nick Coghlan" msgstr "Nick Coghlan" -#: ../../howto/ipaddress.rst:-1 +#: ../../howto/ipaddress.rst:14 msgid "Overview" msgstr "總攬" @@ -145,8 +145,8 @@ msgstr "定義網路" #: ../../howto/ipaddress.rst:84 msgid "" -"Host addresses are usually grouped together into IP networks, " -"so :mod:`ipaddress` provides a way to create, inspect and manipulate network " +"Host addresses are usually grouped together into IP networks, so :mod:" +"`ipaddress` provides a way to create, inspect and manipulate network " "definitions. IP network objects are constructed from strings that define the " "range of host addresses that are part of that network. The simplest form for " "that information is a \"network address/network prefix\" pair, where the " @@ -242,11 +242,11 @@ msgid "" "network, neither the address nor the network classes are sufficient. " "Notation like ``192.0.2.1/24`` is commonly used by network engineers and the " "people who write tools for firewalls and routers as shorthand for \"the host " -"``192.0.2.1`` on the network ``192.0.2.0/24``\", " -"Accordingly, :mod:`ipaddress` provides a set of hybrid classes that " -"associate an address with a particular network. The interface for creation " -"is identical to that for defining network objects, except that the address " -"portion isn't constrained to being a network address." +"``192.0.2.1`` on the network ``192.0.2.0/24``\", Accordingly, :mod:" +"`ipaddress` provides a set of hybrid classes that associate an address with " +"a particular network. The interface for creation is identical to that for " +"defining network objects, except that the address portion isn't constrained " +"to being a network address." msgstr "" #: ../../howto/ipaddress.rst:152 @@ -262,8 +262,8 @@ msgstr "檢視 Address/Network/Interface 物件" #: ../../howto/ipaddress.rst:159 msgid "" "You've gone to the trouble of creating an IPv(4|6)(Address|Network|" -"Interface) object, so you probably want to get information about " -"it. :mod:`ipaddress` tries to make doing this easy and intuitive." +"Interface) object, so you probably want to get information about it. :mod:" +"`ipaddress` tries to make doing this easy and intuitive." msgstr "" #: ../../howto/ipaddress.rst:163 @@ -522,9 +522,9 @@ msgstr "" #: ../../howto/ipaddress.rst:305 msgid "" "To support use cases where it is useful to have access to this additional " -"detail, the individual class constructors actually raise " -"the :exc:`ValueError` subclasses :exc:`ipaddress.AddressValueError` " -"and :exc:`ipaddress.NetmaskValueError` to indicate exactly which part of the " +"detail, the individual class constructors actually raise the :exc:" +"`ValueError` subclasses :exc:`ipaddress.AddressValueError` and :exc:" +"`ipaddress.NetmaskValueError` to indicate exactly which part of the " "definition failed to parse correctly." msgstr "" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 5df3d9a12a..2c5f99df61 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-20 00:14+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -21,7 +21,7 @@ msgstr "" msgid "Isolating Extension Modules" msgstr "隔離擴充模組" -#: ../../howto/isolating-extensions.rst:-1 +#: ../../howto/isolating-extensions.rst:9 msgid "Abstract" msgstr "摘要" diff --git a/howto/regex.po b/howto/regex.po index 2cca8be49d..02a25aaf4d 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,7 +31,7 @@ msgstr "作者" msgid "A.M. Kuchling " msgstr "A.M. Kuchling " -#: ../../howto/regex.rst:-1 +#: ../../howto/regex.rst:16 msgid "Abstract" msgstr "摘要" @@ -120,12 +120,12 @@ msgstr "" #: ../../howto/regex.rst:70 msgid "" -"There are exceptions to this rule; some characters are " -"special :dfn:`metacharacters`, and don't match themselves. Instead, they " -"signal that some out-of-the-ordinary thing should be matched, or they affect " -"other portions of the RE by repeating them or changing their meaning. Much " -"of this document is devoted to discussing various metacharacters and what " -"they do." +"There are exceptions to this rule; some characters are special :dfn:" +"`metacharacters`, and don't match themselves. Instead, they signal that " +"some out-of-the-ordinary thing should be matched, or they affect other " +"portions of the RE by repeating them or changing their meaning. Much of " +"this document is devoted to discussing various metacharacters and what they " +"do." msgstr "" #: ../../howto/regex.rst:76 @@ -160,12 +160,12 @@ msgstr "" #: ../../howto/regex.rst:97 msgid "" -"You can match the characters not listed within the class " -"by :dfn:`complementing` the set. This is indicated by including a ``'^'`` " -"as the first character of the class. For example, ``[^5]`` will match any " -"character except ``'5'``. If the caret appears elsewhere in a character " -"class, it does not have special meaning. For example: ``[5^]`` will match " -"either a ``'5'`` or a ``'^'``." +"You can match the characters not listed within the class by :dfn:" +"`complementing` the set. This is indicated by including a ``'^'`` as the " +"first character of the class. For example, ``[^5]`` will match any character " +"except ``'5'``. If the caret appears elsewhere in a character class, it " +"does not have special meaning. For example: ``[5^]`` will match either a " +"``'5'`` or a ``'^'``." msgstr "" #: ../../howto/regex.rst:103 @@ -190,10 +190,10 @@ msgid "" "Let's take an example: ``\\w`` matches any alphanumeric character. If the " "regex pattern is expressed in bytes, this is equivalent to the class ``[a-zA-" "Z0-9_]``. If the regex pattern is a string, ``\\w`` will match all the " -"characters marked as letters in the Unicode database provided by " -"the :mod:`unicodedata` module. You can use the more restricted definition " -"of ``\\w`` in a string pattern by supplying the :const:`re.ASCII` flag when " -"compiling the regular expression." +"characters marked as letters in the Unicode database provided by the :mod:" +"`unicodedata` module. You can use the more restricted definition of ``\\w`` " +"in a string pattern by supplying the :const:`re.ASCII` flag when compiling " +"the regular expression." msgstr "" #: ../../howto/regex.rst:123 @@ -272,9 +272,9 @@ msgstr "" #: ../../howto/regex.rst:156 msgid "" "The final metacharacter in this section is ``.``. It matches anything " -"except a newline character, and there's an alternate mode " -"(:const:`re.DOTALL`) where it will match even a newline. ``.`` is often " -"used where you want to match \"any character\"." +"except a newline character, and there's an alternate mode (:const:`re." +"DOTALL`) where it will match even a newline. ``.`` is often used where you " +"want to match \"any character\"." msgstr "" #: ../../howto/regex.rst:163 @@ -524,8 +524,8 @@ msgid "" "and no special syntax was created for expressing them. (There are " "applications that don't need REs at all, so there's no need to bloat the " "language specification by including them.) Instead, the :mod:`re` module is " -"simply a C extension module included with Python, just like " -"the :mod:`socket` or :mod:`zlib` modules." +"simply a C extension module included with Python, just like the :mod:" +"`socket` or :mod:`zlib` modules." msgstr "" #: ../../howto/regex.rst:292 @@ -612,10 +612,10 @@ msgstr "" #: ../../howto/regex.rst:336 msgid "" "In addition, special escape sequences that are valid in regular expressions, " -"but not valid as Python string literals, now result in " -"a :exc:`DeprecationWarning` and will eventually become a :exc:`SyntaxError`, " -"which means the sequences will be invalid if raw string notation or escaping " -"the backslashes isn't used." +"but not valid as Python string literals, now result in a :exc:" +"`DeprecationWarning` and will eventually become a :exc:`SyntaxError`, which " +"means the sequences will be invalid if raw string notation or escaping the " +"backslashes isn't used." msgstr "" #: ../../howto/regex.rst:344 @@ -698,8 +698,8 @@ msgstr "``finditer()``" #: ../../howto/regex.rst:374 msgid "" -"Find all substrings where the RE matches, and returns them as " -"an :term:`iterator`." +"Find all substrings where the RE matches, and returns them as an :term:" +"`iterator`." msgstr "" #: ../../howto/regex.rst:378 @@ -831,11 +831,11 @@ msgstr "" #: ../../howto/regex.rst:438 msgid "" -":meth:`~re.Match.group` returns the substring that was matched by the " -"RE. :meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting " -"and ending index of the match. :meth:`~re.Match.span` returns both start and " -"end indexes in a single tuple. Since the :meth:`~re.Pattern.match` method " -"only checks if the RE matches at the start of a string, :meth:`!start` will " +":meth:`~re.Match.group` returns the substring that was matched by the RE. :" +"meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting and " +"ending index of the match. :meth:`~re.Match.span` returns both start and end " +"indexes in a single tuple. Since the :meth:`~re.Pattern.match` method only " +"checks if the RE matches at the start of a string, :meth:`!start` will " "always be zero. However, the :meth:`~re.Pattern.search` method of patterns " "scans through the string, so the match may not start at zero in that " "case. ::" @@ -886,8 +886,8 @@ msgstr "" #: ../../howto/regex.rst:466 msgid "" -"Two pattern methods return all of the matches for a " -"pattern. :meth:`~re.Pattern.findall` returns a list of matching strings::" +"Two pattern methods return all of the matches for a pattern. :meth:`~re." +"Pattern.findall` returns a list of matching strings::" msgstr "" #: ../../howto/regex.rst:469 @@ -905,16 +905,16 @@ msgid "" "The ``r`` prefix, making the literal a raw string literal, is needed in this " "example because escape sequences in a normal \"cooked\" string literal that " "are not recognized by Python, as opposed to regular expressions, now result " -"in a :exc:`DeprecationWarning` and will eventually become " -"a :exc:`SyntaxError`. See :ref:`the-backslash-plague`." +"in a :exc:`DeprecationWarning` and will eventually become a :exc:" +"`SyntaxError`. See :ref:`the-backslash-plague`." msgstr "" #: ../../howto/regex.rst:479 msgid "" ":meth:`~re.Pattern.findall` has to create the entire list before it can be " "returned as the result. The :meth:`~re.Pattern.finditer` method returns a " -"sequence of :ref:`match object ` instances as " -"an :term:`iterator`::" +"sequence of :ref:`match object ` instances as an :term:" +"`iterator`::" msgstr "" #: ../../howto/regex.rst:483 @@ -945,12 +945,12 @@ msgstr "模組層級函式" #: ../../howto/regex.rst:497 msgid "" -"You don't have to create a pattern object and call its methods; " -"the :mod:`re` module also provides top-level functions " -"called :func:`~re.match`, :func:`~re.search`, :func:`~re.findall`, :func:`~re.sub`, " -"and so forth. These functions take the same arguments as the corresponding " -"pattern method with the RE string added as the first argument, and still " -"return either ``None`` or a :ref:`match object ` instance. ::" +"You don't have to create a pattern object and call its methods; the :mod:" +"`re` module also provides top-level functions called :func:`~re.match`, :" +"func:`~re.search`, :func:`~re.findall`, :func:`~re.sub`, and so forth. " +"These functions take the same arguments as the corresponding pattern method " +"with the RE string added as the first argument, and still return either " +"``None`` or a :ref:`match object ` instance. ::" msgstr "" #: ../../howto/regex.rst:504 @@ -989,12 +989,12 @@ msgstr "" msgid "" "Compilation flags let you modify some aspects of how regular expressions " "work. Flags are available in the :mod:`re` module under two names, a long " -"name such as :const:`IGNORECASE` and a short, one-letter form such " -"as :const:`I`. (If you're familiar with Perl's pattern modifiers, the one-" -"letter forms use the same letters; the short form of :const:`re.VERBOSE` " -"is :const:`re.X`, for example.) Multiple flags can be specified by bitwise " -"OR-ing them; ``re.I | re.M`` sets both the :const:`I` and :const:`M` flags, " -"for example." +"name such as :const:`IGNORECASE` and a short, one-letter form such as :const:" +"`I`. (If you're familiar with Perl's pattern modifiers, the one-letter " +"forms use the same letters; the short form of :const:`re.VERBOSE` is :const:" +"`re.X`, for example.) Multiple flags can be specified by bitwise OR-ing " +"them; ``re.I | re.M`` sets both the :const:`I` and :const:`M` flags, for " +"example." msgstr "" #: ../../howto/regex.rst:534 @@ -1069,13 +1069,13 @@ msgid "" "letters, too. Full Unicode matching also works unless the :const:`ASCII` " "flag is used to disable non-ASCII matches. When the Unicode patterns ``[a-" "z]`` or ``[A-Z]`` are used in combination with the :const:`IGNORECASE` flag, " -"they will match the 52 ASCII letters and 4 additional non-ASCII letters: 'İ' " -"(U+0130, Latin capital letter I with dot above), 'ı' (U+0131, Latin small " -"letter dotless i), 'ſ' (U+017F, Latin small letter long s) and 'K' (U+212A, " -"Kelvin sign). ``Spam`` will match ``'Spam'``, ``'spam'``, ``'spAM'``, or " -"``'ſpam'`` (the latter is matched only in Unicode mode). This lowercasing " -"doesn't take the current locale into account; it will if you also set " -"the :const:`LOCALE` flag." +"they will match the 52 ASCII letters and 4 additional non-ASCII letters: " +"'İ' (U+0130, Latin capital letter I with dot above), 'ı' (U+0131, Latin " +"small letter dotless i), 'ſ' (U+017F, Latin small letter long s) and " +"'K' (U+212A, Kelvin sign). ``Spam`` will match ``'Spam'``, ``'spam'``, " +"``'spAM'``, or ``'ſpam'`` (the latter is matched only in Unicode mode). This " +"lowercasing doesn't take the current locale into account; it will if you " +"also set the :const:`LOCALE` flag." msgstr "" #: ../../howto/regex.rst:581 @@ -1245,9 +1245,9 @@ msgstr "``^``" #: ../../howto/regex.rst:707 msgid "" "Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has " -"been set, this will only match at the beginning of the string. " -"In :const:`MULTILINE` mode, this also matches immediately after each newline " -"within the string." +"been set, this will only match at the beginning of the string. In :const:" +"`MULTILINE` mode, this also matches immediately after each newline within " +"the string." msgstr "" #: ../../howto/regex.rst:711 @@ -1467,12 +1467,12 @@ msgstr "" msgid "" "Groups indicated with ``'('``, ``')'`` also capture the starting and ending " "index of the text that they match; this can be retrieved by passing an " -"argument " -"to :meth:`~re.Match.group`, :meth:`~re.Match.start`, :meth:`~re.Match.end`, " -"and :meth:`~re.Match.span`. Groups are numbered starting with 0. Group 0 " -"is always present; it's the whole RE, so :ref:`match object ` " -"methods all have group 0 as their default argument. Later we'll see how to " -"express groups that don't capture the span of text that they match. ::" +"argument to :meth:`~re.Match.group`, :meth:`~re.Match.start`, :meth:`~re." +"Match.end`, and :meth:`~re.Match.span`. Groups are numbered starting with " +"0. Group 0 is always present; it's the whole RE, so :ref:`match object " +"` methods all have group 0 as their default argument. Later " +"we'll see how to express groups that don't capture the span of text that " +"they match. ::" msgstr "" #: ../../howto/regex.rst:827 @@ -1701,8 +1701,8 @@ msgstr "" #: ../../howto/regex.rst:949 msgid "" -"Additionally, you can retrieve named groups as a dictionary " -"with :meth:`~re.Match.groupdict`::" +"Additionally, you can retrieve named groups as a dictionary with :meth:`~re." +"Match.groupdict`::" msgstr "" #: ../../howto/regex.rst:952 @@ -1718,8 +1718,8 @@ msgstr "" #: ../../howto/regex.rst:956 msgid "" "Named groups are handy because they let you use easily remembered names, " -"instead of having to remember numbers. Here's an example RE from " -"the :mod:`imaplib` module::" +"instead of having to remember numbers. Here's an example RE from the :mod:" +"`imaplib` module::" msgstr "" #: ../../howto/regex.rst:960 @@ -1751,8 +1751,8 @@ msgid "" "name instead of the number. This is another Python extension: ``(?P=name)`` " "indicates that the contents of the group called *name* should again be " "matched at the current point. The regular expression for finding doubled " -"words, ``\\b(\\w+)\\s+\\1\\b`` can also be written as ``\\b(?P\\w+)\\s+" -"(?P=word)\\b``::" +"words, ``\\b(\\w+)\\s+\\1\\b`` can also be written as ``\\b(?" +"P\\w+)\\s+(?P=word)\\b``::" msgstr "" #: ../../howto/regex.rst:977 @@ -1852,10 +1852,10 @@ msgid "" "The expression gets messier when you try to patch up the first solution by " "requiring one of the following cases to match: the first character of the " "extension isn't ``b``; the second character isn't ``a``; or the third " -"character isn't ``t``. This accepts ``foo.bar`` and rejects " -"``autoexec.bat``, but it requires a three-letter extension and won't accept " -"a filename with a two-letter extension such as ``sendmail.cf``. We'll " -"complicate the pattern again in an effort to fix it." +"character isn't ``t``. This accepts ``foo.bar`` and rejects ``autoexec." +"bat``, but it requires a three-letter extension and won't accept a filename " +"with a two-letter extension such as ``sendmail.cf``. We'll complicate the " +"pattern again in an effort to fix it." msgstr "" #: ../../howto/regex.rst:1035 @@ -2232,13 +2232,13 @@ msgstr "" #: ../../howto/regex.rst:1250 msgid "" "Sometimes using the :mod:`re` module is a mistake. If you're matching a " -"fixed string, or a single character class, and you're not using " -"any :mod:`re` features such as the :const:`~re.IGNORECASE` flag, then the " -"full power of regular expressions may not be required. Strings have several " -"methods for performing operations with fixed strings and they're usually " -"much faster, because the implementation is a single small C loop that's been " -"optimized for the purpose, instead of the large, more generalized regular " -"expression engine." +"fixed string, or a single character class, and you're not using any :mod:" +"`re` features such as the :const:`~re.IGNORECASE` flag, then the full power " +"of regular expressions may not be required. Strings have several methods for " +"performing operations with fixed strings and they're usually much faster, " +"because the implementation is a single small C loop that's been optimized " +"for the purpose, instead of the large, more generalized regular expression " +"engine." msgstr "" #: ../../howto/regex.rst:1258 @@ -2250,8 +2250,8 @@ msgid "" "turning ``swordfish`` into ``sdeedfish``, but the naive RE ``word`` would " "have done that, too. (To avoid performing the substitution on parts of " "words, the pattern would have to be ``\\bword\\b``, in order to require that " -"``word`` have a word boundary on either side. This takes the job " -"beyond :meth:`!replace`'s abilities.)" +"``word`` have a word boundary on either side. This takes the job beyond :" +"meth:`!replace`'s abilities.)" msgstr "" #: ../../howto/regex.rst:1267 @@ -2315,15 +2315,14 @@ msgstr "" #: ../../howto/regex.rst:1299 msgid "" -"Sometimes you'll be tempted to keep using :func:`re.match`, and just add " -"``.*`` to the front of your RE. Resist this temptation and " -"use :func:`re.search` instead. The regular expression compiler does some " -"analysis of REs in order to speed up the process of looking for a match. " -"One such analysis figures out what the first character of a match must be; " -"for example, a pattern starting with ``Crow`` must match starting with a " -"``'C'``. The analysis lets the engine quickly scan through the string " -"looking for the starting character, only trying the full match if a ``'C'`` " -"is found." +"Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." +"*`` to the front of your RE. Resist this temptation and use :func:`re." +"search` instead. The regular expression compiler does some analysis of REs " +"in order to speed up the process of looking for a match. One such analysis " +"figures out what the first character of a match must be; for example, a " +"pattern starting with ``Crow`` must match starting with a ``'C'``. The " +"analysis lets the engine quickly scan through the string looking for the " +"starting character, only trying the full match if a ``'C'`` is found." msgstr "" #: ../../howto/regex.rst:1308 diff --git a/howto/sockets.po b/howto/sockets.po index 3c072f6315..db933f29e5 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2023-08-12 15:16+0800\n" "Last-Translator: Jay \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,7 @@ msgstr "作者" msgid "Gordon McMillan" msgstr "Gordon McMillan" -#: ../../howto/sockets.rst:-1 +#: ../../howto/sockets.rst:10 msgid "Abstract" msgstr "摘要" @@ -165,16 +165,16 @@ msgstr "" #: ../../howto/sockets.rst:80 msgid "" "A couple things to notice: we used ``socket.gethostname()`` so that the " -"socket would be visible to the outside world. If we had used " -"``s.bind(('localhost', 80))`` or ``s.bind(('127.0.0.1', 80))`` we would " -"still have a \"server\" socket, but one that was only visible within the " -"same machine. ``s.bind(('', 80))`` specifies that the socket is reachable " -"by any address the machine happens to have." +"socket would be visible to the outside world. If we had used ``s." +"bind(('localhost', 80))`` or ``s.bind(('127.0.0.1', 80))`` we would still " +"have a \"server\" socket, but one that was only visible within the same " +"machine. ``s.bind(('', 80))`` specifies that the socket is reachable by any " +"address the machine happens to have." msgstr "" "有幾件事需要注意:我們使用了 ``socket.gethostname()``,這樣 socket 才能對外部" -"網路可見。如果我們使用了 ``s.bind(('localhost', 80))`` 或 " -"``s.bind(('127.0.0.1', 80))``,我們會得到一個「伺服器端」socket,但是只能在同" -"一台機器內可見。``s.bind(('', 80))`` 指定 socket 可以透過機器的任何地址存取。" +"網路可見。如果我們使用了 ``s.bind(('localhost', 80))`` 或 ``s." +"bind(('127.0.0.1', 80))``,我們會得到一個「伺服器端」socket,但是只能在同一台" +"機器內可見。``s.bind(('', 80))`` 指定 socket 可以透過機器的任何地址存取。" #: ../../howto/sockets.rst:87 msgid "" diff --git a/howto/urllib2.po b/howto/urllib2.po index 95508ddb22..b1346fa7a7 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-30 00:16+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,6 +35,10 @@ msgstr "`Michael Foord `_" msgid "Introduction" msgstr "簡介" +#: ../../howto/urllib2.rst:13 +msgid "Related Articles" +msgstr "" + #: ../../howto/urllib2.rst:15 msgid "" "You may also find useful the following article on fetching web resources " diff --git a/library/argparse.po b/library/argparse.po index a1d55a211f..7e5b91a125 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-30 00:16+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,7 +40,7 @@ msgid "" "another defined option)." msgstr "" -#: ../../library/argparse.rst:-1 +#: ../../library/argparse.rst:28 msgid "Tutorial" msgstr "教學" diff --git a/library/asyncio.po b/library/asyncio.po index 5018a3d160..79c9d8f5e1 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-07 00:14+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2025-07-06 17:13+0800\n" "Last-Translator: Weilin Du\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,7 +37,7 @@ msgstr "指南與教學" msgid ":mod:`!asyncio` --- Asynchronous I/O" msgstr ":mod:`!asyncio` --- 非同步 I/O" -#: ../../library/asyncio.rst:-1 +#: ../../library/asyncio.rst:9 msgid "Hello World!" msgstr "Hello World!" diff --git a/library/codecs.po b/library/codecs.po index 7acae8c1c1..f1d8d60966 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-19 00:16+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1328,15 +1328,15 @@ msgid "" "charmap encoded file starts with these byte values (which would e.g. map to" msgstr "" -#: ../../library/codecs.rst:0 +#: ../../library/codecs.rst:1049 msgid "LATIN SMALL LETTER I WITH DIAERESIS" msgstr "" -#: ../../library/codecs.rst:0 +#: ../../library/codecs.rst:1050 msgid "RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK" msgstr "" -#: ../../library/codecs.rst:0 +#: ../../library/codecs.rst:1051 msgid "INVERTED QUESTION MARK" msgstr "" diff --git a/library/datetime.po b/library/datetime.po index 6c59ba6af8..4a699151dc 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -80,9 +80,9 @@ msgstr ":pypi:`DateType` 套件" #: ../../library/datetime.rst:41 msgid "" -"Third-party library that introduces distinct static types to e.g. " -"allow :term:`static type checkers ` to differentiate " -"between naive and aware datetimes." +"Third-party library that introduces distinct static types to e.g. allow :" +"term:`static type checkers ` to differentiate between " +"naive and aware datetimes." msgstr "" #: ../../library/datetime.rst:48 @@ -117,12 +117,12 @@ msgstr "" #: ../../library/datetime.rst:66 msgid "" -"For applications requiring aware objects, :class:`.datetime` " -"and :class:`.time` objects have an optional time zone information " -"attribute, :attr:`!tzinfo`, that can be set to an instance of a subclass of " -"the abstract :class:`tzinfo` class. These :class:`tzinfo` objects capture " -"information about the offset from UTC time, the time zone name, and whether " -"daylight saving time is in effect." +"For applications requiring aware objects, :class:`.datetime` and :class:`." +"time` objects have an optional time zone information attribute, :attr:`!" +"tzinfo`, that can be set to an instance of a subclass of the abstract :class:" +"`tzinfo` class. These :class:`tzinfo` objects capture information about the " +"offset from UTC time, the time zone name, and whether daylight saving time " +"is in effect." msgstr "" #: ../../library/datetime.rst:72 @@ -167,30 +167,29 @@ msgstr "" #: ../../library/datetime.rst:108 msgid "" "An idealized naive date, assuming the current Gregorian calendar always was, " -"and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, " -"and :attr:`day`." +"and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" +"attr:`day`." msgstr "" #: ../../library/datetime.rst:116 msgid "" "An idealized time, independent of any particular day, assuming that every " "day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap " -"seconds\" here.) " -"Attributes: :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:`microsecond`, " -"and :attr:`.tzinfo`." +"seconds\" here.) Attributes: :attr:`hour`, :attr:`minute`, :attr:`second`, :" +"attr:`microsecond`, and :attr:`.tzinfo`." msgstr "" #: ../../library/datetime.rst:125 msgid "" -"A combination of a date and a time. " -"Attributes: :attr:`year`, :attr:`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:`microsecond`, " -"and :attr:`.tzinfo`." +"A combination of a date and a time. Attributes: :attr:`year`, :attr:" +"`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" +"`microsecond`, and :attr:`.tzinfo`." msgstr "" #: ../../library/datetime.rst:133 msgid "" -"A duration expressing the difference between two :class:`.datetime` " -"or :class:`date` instances to microsecond resolution." +"A duration expressing the difference between two :class:`.datetime` or :" +"class:`date` instances to microsecond resolution." msgstr "" "表示兩個 :class:`.datetime` 或 :class:`date` 實例之間時間的差異,以微秒為解析" "度。" @@ -402,8 +401,8 @@ msgstr "" #: ../../library/datetime.rst:253 msgid "" -"If the normalized value of days lies outside the indicated " -"range, :exc:`OverflowError` is raised." +"If the normalized value of days lies outside the indicated range, :exc:" +"`OverflowError` is raised." msgstr "" #: ../../library/datetime.rst:256 @@ -479,8 +478,8 @@ msgstr "" #: ../../library/datetime.rst:299 msgid "" "Note that, because of normalization, ``timedelta.max`` is greater than ``-" -"timedelta.min``. ``-timedelta.max`` is not representable as " -"a :class:`timedelta` object." +"timedelta.min``. ``-timedelta.max`` is not representable as a :class:" +"`timedelta` object." msgstr "" #: ../../library/datetime.rst:303 ../../library/datetime.rst:633 @@ -588,8 +587,8 @@ msgstr "``f = t2 / t3``" #: ../../library/datetime.rst:360 msgid "" -"Division (3) of overall duration ``t2`` by interval unit ``t3``. Returns " -"a :class:`float` object." +"Division (3) of overall duration ``t2`` by interval unit ``t3``. Returns a :" +"class:`float` object." msgstr "" #: ../../library/datetime.rst:364 @@ -730,16 +729,16 @@ msgstr "" #: ../../library/datetime.rst:429 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " -"support certain additions and subtractions with :class:`date` " -"and :class:`.datetime` objects (see below)." +"support certain additions and subtractions with :class:`date` and :class:`." +"datetime` objects (see below)." msgstr "" #: ../../library/datetime.rst:433 msgid "" -"Floor division and true division of a :class:`timedelta` object by " -"another :class:`timedelta` object are now supported, as are remainder " -"operations and the :func:`divmod` function. True division and multiplication " -"of a :class:`timedelta` object by a :class:`float` object are now supported." +"Floor division and true division of a :class:`timedelta` object by another :" +"class:`timedelta` object are now supported, as are remainder operations and " +"the :func:`divmod` function. True division and multiplication of a :class:" +"`timedelta` object by a :class:`float` object are now supported." msgstr "" #: ../../library/datetime.rst:439 @@ -886,19 +885,19 @@ msgstr "" #: ../../library/datetime.rst:525 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " -"values supported by the platform C :c:func:`localtime` function, " -"and :exc:`OSError` on :c:func:`localtime` failure. It's common for this to " -"be restricted to years from 1970 through 2038. Note that on non-POSIX " -"systems that include leap seconds in their notion of a timestamp, leap " -"seconds are ignored by :meth:`fromtimestamp`." +"values supported by the platform C :c:func:`localtime` function, and :exc:" +"`OSError` on :c:func:`localtime` failure. It's common for this to be " +"restricted to years from 1970 through 2038. Note that on non-POSIX systems " +"that include leap seconds in their notion of a timestamp, leap seconds are " +"ignored by :meth:`fromtimestamp`." msgstr "" #: ../../library/datetime.rst:532 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " -"function. Raise :exc:`OSError` instead of :exc:`ValueError` " -"on :c:func:`localtime` failure." +"function. Raise :exc:`OSError` instead of :exc:`ValueError` on :c:func:" +"`localtime` failure." msgstr "" #: ../../library/datetime.rst:541 @@ -964,8 +963,8 @@ msgstr "" #: ../../library/datetime.rst:576 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " -"year, week and day. This is the inverse of the " -"function :meth:`date.isocalendar`." +"year, week and day. This is the inverse of the function :meth:`date." +"isocalendar`." msgstr "" #: ../../library/datetime.rst:583 @@ -987,13 +986,13 @@ msgstr "" #: ../../library/datetime.rst:595 msgid "" -"If *format* specifies a day of month without a year " -"a :exc:`DeprecationWarning` is emitted. This is to avoid a quadrennial leap " -"year bug in code seeking to parse only a month and day as the default year " -"used in absence of one in the format is not a leap year. Such *format* " -"values may raise an error as of Python 3.15. The workaround is to always " -"include a year in your *format*. If parsing *date_string* values that do " -"not have a year, explicitly add a year that is a leap year before parsing:" +"If *format* specifies a day of month without a year a :exc:" +"`DeprecationWarning` is emitted. This is to avoid a quadrennial leap year " +"bug in code seeking to parse only a month and day as the default year used " +"in absence of one in the format is not a leap year. Such *format* values may " +"raise an error as of Python 3.15. The workaround is to always include a " +"year in your *format*. If parsing *date_string* values that do not have a " +"year, explicitly add a year that is a leap year before parsing:" msgstr "" #: ../../library/datetime.rst:604 @@ -1007,8 +1006,8 @@ msgid "" msgstr "" ">>> from datetime import date\n" ">>> date_string = \"02/29\"\n" -">>> when = date.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # 避免" -"閏年錯誤。\n" +">>> when = date.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # 避免閏年錯" +"誤。\n" ">>> when.strftime(\"%B %d\")\n" "'February 29'" @@ -1062,11 +1061,11 @@ msgstr "``timedelta = date1 - date2``" msgid "\\(3)" msgstr "\\(3)" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:663 msgid "``date1 == date2``" msgstr "``date1 == date2``" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:664 msgid "``date1 != date2``" msgstr "``date1 != date2``" @@ -1074,19 +1073,19 @@ msgstr "``date1 != date2``" msgid "Equality comparison. (4)" msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:666 msgid "``date1 < date2``" msgstr "``date1 < date2``" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:667 msgid "``date1 > date2``" msgstr "``date1 > date2``" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:668 msgid "``date1 <= date2``" msgstr "``date1 <= date2``" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:669 msgid "``date1 >= date2``" msgstr "``date1 >= date2``" @@ -1098,9 +1097,9 @@ msgstr "" msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " -"``timedelta.seconds`` and ``timedelta.microseconds`` are " -"ignored. :exc:`OverflowError` is raised if ``date2.year`` would be smaller " -"than :const:`MINYEAR` or larger than :const:`MAXYEAR`." +"``timedelta.seconds`` and ``timedelta.microseconds`` are ignored. :exc:" +"`OverflowError` is raised if ``date2.year`` would be smaller than :const:" +"`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" #: ../../library/datetime.rst:682 @@ -1109,8 +1108,8 @@ msgstr "``timedelta.seconds`` 和 ``timedelta.microseconds`` 被忽略。" #: ../../library/datetime.rst:685 msgid "" -"This is exact, and cannot overflow. ``timedelta.seconds`` and " -"``timedelta.microseconds`` are 0, and ``date2 + timedelta == date1`` after." +"This is exact, and cannot overflow. ``timedelta.seconds`` and ``timedelta." +"microseconds`` are 0, and ``date2 + timedelta == date1`` after." msgstr "" #: ../../library/datetime.rst:689 @@ -1133,18 +1132,17 @@ msgstr "" #: ../../library/datetime.rst:700 msgid "" -"Order comparison between a :class:`!date` object that is not also " -"a :class:`.datetime` instance and a :class:`!datetime` object " -"raises :exc:`TypeError`." +"Order comparison between a :class:`!date` object that is not also a :class:`." +"datetime` instance and a :class:`!datetime` object raises :exc:`TypeError`." msgstr "" #: ../../library/datetime.rst:704 ../../library/datetime.rst:1330 msgid "" -"Comparison between :class:`.datetime` object and an instance of " -"the :class:`date` subclass that is not a :class:`!datetime` subclass no " -"longer converts the latter to :class:`!date`, ignoring the time part and the " -"time zone. The default behavior can be changed by overriding the special " -"comparison methods in subclasses." +"Comparison between :class:`.datetime` object and an instance of the :class:" +"`date` subclass that is not a :class:`!datetime` subclass no longer converts " +"the latter to :class:`!date`, ignoring the time part and the time zone. The " +"default behavior can be changed by overriding the special comparison methods " +"in subclasses." msgstr "" #: ../../library/datetime.rst:712 @@ -1182,8 +1180,8 @@ msgstr "" #: ../../library/datetime.rst:734 ../../library/datetime.rst:1454 msgid "" -"Return a :class:`time.struct_time` such as returned " -"by :func:`time.localtime`." +"Return a :class:`time.struct_time` such as returned by :func:`time." +"localtime`." msgstr "" "回傳一個 :class:`time.struct_time`,如同 :func:`time.localtime` 所回傳。" @@ -1210,24 +1208,24 @@ msgstr "" #: ../../library/datetime.rst:748 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " -"1 has ordinal 1. For any :class:`date` object ``d``, " -"``date.fromordinal(d.toordinal()) == d``." +"1 has ordinal 1. For any :class:`date` object ``d``, ``date.fromordinal(d." +"toordinal()) == d``." msgstr "" #: ../../library/datetime.rst:755 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " -"For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See " -"also :meth:`isoweekday`." +"For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" +"meth:`isoweekday`." msgstr "" -"回傳一個代表星期幾的整數,星期一為 0、星期日為 6。例如 ``date(2002, 12, " -"4).weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" +"回傳一個代表星期幾的整數,星期一為 0、星期日為 6。例如 ``date(2002, 12, 4)." +"weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" #: ../../library/datetime.rst:762 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " -"For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See " -"also :meth:`weekday`, :meth:`isocalendar`." +"For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" +"meth:`weekday`, :meth:`isocalendar`." msgstr "" #: ../../library/datetime.rst:769 @@ -1317,17 +1315,17 @@ msgstr "time.ctime(time.mktime(d.timetuple()))" #: ../../library/datetime.rst:816 msgid "" -"on platforms where the native C :c:func:`ctime` function " -"(which :func:`time.ctime` invokes, but which :meth:`date.ctime` does not " -"invoke) conforms to the C standard." +"on platforms where the native C :c:func:`ctime` function (which :func:`time." +"ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " +"the C standard." msgstr "" #: ../../library/datetime.rst:823 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " -"values. See also :ref:`strftime-strptime-behavior` " -"and :meth:`date.isoformat`." +"values. See also :ref:`strftime-strptime-behavior` and :meth:`date." +"isoformat`." msgstr "" #: ../../library/datetime.rst:830 @@ -1524,15 +1522,14 @@ msgstr "" #: ../../library/datetime.rst:956 msgid "" -"If optional argument *tz* is ``None`` or not specified, this is " -"like :meth:`today`, but, if possible, supplies more precision than can be " -"gotten from going through a :func:`time.time` timestamp (for example, this " -"may be possible on platforms supplying the C :c:func:`gettimeofday` " -"function)." +"If optional argument *tz* is ``None`` or not specified, this is like :meth:" +"`today`, but, if possible, supplies more precision than can be gotten from " +"going through a :func:`time.time` timestamp (for example, this may be " +"possible on platforms supplying the C :c:func:`gettimeofday` function)." msgstr "" "如果選用的引數 *tz* 為 ``None`` 或未指定,則會像是 :meth:`today`,但盡可能提" -"供比透過 :func:`time.time` 取得的時間戳記更多位數的資訊(例如,這在有提供 " -"C :c:func:`gettimeofday` 函式的平台上可能可行)。" +"供比透過 :func:`time.time` 取得的時間戳記更多位數的資訊(例如,這在有提供 C :" +"c:func:`gettimeofday` 函式的平台上可能可行)。" #: ../../library/datetime.rst:962 msgid "" @@ -1591,21 +1588,21 @@ msgstr "" msgid "" ":meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " -"or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` " -"or :c:func:`gmtime` failure. It's common for this to be restricted to years " -"in 1970 through 2038. Note that on non-POSIX systems that include leap " -"seconds in their notion of a timestamp, leap seconds are ignored " -"by :meth:`fromtimestamp`, and then it's possible to have two timestamps " -"differing by a second that yield identical :class:`.datetime` objects. This " -"method is preferred over :meth:`utcfromtimestamp`." +"or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` or :" +"c:func:`gmtime` failure. It's common for this to be restricted to years in " +"1970 through 2038. Note that on non-POSIX systems that include leap seconds " +"in their notion of a timestamp, leap seconds are ignored by :meth:" +"`fromtimestamp`, and then it's possible to have two timestamps differing by " +"a second that yield identical :class:`.datetime` objects. This method is " +"preferred over :meth:`utcfromtimestamp`." msgstr "" #: ../../library/datetime.rst:1013 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " -"or :c:func:`gmtime` functions. Raise :exc:`OSError` instead " -"of :exc:`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." +"or :c:func:`gmtime` functions. Raise :exc:`OSError` instead of :exc:" +"`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." msgstr "" #: ../../library/datetime.rst:1020 @@ -1621,9 +1618,9 @@ msgstr "" #: ../../library/datetime.rst:1028 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " -"values supported by the platform C :c:func:`gmtime` function, " -"and :exc:`OSError` on :c:func:`gmtime` failure. It's common for this to be " -"restricted to years in 1970 through 2038." +"values supported by the platform C :c:func:`gmtime` function, and :exc:" +"`OSError` on :c:func:`gmtime` failure. It's common for this to be restricted " +"to years in 1970 through 2038." msgstr "" #: ../../library/datetime.rst:1033 @@ -1648,8 +1645,8 @@ msgstr "" #: ../../library/datetime.rst:1042 msgid "" -"except the latter formula always supports the full years range: " -"between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." +"except the latter formula always supports the full years range: between :" +"const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" #: ../../library/datetime.rst:1047 @@ -1665,8 +1662,8 @@ msgstr "" msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`gmtime` " -"function. Raise :exc:`OSError` instead of :exc:`ValueError` " -"on :c:func:`gmtime` failure." +"function. Raise :exc:`OSError` instead of :exc:`ValueError` on :c:func:" +"`gmtime` failure." msgstr "" #: ../../library/datetime.rst:1061 @@ -1689,14 +1686,14 @@ msgid "" "given :class:`.time` object's. If the *tzinfo* argument is provided, its " "value is used to set the :attr:`.tzinfo` attribute of the result, otherwise " "the :attr:`~.time.tzinfo` attribute of the *time* argument is used. If the " -"*date* argument is a :class:`.datetime` object, its time components " -"and :attr:`.tzinfo` attributes are ignored." +"*date* argument is a :class:`.datetime` object, its time components and :" +"attr:`.tzinfo` attributes are ignored." msgstr "" #: ../../library/datetime.rst:1082 msgid "" -"For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), " -"d.time(), d.tzinfo)``." +"For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), d." +"time(), d.tzinfo)``." msgstr "" #: ../../library/datetime.rst:1085 @@ -1739,8 +1736,8 @@ msgid "" ">>> datetime.fromisoformat('2011-11-04 00:05:23.283')\n" "datetime.datetime(2011, 11, 4, 0, 5, 23, 283000)\n" ">>> datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')\n" -"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, " -"tzinfo=datetime.timezone.utc)\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=datetime.timezone." +"utc)\n" ">>> datetime.fromisoformat('2011-11-04T00:05:23+04:00')\n" "datetime.datetime(2011, 11, 4, 0, 5, 23,\n" " tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" @@ -1761,24 +1758,24 @@ msgstr "" ">>> datetime.fromisoformat('2011-11-04 00:05:23.283')\n" "datetime.datetime(2011, 11, 4, 0, 5, 23, 283000)\n" ">>> datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')\n" -"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, " -"tzinfo=datetime.timezone.utc)\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=datetime.timezone." +"utc)\n" ">>> datetime.fromisoformat('2011-11-04T00:05:23+04:00')\n" "datetime.datetime(2011, 11, 4, 0, 5, 23,\n" " tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" #: ../../library/datetime.rst:1127 msgid "" -"Previously, this method only supported formats that could be emitted " -"by :meth:`date.isoformat` or :meth:`datetime.isoformat`." +"Previously, this method only supported formats that could be emitted by :" +"meth:`date.isoformat` or :meth:`datetime.isoformat`." msgstr "" #: ../../library/datetime.rst:1134 msgid "" "Return a :class:`.datetime` corresponding to the ISO calendar date specified " "by year, week and day. The non-date components of the datetime are populated " -"with their normal default values. This is the inverse of the " -"function :meth:`datetime.isocalendar`." +"with their normal default values. This is the inverse of the function :meth:" +"`datetime.isocalendar`." msgstr "" #: ../../library/datetime.rst:1143 @@ -1801,16 +1798,16 @@ msgstr "datetime(*(time.strptime(date_string, format)[0:6]))" msgid "" ":exc:`ValueError` is raised if the date_string and format can't be parsed " "by :func:`time.strptime` or if it returns a value which isn't a time tuple. " -"See also :ref:`strftime-strptime-behavior` " -"and :meth:`datetime.fromisoformat`." +"See also :ref:`strftime-strptime-behavior` and :meth:`datetime." +"fromisoformat`." msgstr "" #: ../../library/datetime.rst:1157 msgid "" -"If *format* specifies a day of month without a year " -"a :exc:`DeprecationWarning` is now emitted. This is to avoid a quadrennial " -"leap year bug in code seeking to parse only a month and day as the default " -"year used in absence of one in the format is not a leap year. Such *format* " +"If *format* specifies a day of month without a year a :exc:" +"`DeprecationWarning` is now emitted. This is to avoid a quadrennial leap " +"year bug in code seeking to parse only a month and day as the default year " +"used in absence of one in the format is not a leap year. Such *format* " "values may raise an error as of Python 3.15. The workaround is to always " "include a year in your *format*. If parsing *date_string* values that do " "not have a year, explicitly add a year that is a leap year before parsing:" @@ -1827,8 +1824,8 @@ msgid "" msgstr "" ">>> from datetime import datetime\n" ">>> date_string = \"02/29\"\n" -">>> when = datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # " -"避免閏年錯誤。\n" +">>> when = datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # 避免閏" +"年錯誤。\n" ">>> when.strftime(\"%B %d\")\n" "'February 29'" @@ -1902,39 +1899,39 @@ msgstr "\\(2)" msgid "``timedelta = datetime1 - datetime2``" msgstr "``timedelta = datetime1 - datetime2``" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:1259 msgid "``datetime1 == datetime2``" msgstr "``datetime1 == datetime2``" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:1260 msgid "``datetime1 != datetime2``" msgstr "``datetime1 != datetime2``" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:1262 msgid "``datetime1 < datetime2``" msgstr "``datetime1 < datetime2``" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:1263 msgid "``datetime1 > datetime2``" msgstr "``datetime1 > datetime2``" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:1264 msgid "``datetime1 <= datetime2``" msgstr "``datetime1 <= datetime2``" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:1265 msgid "``datetime1 >= datetime2``" msgstr "``datetime1 >= datetime2``" #: ../../library/datetime.rst:1269 msgid "" "``datetime2`` is a duration of ``timedelta`` removed from ``datetime1``, " -"moving forward in time if ``timedelta.days > 0``, or backward if " -"``timedelta.days < 0``. The result has the same :attr:`~.datetime.tzinfo` " -"attribute as the input datetime, and ``datetime2 - datetime1 == timedelta`` " -"after. :exc:`OverflowError` is raised if ``datetime2.year`` would be smaller " -"than :const:`MINYEAR` or larger than :const:`MAXYEAR`. Note that no time " -"zone adjustments are done even if the input is an aware object." +"moving forward in time if ``timedelta.days > 0``, or backward if ``timedelta." +"days < 0``. The result has the same :attr:`~.datetime.tzinfo` attribute as " +"the input datetime, and ``datetime2 - datetime1 == timedelta`` after. :exc:" +"`OverflowError` is raised if ``datetime2.year`` would be smaller than :const:" +"`MINYEAR` or larger than :const:`MAXYEAR`. Note that no time zone " +"adjustments are done even if the input is an aware object." msgstr "" #: ../../library/datetime.rst:1278 @@ -1954,20 +1951,19 @@ msgstr "" #: ../../library/datetime.rst:1287 msgid "" -"If both are naive, or both are aware and have the " -"same :attr:`~.datetime.tzinfo` attribute, the :attr:`~.datetime.tzinfo` " -"attributes are ignored, and the result is a :class:`timedelta` object ``t`` " -"such that ``datetime2 + t == datetime1``. No time zone adjustments are done " -"in this case." +"If both are naive, or both are aware and have the same :attr:`~.datetime." +"tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " +"the result is a :class:`timedelta` object ``t`` such that ``datetime2 + t == " +"datetime1``. No time zone adjustments are done in this case." msgstr "" #: ../../library/datetime.rst:1292 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if ``a`` and ``b`` were first converted to naive UTC " -"datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - " -"(b.replace(tzinfo=None) - b.utcoffset())`` except that the implementation " -"never overflows." +"datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b." +"replace(tzinfo=None) - b.utcoffset())`` except that the implementation never " +"overflows." msgstr "" #: ../../library/datetime.rst:1298 @@ -1999,8 +1995,8 @@ msgstr "" #: ../../library/datetime.rst:1316 msgid "" -"Order comparison between naive and aware :class:`.datetime` objects " -"raises :exc:`TypeError`." +"Order comparison between naive and aware :class:`.datetime` objects raises :" +"exc:`TypeError`." msgstr "" #: ../../library/datetime.rst:1319 @@ -2049,8 +2045,8 @@ msgstr "" #: ../../library/datetime.rst:1372 msgid "" -":class:`.datetime` objects are also supported by generic " -"function :func:`copy.replace`." +":class:`.datetime` objects are also supported by generic function :func:" +"`copy.replace`." msgstr "" #: ../../library/datetime.rst:1381 @@ -2087,17 +2083,17 @@ msgstr "" #: ../../library/datetime.rst:1400 msgid "" "If you merely want to attach a :class:`timezone` object *tz* to a datetime " -"*dt* without adjustment of date and time data, use " -"``dt.replace(tzinfo=tz)``. If you merely want to remove the :class:`!" -"timezone` object from an aware datetime *dt* without conversion of date and " -"time data, use ``dt.replace(tzinfo=None)``." +"*dt* without adjustment of date and time data, use ``dt." +"replace(tzinfo=tz)``. If you merely want to remove the :class:`!timezone` " +"object from an aware datetime *dt* without conversion of date and time data, " +"use ``dt.replace(tzinfo=None)``." msgstr "" #: ../../library/datetime.rst:1405 msgid "" -"Note that the default :meth:`tzinfo.fromutc` method can be overridden in " -"a :class:`tzinfo` subclass to affect the result returned " -"by :meth:`astimezone`. Ignoring error cases, :meth:`astimezone` acts like::" +"Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" +"class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " +"Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" #: ../../library/datetime.rst:1409 @@ -2123,10 +2119,9 @@ msgstr "" #: ../../library/datetime.rst:1427 msgid "" -"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns " -"``self.tzinfo.utcoffset(self)``, and raises an exception if the latter " -"doesn't return ``None`` or a :class:`timedelta` object with magnitude less " -"than one day." +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"utcoffset(self)``, and raises an exception if the latter doesn't return " +"``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" #: ../../library/datetime.rst:1431 ../../library/datetime.rst:2042 @@ -2137,10 +2132,9 @@ msgstr "" #: ../../library/datetime.rst:1437 msgid "" -"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns " -"``self.tzinfo.dst(self)``, and raises an exception if the latter doesn't " -"return ``None`` or a :class:`timedelta` object with magnitude less than one " -"day." +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"dst(self)``, and raises an exception if the latter doesn't return ``None`` " +"or a :class:`timedelta` object with magnitude less than one day." msgstr "" #: ../../library/datetime.rst:1441 ../../library/datetime.rst:2052 @@ -2150,9 +2144,9 @@ msgstr "" #: ../../library/datetime.rst:1447 msgid "" -"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns " -"``self.tzinfo.tzname(self)``, raises an exception if the latter doesn't " -"return ``None`` or a string object," +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"tzname(self)``, raises an exception if the latter doesn't return ``None`` or " +"a string object," msgstr "" #: ../../library/datetime.rst:1458 @@ -2168,29 +2162,29 @@ msgstr "" #: ../../library/datetime.rst:1462 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " -"day number within the current year starting with 1 for January 1st. " -"The :attr:`~time.struct_time.tm_isdst` flag of the result is set according " -"to the :meth:`dst` method: :attr:`.tzinfo` is ``None`` or :meth:`dst` " -"returns ``None``, :attr:`!tm_isdst` is set to ``-1``; else if :meth:`dst` " -"returns a non-zero value, :attr:`!tm_isdst` is set to 1; else :attr:`!" -"tm_isdst` is set to 0." +"day number within the current year starting with 1 for January 1st. The :" +"attr:`~time.struct_time.tm_isdst` flag of the result is set according to " +"the :meth:`dst` method: :attr:`.tzinfo` is ``None`` or :meth:`dst` returns " +"``None``, :attr:`!tm_isdst` is set to ``-1``; else if :meth:`dst` returns a " +"non-zero value, :attr:`!tm_isdst` is set to 1; else :attr:`!tm_isdst` is set " +"to 0." msgstr "" #: ../../library/datetime.rst:1473 msgid "" -"If :class:`.datetime` instance ``d`` is naive, this is the same as " -"``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced " -"to 0 regardless of what ``d.dst()`` returns. DST is never in effect for a " -"UTC time." +"If :class:`.datetime` instance ``d`` is naive, this is the same as ``d." +"timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " +"regardless of what ``d.dst()`` returns. DST is never in effect for a UTC " +"time." msgstr "" #: ../../library/datetime.rst:1477 msgid "" -"If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting " -"``d.utcoffset()``, and a :class:`time.struct_time` for the normalized time " -"is returned. :attr:`!tm_isdst` is forced to 0. Note that " -"an :exc:`OverflowError` may be raised if ``d.year`` was ``MINYEAR`` or " -"``MAXYEAR`` and UTC adjustment spills over a year boundary." +"If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting ``d." +"utcoffset()``, and a :class:`time.struct_time` for the normalized time is " +"returned. :attr:`!tm_isdst` is forced to 0. Note that an :exc:" +"`OverflowError` may be raised if ``d.year`` was ``MINYEAR`` or ``MAXYEAR`` " +"and UTC adjustment spills over a year boundary." msgstr "" #: ../../library/datetime.rst:1486 @@ -2198,22 +2192,22 @@ msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " "UTC; as a result, using :meth:`datetime.utctimetuple` may give misleading " -"results. If you have a naive ``datetime`` representing UTC, use " -"``datetime.replace(tzinfo=timezone.utc)`` to make it aware, at which point " -"you can use :meth:`.datetime.timetuple`." +"results. If you have a naive ``datetime`` representing UTC, use ``datetime." +"replace(tzinfo=timezone.utc)`` to make it aware, at which point you can use :" +"meth:`.datetime.timetuple`." msgstr "" #: ../../library/datetime.rst:1495 msgid "" -"Return the proleptic Gregorian ordinal of the date. The same as " -"``self.date().toordinal()``." +"Return the proleptic Gregorian ordinal of the date. The same as ``self." +"date().toordinal()``." msgstr "" #: ../../library/datetime.rst:1500 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " -"return value is a :class:`float` similar to that returned " -"by :func:`time.time`." +"return value is a :class:`float` similar to that returned by :func:`time." +"time`." msgstr "" #: ../../library/datetime.rst:1504 @@ -2221,9 +2215,9 @@ msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " "the conversion. Since :class:`.datetime` supports wider range of values " -"than :c:func:`mktime` on many platforms, this method may " -"raise :exc:`OverflowError` or :exc:`OSError` for times far in the past or " -"far in the future." +"than :c:func:`mktime` on many platforms, this method may raise :exc:" +"`OverflowError` or :exc:`OSError` for times far in the past or far in the " +"future." msgstr "" #: ../../library/datetime.rst:1511 @@ -2243,10 +2237,10 @@ msgstr "" #: ../../library/datetime.rst:1524 msgid "" -"There is no method to obtain the POSIX timestamp directly from a " -"naive :class:`.datetime` instance representing UTC time. If your application " -"uses this convention and your system time zone is not set to UTC, you can " -"obtain the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" +"There is no method to obtain the POSIX timestamp directly from a naive :" +"class:`.datetime` instance representing UTC time. If your application uses " +"this convention and your system time zone is not set to UTC, you can obtain " +"the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" #: ../../library/datetime.rst:1530 @@ -2270,8 +2264,8 @@ msgstr "" #: ../../library/datetime.rst:1544 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " -"The same as ``self.date().isoweekday()``. See " -"also :meth:`weekday`, :meth:`isocalendar`." +"The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" +"`isocalendar`." msgstr "" #: ../../library/datetime.rst:1551 @@ -2425,8 +2419,8 @@ msgstr "新增 *timespec* 參數。" #: ../../library/datetime.rst:1625 msgid "" -"For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to " -"``d.isoformat(' ')``." +"For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to ``d." +"isoformat(' ')``." msgstr "" #: ../../library/datetime.rst:1631 @@ -2451,24 +2445,24 @@ msgstr "" #: ../../library/datetime.rst:1644 msgid "" -"on platforms where the native C :c:func:`ctime` function " -"(which :func:`time.ctime` invokes, but which :meth:`datetime.ctime` does not " -"invoke) conforms to the C standard." +"on platforms where the native C :c:func:`ctime` function (which :func:`time." +"ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " +"to the C standard." msgstr "" #: ../../library/datetime.rst:1651 msgid "" "Return a string representing the date and time, controlled by an explicit " -"format string. See also :ref:`strftime-strptime-behavior` " -"and :meth:`datetime.isoformat`." +"format string. See also :ref:`strftime-strptime-behavior` and :meth:" +"`datetime.isoformat`." msgstr "" #: ../../library/datetime.rst:1658 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " -"literals ` and when using :meth:`str.format`. See " -"also :ref:`strftime-strptime-behavior` and :meth:`datetime.isoformat`." +"literals ` and when using :meth:`str.format`. See also :ref:" +"`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" #: ../../library/datetime.rst:1665 @@ -2493,8 +2487,8 @@ msgid "" ">>> datetime.now()\n" "datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1\n" ">>> datetime.now(timezone.utc)\n" -"datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, " -"tzinfo=datetime.timezone.utc)\n" +"datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, tzinfo=datetime.timezone." +"utc)\n" "\n" ">>> # Using datetime.strptime()\n" ">>> dt = datetime.strptime(\"21/11/06 16:30\", \"%d/%m/%y %H:%M\")\n" @@ -2528,8 +2522,8 @@ msgid "" ">>> # Formatting a datetime\n" ">>> dt.strftime(\"%A, %d. %B %Y %I:%M%p\")\n" "'Tuesday, 21. November 2006 04:30PM'\n" -">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:" -"%M%p}.'.format(dt, \"day\", \"month\", \"time\")\n" +">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'." +"format(dt, \"day\", \"month\", \"time\")\n" "'The day is 21, the month is November, the time is 04:30PM.'" msgstr "" @@ -2627,8 +2621,8 @@ msgstr "" #: ../../library/datetime.rst:1800 msgid "" -"All arguments are optional. *tzinfo* may be ``None``, or an instance of " -"a :class:`tzinfo` subclass. The remaining arguments must be integers in the " +"All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" +"class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" @@ -2649,8 +2643,8 @@ msgstr "" #: ../../library/datetime.rst:1828 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " -"``timedelta(microseconds=1)``, although note that arithmetic " -"on :class:`.time` objects is not supported." +"``timedelta(microseconds=1)``, although note that arithmetic on :class:`." +"time` objects is not supported." msgstr "" #: ../../library/datetime.rst:1857 @@ -2739,8 +2733,8 @@ msgid "" ">>> time.fromisoformat('04:23:01,000384')\n" "datetime.time(4, 23, 1, 384)\n" ">>> time.fromisoformat('04:23:01+04:00')\n" -"datetime.time(4, 23, 1, " -"tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime." +"timedelta(seconds=14400)))\n" ">>> time.fromisoformat('04:23:01Z')\n" "datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)\n" ">>> time.fromisoformat('04:23:01+00:00')\n" @@ -2758,8 +2752,8 @@ msgstr "" ">>> time.fromisoformat('04:23:01,000384')\n" "datetime.time(4, 23, 1, 384)\n" ">>> time.fromisoformat('04:23:01+04:00')\n" -"datetime.time(4, 23, 1, " -"tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime." +"timedelta(seconds=14400)))\n" ">>> time.fromisoformat('04:23:01Z')\n" "datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)\n" ">>> time.fromisoformat('04:23:01+00:00')\n" @@ -2767,8 +2761,8 @@ msgstr "" #: ../../library/datetime.rst:1935 msgid "" -"Previously, this method only supported formats that could be emitted " -"by :meth:`time.isoformat`." +"Previously, this method only supported formats that could be emitted by :" +"meth:`time.isoformat`." msgstr "" #: ../../library/datetime.rst:1941 @@ -2791,8 +2785,8 @@ msgstr "time(*(time.strptime(date_string, format)[3:6]))" msgid "" ":exc:`ValueError` is raised if the *date_string* and *format* cannot be " "parsed by :func:`time.strptime` or if it returns a value which is not a time " -"tuple. See also :ref:`strftime-strptime-behavior` " -"and :meth:`time.fromisoformat`." +"tuple. See also :ref:`strftime-strptime-behavior` and :meth:`time." +"fromisoformat`." msgstr "" #: ../../library/datetime.rst:1961 @@ -2805,8 +2799,8 @@ msgstr "" #: ../../library/datetime.rst:1966 msgid "" -":class:`.time` objects are also supported by generic " -"function :func:`copy.replace`." +":class:`.time` objects are also supported by generic function :func:`copy." +"replace`." msgstr "" #: ../../library/datetime.rst:1975 @@ -2829,8 +2823,8 @@ msgstr "" #: ../../library/datetime.rst:1980 msgid "" -"``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 " -"and :meth:`utcoffset` does not return ``None``" +"``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" +"`utcoffset` does not return ``None``" msgstr "" #: ../../library/datetime.rst:2000 @@ -2840,8 +2834,8 @@ msgstr "" #: ../../library/datetime.rst:2004 msgid "" ">>> from datetime import time\n" -">>> time(hour=12, minute=34, second=56, " -"microsecond=123456).isoformat(timespec='minutes')\n" +">>> time(hour=12, minute=34, second=56, microsecond=123456)." +"isoformat(timespec='minutes')\n" "'12:34'\n" ">>> dt = time(hour=12, minute=34, second=56, microsecond=0)\n" ">>> dt.isoformat(timespec='microseconds')\n" @@ -2850,8 +2844,8 @@ msgid "" "'12:34:56'" msgstr "" ">>> from datetime import time\n" -">>> time(hour=12, minute=34, second=56, " -"microsecond=123456).isoformat(timespec='minutes')\n" +">>> time(hour=12, minute=34, second=56, microsecond=123456)." +"isoformat(timespec='minutes')\n" "'12:34'\n" ">>> dt = time(hour=12, minute=34, second=56, microsecond=0)\n" ">>> dt.isoformat(timespec='microseconds')\n" @@ -2866,8 +2860,8 @@ msgstr "" #: ../../library/datetime.rst:2024 msgid "" "Return a string representing the time, controlled by an explicit format " -"string. See also :ref:`strftime-strptime-behavior` " -"and :meth:`time.isoformat`." +"string. See also :ref:`strftime-strptime-behavior` and :meth:`time." +"isoformat`." msgstr "" #: ../../library/datetime.rst:2030 @@ -2880,25 +2874,23 @@ msgstr "" #: ../../library/datetime.rst:2038 msgid "" -"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns " -"``self.tzinfo.utcoffset(None)``, and raises an exception if the latter " -"doesn't return ``None`` or a :class:`timedelta` object with magnitude less " -"than one day." +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"utcoffset(None)``, and raises an exception if the latter doesn't return " +"``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" #: ../../library/datetime.rst:2048 msgid "" -"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns " -"``self.tzinfo.dst(None)``, and raises an exception if the latter doesn't " -"return ``None``, or a :class:`timedelta` object with magnitude less than one " -"day." +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"dst(None)``, and raises an exception if the latter doesn't return ``None``, " +"or a :class:`timedelta` object with magnitude less than one day." msgstr "" #: ../../library/datetime.rst:2057 msgid "" -"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns " -"``self.tzinfo.tzname(None)``, or raises an exception if the latter doesn't " -"return ``None`` or a string object." +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." +"tzname(None)``, or raises an exception if the latter doesn't return ``None`` " +"or a string object." msgstr "" #: ../../library/datetime.rst:2062 @@ -2976,26 +2968,26 @@ msgstr "" msgid "" "An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the " "constructors for :class:`.datetime` and :class:`.time` objects. The latter " -"objects view their attributes as being in local time, and " -"the :class:`tzinfo` object supports methods revealing offset of local time " -"from UTC, the name of the time zone, and DST offset, all relative to a date " -"or time object passed to them." +"objects view their attributes as being in local time, and the :class:" +"`tzinfo` object supports methods revealing offset of local time from UTC, " +"the name of the time zone, and DST offset, all relative to a date or time " +"object passed to them." msgstr "" #: ../../library/datetime.rst:2109 msgid "" "You need to derive a concrete subclass, and (at least) supply " -"implementations of the standard :class:`tzinfo` methods needed by " -"the :class:`.datetime` methods you use. The :mod:`!datetime` module " -"provides :class:`timezone`, a simple concrete subclass of :class:`tzinfo` " -"which can represent time zones with fixed offset from UTC such as UTC itself " -"or North American EST and EDT." +"implementations of the standard :class:`tzinfo` methods needed by the :class:" +"`.datetime` methods you use. The :mod:`!datetime` module provides :class:" +"`timezone`, a simple concrete subclass of :class:`tzinfo` which can " +"represent time zones with fixed offset from UTC such as UTC itself or North " +"American EST and EDT." msgstr "" #: ../../library/datetime.rst:2116 msgid "" -"Special requirement for pickling: A :class:`tzinfo` subclass must have " -"an :meth:`~object.__init__` method that can be called with no arguments, " +"Special requirement for pickling: A :class:`tzinfo` subclass must have an :" +"meth:`~object.__init__` method that can be called with no arguments, " "otherwise it can be pickled but possibly not unpickled again. This is a " "technical requirement that may be relaxed in the future." msgstr "" @@ -3003,8 +2995,8 @@ msgstr "" #: ../../library/datetime.rst:2122 msgid "" "A concrete subclass of :class:`tzinfo` may need to implement the following " -"methods. Exactly which methods are needed depends on the uses made of " -"aware :mod:`!datetime` objects. If in doubt, simply implement all of them." +"methods. Exactly which methods are needed depends on the uses made of aware :" +"mod:`!datetime` objects. If in doubt, simply implement all of them." msgstr "" #: ../../library/datetime.rst:2129 @@ -3015,14 +3007,13 @@ msgstr "" #: ../../library/datetime.rst:2132 msgid "" -"This represents the *total* offset from UTC; for example, if " -"a :class:`tzinfo` object represents both time zone and DST " -"adjustments, :meth:`utcoffset` should return their sum. If the UTC offset " -"isn't known, return ``None``. Else the value returned must be " -"a :class:`timedelta` object strictly between ``-timedelta(hours=24)`` and " -"``timedelta(hours=24)`` (the magnitude of the offset must be less than one " -"day). Most implementations of :meth:`utcoffset` will probably look like one " -"of these two::" +"This represents the *total* offset from UTC; for example, if a :class:" +"`tzinfo` object represents both time zone and DST adjustments, :meth:" +"`utcoffset` should return their sum. If the UTC offset isn't known, return " +"``None``. Else the value returned must be a :class:`timedelta` object " +"strictly between ``-timedelta(hours=24)`` and ``timedelta(hours=24)`` (the " +"magnitude of the offset must be less than one day). Most implementations of :" +"meth:`utcoffset` will probably look like one of these two::" msgstr "" #: ../../library/datetime.rst:2140 @@ -3039,8 +3030,8 @@ msgstr "" #: ../../library/datetime.rst:2146 msgid "" -"The default implementation of :meth:`utcoffset` " -"raises :exc:`NotImplementedError`." +"The default implementation of :meth:`utcoffset` raises :exc:" +"`NotImplementedError`." msgstr "" #: ../../library/datetime.rst:2155 @@ -3054,13 +3045,12 @@ msgid "" "Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return " "the offset as a :class:`timedelta` object (see :meth:`utcoffset` for " "details). Note that DST offset, if applicable, has already been added to the " -"UTC offset returned by :meth:`utcoffset`, so there's no need to " -"consult :meth:`dst` unless you're interested in obtaining DST info " -"separately. For example, :meth:`datetime.timetuple` calls " -"its :attr:`~.datetime.tzinfo` attribute's :meth:`dst` method to determine " -"how the :attr:`~time.struct_time.tm_isdst` flag should be set, " -"and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for DST changes when " -"crossing time zones." +"UTC offset returned by :meth:`utcoffset`, so there's no need to consult :" +"meth:`dst` unless you're interested in obtaining DST info separately. For " +"example, :meth:`datetime.timetuple` calls its :attr:`~.datetime.tzinfo` " +"attribute's :meth:`dst` method to determine how the :attr:`~time.struct_time." +"tm_isdst` flag should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` " +"to account for DST changes when crossing time zones." msgstr "" #: ../../library/datetime.rst:2169 @@ -3075,15 +3065,15 @@ msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" #: ../../library/datetime.rst:2174 msgid "" -"must return the same result for every :class:`.datetime` *dt* with " -"``dt.tzinfo == tz``. For sane :class:`tzinfo` subclasses, this expression " -"yields the time zone's \"standard offset\", which should not depend on the " -"date or the time, but only on geographic location. The implementation " -"of :meth:`datetime.astimezone` relies on this, but cannot detect violations; " -"it's the programmer's responsibility to ensure it. If a :class:`tzinfo` " -"subclass cannot guarantee this, it may be able to override the default " -"implementation of :meth:`tzinfo.fromutc` to work correctly " -"with :meth:`~.datetime.astimezone` regardless." +"must return the same result for every :class:`.datetime` *dt* with ``dt." +"tzinfo == tz``. For sane :class:`tzinfo` subclasses, this expression yields " +"the time zone's \"standard offset\", which should not depend on the date or " +"the time, but only on geographic location. The implementation of :meth:" +"`datetime.astimezone` relies on this, but cannot detect violations; it's the " +"programmer's responsibility to ensure it. If a :class:`tzinfo` subclass " +"cannot guarantee this, it may be able to override the default implementation " +"of :meth:`tzinfo.fromutc` to work correctly with :meth:`~.datetime." +"astimezone` regardless." msgstr "" #: ../../library/datetime.rst:2183 @@ -3129,16 +3119,16 @@ msgid "" "particular. For example, ``\"GMT\"``, ``\"UTC\"``, ``\"-500\"``, " "``\"-5:00\"``, ``\"EDT\"``, ``\"US/Eastern\"``, ``\"America/New York\"`` are " "all valid replies. Return ``None`` if a string name isn't known. Note that " -"this is a method rather than a fixed string primarily because " -"some :class:`tzinfo` subclasses will wish to return different names " -"depending on the specific value of *dt* passed, especially if " -"the :class:`tzinfo` class is accounting for daylight time." +"this is a method rather than a fixed string primarily because some :class:" +"`tzinfo` subclasses will wish to return different names depending on the " +"specific value of *dt* passed, especially if the :class:`tzinfo` class is " +"accounting for daylight time." msgstr "" #: ../../library/datetime.rst:2219 msgid "" -"The default implementation of :meth:`tzname` " -"raises :exc:`NotImplementedError`." +"The default implementation of :meth:`tzname` raises :exc:" +"`NotImplementedError`." msgstr "" #: ../../library/datetime.rst:2222 @@ -3147,8 +3137,8 @@ msgid "" "in response to their methods of the same names. A :class:`.datetime` object " "passes itself as the argument, and a :class:`.time` object passes ``None`` " "as the argument. A :class:`tzinfo` subclass's methods should therefore be " -"prepared to accept a *dt* argument of ``None``, or of " -"class :class:`.datetime`." +"prepared to accept a *dt* argument of ``None``, or of class :class:`." +"datetime`." msgstr "" #: ../../library/datetime.rst:2228 @@ -3162,12 +3152,12 @@ msgstr "" #: ../../library/datetime.rst:2234 msgid "" -"When a :class:`.datetime` object is passed in response to " -"a :class:`.datetime` method, ``dt.tzinfo`` is the same object as " -"*self*. :class:`tzinfo` methods can rely on this, unless user code " -"calls :class:`tzinfo` methods directly. The intent is that " -"the :class:`tzinfo` methods interpret *dt* as being in local time, and not " -"need worry about objects in other time zones." +"When a :class:`.datetime` object is passed in response to a :class:`." +"datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" +"`tzinfo` methods can rely on this, unless user code calls :class:`tzinfo` " +"methods directly. The intent is that the :class:`tzinfo` methods interpret " +"*dt* as being in local time, and not need worry about objects in other time " +"zones." msgstr "" #: ../../library/datetime.rst:2240 @@ -3180,24 +3170,24 @@ msgstr "" msgid "" "This is called from the default :meth:`datetime.astimezone` implementation. " "When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " -"data are to be viewed as expressing a UTC time. The purpose " -"of :meth:`fromutc` is to adjust the date and time data, returning an " -"equivalent datetime in *self*'s local time." +"data are to be viewed as expressing a UTC time. The purpose of :meth:" +"`fromutc` is to adjust the date and time data, returning an equivalent " +"datetime in *self*'s local time." msgstr "" #: ../../library/datetime.rst:2251 msgid "" -"Most :class:`tzinfo` subclasses should be able to inherit the " -"default :meth:`fromutc` implementation without problems. It's strong enough " -"to handle fixed-offset time zones, and time zones accounting for both " -"standard and daylight time, and the latter even if the DST transition times " -"differ in different years. An example of a time zone the " -"default :meth:`fromutc` implementation may not handle correctly in all cases " -"is one where the standard offset (from UTC) depends on the specific date and " -"time passed, which can happen for political reasons. The default " -"implementations of :meth:`~.datetime.astimezone` and :meth:`fromutc` may not " -"produce the result you want if the result is one of the hours straddling the " -"moment the standard offset changes." +"Most :class:`tzinfo` subclasses should be able to inherit the default :meth:" +"`fromutc` implementation without problems. It's strong enough to handle " +"fixed-offset time zones, and time zones accounting for both standard and " +"daylight time, and the latter even if the DST transition times differ in " +"different years. An example of a time zone the default :meth:`fromutc` " +"implementation may not handle correctly in all cases is one where the " +"standard offset (from UTC) depends on the specific date and time passed, " +"which can happen for political reasons. The default implementations of :meth:" +"`~.datetime.astimezone` and :meth:`fromutc` may not produce the result you " +"want if the result is one of the hours straddling the moment the standard " +"offset changes." msgstr "" #: ../../library/datetime.rst:2262 @@ -3226,8 +3216,8 @@ msgstr "" #: ../../library/datetime.rst:2280 msgid "" -"In the following :download:`tzinfo_examples.py <../includes/" -"tzinfo_examples.py>` file there are some examples of :class:`tzinfo` classes:" +"In the following :download:`tzinfo_examples.py <../includes/tzinfo_examples." +"py>` file there are some examples of :class:`tzinfo` classes:" msgstr "" #: ../../library/datetime.rst:2284 @@ -3412,11 +3402,11 @@ msgstr "" #: ../../library/datetime.rst:2286 msgid "" -"Note that there are unavoidable subtleties twice per year in " -"a :class:`tzinfo` subclass accounting for both standard and daylight time, " -"at the DST transition points. For concreteness, consider US Eastern (UTC " -"-0500), where EDT begins the minute after 1:59 (EST) on the second Sunday in " -"March, and ends the minute after 1:59 (EDT) on the first Sunday in November::" +"Note that there are unavoidable subtleties twice per year in a :class:" +"`tzinfo` subclass accounting for both standard and daylight time, at the DST " +"transition points. For concreteness, consider US Eastern (UTC -0500), where " +"EDT begins the minute after 1:59 (EST) on the second Sunday in March, and " +"ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" #: ../../library/datetime.rst:2292 @@ -3522,11 +3512,11 @@ msgstr "" #: ../../library/datetime.rst:2344 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " -"the value of the :attr:`~.datetime.fold` attribute or avoid using " -"hybrid :class:`tzinfo` subclasses; there are no ambiguities when " -"using :class:`timezone`, or any other fixed-offset :class:`tzinfo` subclass " -"(such as a class representing only EST (fixed offset -5 hours), or only EDT " -"(fixed offset -4 hours))." +"the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :" +"class:`tzinfo` subclasses; there are no ambiguities when using :class:" +"`timezone`, or any other fixed-offset :class:`tzinfo` subclass (such as a " +"class representing only EST (fixed offset -5 hours), or only EDT (fixed " +"offset -4 hours))." msgstr "" #: ../../library/datetime.rst:2352 @@ -3623,8 +3613,8 @@ msgstr "總是回傳 ``None``。" #: ../../library/datetime.rst:2431 msgid "" -"Return ``dt + offset``. The *dt* argument must be an " -"aware :class:`.datetime` instance, with ``tzinfo`` set to ``self``." +"Return ``dt + offset``. The *dt* argument must be an aware :class:`." +"datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" #: ../../library/datetime.rst:2438 @@ -3644,15 +3634,15 @@ msgstr "" #: ../../library/datetime.rst:2453 msgid "" -"Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` " -"and :meth:`time.strptime` class methods create an object from a string " -"representing the time and a corresponding format string." +"Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and :meth:" +"`time.strptime` class methods create an object from a string representing " +"the time and a corresponding format string." msgstr "" #: ../../library/datetime.rst:2457 msgid "" -"The table below provides a high-level comparison " -"of :meth:`~.datetime.strftime` versus :meth:`~.datetime.strptime`:" +"The table below provides a high-level comparison of :meth:`~.datetime." +"strftime` versus :meth:`~.datetime.strptime`:" msgstr "" #: ../../library/datetime.rst:2461 @@ -3754,11 +3744,11 @@ msgstr "``%a``" msgid "Weekday as locale's abbreviated name." msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2490 msgid "Sun, Mon, ..., Sat (en_US);" msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2492 msgid "So, Mo, ..., Sa (de_DE)" msgstr "" @@ -3770,11 +3760,11 @@ msgstr "``%A``" msgid "Weekday as locale's full name." msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2495 msgid "Sunday, Monday, ..., Saturday (en_US);" msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2497 msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" @@ -3817,11 +3807,11 @@ msgstr "``%b``" msgid "Month as locale's abbreviated name." msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2507 msgid "Jan, Feb, ..., Dec (en_US);" msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2509 msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" @@ -3833,11 +3823,11 @@ msgstr "``%B``" msgid "Month as locale's full name." msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2512 msgid "January, February, ..., December (en_US);" msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2514 msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" @@ -3905,11 +3895,11 @@ msgstr "``%p``" msgid "Locale's equivalent of either AM or PM." msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2532 msgid "AM, PM (en_US);" msgstr "AM, PM (en_US);" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2533 msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" @@ -4038,11 +4028,11 @@ msgstr "``%c``" msgid "Locale's appropriate date and time representation." msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2572 msgid "Tue Aug 16 21:30:00 1988 (en_US);" msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2574 msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" @@ -4054,15 +4044,15 @@ msgstr "``%x``" msgid "Locale's appropriate date representation." msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2577 msgid "08/16/88 (None);" msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2578 msgid "08/16/1988 (en_US);" msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2579 msgid "16.08.1988 (de_DE)" msgstr "" @@ -4074,11 +4064,11 @@ msgstr "``%X``" msgid "Locale's appropriate time representation." msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2581 msgid "21:30:00 (en_US);" msgstr "" -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:2582 msgid "21:30:00 (de_DE)" msgstr "" @@ -4160,11 +4150,11 @@ msgstr "" #: ../../library/datetime.rst:2613 msgid "" -"These may not be available on all platforms when used with " -"the :meth:`~.datetime.strftime` method. The ISO 8601 year and ISO 8601 week " -"directives are not interchangeable with the year and week number directives " -"above. Calling :meth:`~.datetime.strptime` with incomplete or ambiguous ISO " -"8601 directives will raise a :exc:`ValueError`." +"These may not be available on all platforms when used with the :meth:`~." +"datetime.strftime` method. The ISO 8601 year and ISO 8601 week directives " +"are not interchangeable with the year and week number directives above. " +"Calling :meth:`~.datetime.strptime` with incomplete or ambiguous ISO 8601 " +"directives will raise a :exc:`ValueError`." msgstr "" #: ../../library/datetime.rst:2618 @@ -4192,8 +4182,8 @@ msgstr "技術細節" #: ../../library/datetime.rst:2633 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " -"``time.strftime(fmt, d.timetuple())`` although not all objects support " -"a :meth:`~date.timetuple` method." +"``time.strftime(fmt, d.timetuple())`` although not all objects support a :" +"meth:`~date.timetuple` method." msgstr "" #: ../../library/datetime.rst:2637 @@ -4230,16 +4220,16 @@ msgid "" "microseconds should not be used, as :class:`date` objects have no such " "values. If they're used anyway, 0 is substituted for them." msgstr "" -"對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因" -"為 :class:`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 0 代替。" +"對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" +"`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 0 代替。" #: ../../library/datetime.rst:2657 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " "also platform-dependent. On some platforms such code points are preserved " -"intact in the output, while on others ``strftime`` may " -"raise :exc:`UnicodeError` or return an empty string instead." +"intact in the output, while on others ``strftime`` may raise :exc:" +"`UnicodeError` or return an empty string instead." msgstr "" #: ../../library/datetime.rst:2666 @@ -4308,9 +4298,9 @@ msgid "" "seconds and ``ffffff`` is a 6-digit string giving the number of UTC offset " "microseconds. The ``ffffff`` part is omitted when the offset is a whole " "number of seconds and both the ``ffffff`` and the ``SS`` part is omitted " -"when the offset is a whole number of minutes. For example, " -"if :meth:`~.datetime.utcoffset` returns ``timedelta(hours=-3, " -"minutes=-30)``, ``%z`` is replaced with the string ``'-0330'``." +"when the offset is a whole number of minutes. For example, if :meth:`~." +"datetime.utcoffset` returns ``timedelta(hours=-3, minutes=-30)``, ``%z`` is " +"replaced with the string ``'-0330'``." msgstr "" #: ../../library/datetime.rst:2719 @@ -4330,9 +4320,9 @@ msgstr "" #: ../../library/datetime.rst:2731 msgid "" -"In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string " -"if :meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced " -"by the returned value, which must be a string." +"In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :" +"meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by " +"the returned value, which must be a string." msgstr "" #: ../../library/datetime.rst:2735 @@ -4371,9 +4361,9 @@ msgstr "" #: ../../library/datetime.rst:2755 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " -"day of the week and the ISO year (``%G``) are specified in " -"a :meth:`~.datetime.strptime` format string. Also note that ``%G`` and " -"``%Y`` are not interchangeable." +"day of the week and the ISO year (``%G``) are specified in a :meth:`~." +"datetime.strptime` format string. Also note that ``%G`` and ``%Y`` are not " +"interchangeable." msgstr "" #: ../../library/datetime.rst:2761 @@ -4401,8 +4391,8 @@ msgid "" "datetime.datetime(1984, 2, 29, 0, 0)" msgstr "" ">>> month_day = \"02/29\"\n" -">>> datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # 沒有閏年" -"問題。\n" +">>> datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # 沒有閏年問" +"題。\n" "datetime.datetime(1984, 2, 29, 0, 0)" #: ../../library/datetime.rst:2778 diff --git a/library/dialog.po b/library/dialog.po index cdacc53c2a..7bc9c50cda 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -83,32 +83,32 @@ msgid "" "listed below:" msgstr "" -#: ../../library/dialog.rst:0 +#: ../../library/dialog.rst:64 msgid "*parent* - the window to place the dialog on top of" msgstr "" -#: ../../library/dialog.rst:0 +#: ../../library/dialog.rst:66 msgid "*title* - the title of the window" msgstr "" -#: ../../library/dialog.rst:0 +#: ../../library/dialog.rst:68 msgid "*initialdir* - the directory that the dialog starts in" msgstr "" -#: ../../library/dialog.rst:0 +#: ../../library/dialog.rst:70 msgid "*initialfile* - the file selected upon opening of the dialog" msgstr "" -#: ../../library/dialog.rst:0 +#: ../../library/dialog.rst:72 msgid "" "*filetypes* - a sequence of (label, pattern) tuples, '*' wildcard is allowed" msgstr "" -#: ../../library/dialog.rst:0 +#: ../../library/dialog.rst:74 msgid "*defaultextension* - default extension to append to file (save dialogs)" msgstr "" -#: ../../library/dialog.rst:0 +#: ../../library/dialog.rst:76 msgid "*multiple* - when true, selection of multiple items is allowed" msgstr "" diff --git a/library/enum.po b/library/enum.po index 5262e18ad2..8b6600432b 100644 --- a/library/enum.po +++ b/library/enum.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-03 00:13+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2024-12-21 13:50+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,6 +25,10 @@ msgstr ":mod:`!enum` --- 對列舉的支援" msgid "**Source code:** :source:`Lib/enum.py`" msgstr "**原始碼:**\\ :source:`Lib/enum.py`" +#: ../../library/enum.rst:16 +msgid "Important" +msgstr "" + #: ../../library/enum.rst:18 msgid "" "This page contains the API reference information. For tutorial information " diff --git a/library/functions.po b/library/functions.po index 034ee37f90..54297a008e 100644 --- a/library/functions.po +++ b/library/functions.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2024-05-06 17:06+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,367 +33,367 @@ msgid "" msgstr "" "Python 直譯器有內建多個可隨時使用的函式和型別。以下按照英文字母排序列出。" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:13 msgid "**A**" msgstr "**A**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:14 msgid ":func:`abs`" msgstr ":func:`abs`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:15 msgid ":func:`aiter`" msgstr ":func:`aiter`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:16 msgid ":func:`all`" msgstr ":func:`all`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:17 msgid ":func:`anext`" msgstr ":func:`anext`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:18 msgid ":func:`any`" msgstr ":func:`any`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:19 msgid ":func:`ascii`" msgstr ":func:`ascii`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:21 msgid "**B**" msgstr "**B**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:22 msgid ":func:`bin`" msgstr ":func:`bin`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:23 msgid ":func:`bool`" msgstr ":func:`bool`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:24 msgid ":func:`breakpoint`" msgstr ":func:`breakpoint`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:25 msgid "|func-bytearray|_" msgstr "|func-bytearray|_" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:26 msgid "|func-bytes|_" msgstr "|func-bytes|_" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:28 msgid "**C**" msgstr "**C**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:29 msgid ":func:`callable`" msgstr ":func:`callable`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:30 msgid ":func:`chr`" msgstr ":func:`chr`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:31 msgid ":func:`classmethod`" msgstr ":func:`classmethod`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:32 msgid ":func:`compile`" msgstr ":func:`compile`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:33 msgid ":func:`complex`" msgstr ":func:`complex`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:35 msgid "**D**" msgstr "**D**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:36 msgid ":func:`delattr`" msgstr ":func:`delattr`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:37 msgid "|func-dict|_" msgstr "|func-dict|_" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:38 msgid ":func:`dir`" msgstr ":func:`dir`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:39 msgid ":func:`divmod`" msgstr ":func:`divmod`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:13 msgid "**E**" msgstr "**E**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:14 msgid ":func:`enumerate`" msgstr ":func:`enumerate`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:15 msgid ":func:`eval`" msgstr ":func:`eval`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:16 msgid ":func:`exec`" msgstr ":func:`exec`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:18 msgid "**F**" msgstr "**F**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:19 msgid ":func:`filter`" msgstr ":func:`filter`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:20 msgid ":func:`float`" msgstr ":func:`float`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:21 msgid ":func:`format`" msgstr ":func:`format`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:22 msgid "|func-frozenset|_" msgstr "|func-frozenset|_" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:24 msgid "**G**" msgstr "**G**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:25 msgid ":func:`getattr`" msgstr ":func:`getattr`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:26 msgid ":func:`globals`" msgstr ":func:`globals`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:28 msgid "**H**" msgstr "**H**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:29 msgid ":func:`hasattr`" msgstr ":func:`hasattr`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:30 msgid ":func:`hash`" msgstr ":func:`hash`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:31 msgid ":func:`help`" msgstr ":func:`help`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:32 msgid ":func:`hex`" msgstr ":func:`hex`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:34 msgid "**I**" msgstr "**I**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:35 msgid ":func:`id`" msgstr ":func:`id`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:36 msgid ":func:`input`" msgstr ":func:`input`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:37 msgid ":func:`int`" msgstr ":func:`int`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:38 msgid ":func:`isinstance`" msgstr ":func:`isinstance`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:39 msgid ":func:`issubclass`" msgstr ":func:`issubclass`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:40 msgid ":func:`iter`" msgstr ":func:`iter`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:13 msgid "**L**" msgstr "**L**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:14 msgid ":func:`len`" msgstr ":func:`len`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:15 msgid "|func-list|_" msgstr "|func-list|_" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:16 msgid ":func:`locals`" msgstr ":func:`locals`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:18 msgid "**M**" msgstr "**M**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:19 msgid ":func:`map`" msgstr ":func:`map`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:20 msgid ":func:`max`" msgstr ":func:`max`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:21 msgid "|func-memoryview|_" msgstr "|func-memoryview|_" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:22 msgid ":func:`min`" msgstr ":func:`min`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:24 msgid "**N**" msgstr "**N**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:25 msgid ":func:`next`" msgstr ":func:`next`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:27 msgid "**O**" msgstr "**O**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:28 msgid ":func:`object`" msgstr ":func:`object`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:29 msgid ":func:`oct`" msgstr ":func:`oct`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:30 msgid ":func:`open`" msgstr ":func:`open`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:31 msgid ":func:`ord`" msgstr ":func:`ord`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:33 msgid "**P**" msgstr "**P**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:34 msgid ":func:`pow`" msgstr ":func:`pow`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:35 msgid ":func:`print`" msgstr ":func:`print`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:36 msgid ":func:`property`" msgstr ":func:`property`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:13 msgid "**R**" msgstr "**R**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:14 msgid "|func-range|_" msgstr "|func-range|_" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:15 msgid ":func:`repr`" msgstr ":func:`repr`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:16 msgid ":func:`reversed`" msgstr ":func:`reversed`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:17 msgid ":func:`round`" msgstr ":func:`round`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:19 msgid "**S**" msgstr "**S**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:20 msgid "|func-set|_" msgstr "|func-set|_" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:21 msgid ":func:`setattr`" msgstr ":func:`setattr`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:22 msgid ":func:`slice`" msgstr ":func:`slice`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:23 msgid ":func:`sorted`" msgstr ":func:`sorted`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:24 msgid ":func:`staticmethod`" msgstr ":func:`staticmethod`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:25 msgid "|func-str|_" msgstr "|func-str|_" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:26 msgid ":func:`sum`" msgstr ":func:`sum`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:27 msgid ":func:`super`" msgstr ":func:`super`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:29 msgid "**T**" msgstr "**T**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:30 msgid "|func-tuple|_" msgstr "|func-tuple|_" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:31 msgid ":func:`type`" msgstr ":func:`type`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:33 msgid "**V**" msgstr "**V**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:34 msgid ":func:`vars`" msgstr ":func:`vars`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:36 msgid "**Z**" msgstr "**Z**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:37 msgid ":func:`zip`" msgstr ":func:`zip`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:39 msgid "**_**" msgstr "**_**" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:40 msgid ":func:`__import__`" msgstr ":func:`__import__`" @@ -830,9 +830,10 @@ msgstr "" "可選引數 *flags* 和 *dont_inherit* 控制啟用哪個\\ :ref:`編譯器選項 `\\ 以及允許哪個\\ :ref:`未來功能 `。如果兩者都不存在" "(或兩者都為零),則會呼叫與 :func:`compile` 相同旗標的程式碼來編譯。如果給" -"定 *flags* 引數而未給定 *dont_inherit*\\ (或為零)則無論如何都會使用由 *flags* " -"引數所指定的編譯器選項和未來陳述式。如果 *dont_inherit* 是一個非零整數,則使" -"用 *flags* 引數 -- 周圍程式碼中的旗標(未來功能和編譯器選項)將被忽略。" +"定 *flags* 引數而未給定 *dont_inherit*\\ (或為零)則無論如何都會使用由 " +"*flags* 引數所指定的編譯器選項和未來陳述式。如果 *dont_inherit* 是一個非零整" +"數,則使用 *flags* 引數 -- 周圍程式碼中的旗標(未來功能和編譯器選項)將被忽" +"略。" #: ../../library/functions.rst:323 msgid "" diff --git a/library/logging.config.po b/library/logging.config.po index 06dbdf1241..96fd07f7bf 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,6 +25,10 @@ msgstr ":mod:`!logging.config` --- 日誌記錄配置" msgid "**Source code:** :source:`Lib/logging/config.py`" msgstr "**原始碼:**\\ :source:`Lib/logging/config.py`" +#: ../../library/logging.config.rst:12 +msgid "Important" +msgstr "" + #: ../../library/logging.config.rst:14 msgid "" "This page contains only reference information. For tutorials, please see" diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 7b6f31ba5d..fcc2e9bb1b 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-05 00:16+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,6 +25,10 @@ msgstr ":mod:`!logging.handlers` --- 日誌紀錄處理器" msgid "**Source code:** :source:`Lib/logging/handlers.py`" msgstr "**原始碼:**\\ :source:`Lib/logging/handlers.py`" +#: ../../library/logging.handlers.rst:12 +msgid "Important" +msgstr "" + #: ../../library/logging.handlers.rst:14 msgid "" "This page contains only reference information. For tutorials, please see" diff --git a/library/logging.po b/library/logging.po index bce655a88b..c27e99e0ff 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-31 00:14+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,6 +27,10 @@ msgstr ":mod:`!logging` --- Python 的日誌記錄工具" msgid "**Source code:** :source:`Lib/logging/__init__.py`" msgstr "**原始碼:**\\ :source:`Lib/logging/__init__.py`" +#: ../../library/logging.rst:14 +msgid "Important" +msgstr "" + #: ../../library/logging.rst:16 msgid "" "This page contains the API reference information. For tutorial information " diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 223e0d8ea0..f22cb71feb 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-12 00:16+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1480,7 +1480,7 @@ msgid "" "multiprocessing semantics, this number is not reliable." msgstr "" -#: ../../library/multiprocessing.rst:924 +#: ../../library/multiprocessing.rst:924 ../../library/multiprocessing.rst:1585 msgid "" "Note that this may raise :exc:`NotImplementedError` on platforms like macOS " "where ``sem_getvalue()`` is not implemented." @@ -2120,38 +2120,45 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:1419 -#: ../../library/multiprocessing.rst:1571 +#: ../../library/multiprocessing.rst:1577 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1423 +#: ../../library/multiprocessing.rst:1424 +#: ../../library/multiprocessing.rst:1501 +#: ../../library/multiprocessing.rst:1568 +#: ../../library/multiprocessing.rst:1591 +msgid "Return a boolean indicating whether this object is locked right now." +msgstr "" + +#: ../../library/multiprocessing.rst:1429 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1428 +#: ../../library/multiprocessing.rst:1434 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1430 +#: ../../library/multiprocessing.rst:1436 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1433 -#: ../../library/multiprocessing.rst:1985 +#: ../../library/multiprocessing.rst:1439 +#: ../../library/multiprocessing.rst:2007 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1438 +#: ../../library/multiprocessing.rst:1444 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1443 +#: ../../library/multiprocessing.rst:1449 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -2162,25 +2169,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1451 +#: ../../library/multiprocessing.rst:1457 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1455 +#: ../../library/multiprocessing.rst:1461 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1460 -#: ../../library/multiprocessing.rst:1518 +#: ../../library/multiprocessing.rst:1466 +#: ../../library/multiprocessing.rst:1524 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1462 +#: ../../library/multiprocessing.rst:1468 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -2188,14 +2195,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1467 +#: ../../library/multiprocessing.rst:1473 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1471 +#: ../../library/multiprocessing.rst:1477 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -2209,24 +2216,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1486 +#: ../../library/multiprocessing.rst:1492 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1489 +#: ../../library/multiprocessing.rst:1495 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1495 -#: ../../library/multiprocessing.rst:1562 -msgid "Return a boolean indicating whether this object is locked right now." -msgstr "" - -#: ../../library/multiprocessing.rst:1502 +#: ../../library/multiprocessing.rst:1508 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -2235,20 +2237,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1508 +#: ../../library/multiprocessing.rst:1514 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1512 +#: ../../library/multiprocessing.rst:1518 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1520 +#: ../../library/multiprocessing.rst:1526 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -2261,7 +2263,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1530 +#: ../../library/multiprocessing.rst:1536 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -2272,14 +2274,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1538 +#: ../../library/multiprocessing.rst:1544 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1545 +#: ../../library/multiprocessing.rst:1551 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -2289,7 +2291,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1553 +#: ../../library/multiprocessing.rst:1559 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -2298,17 +2300,21 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1569 +#: ../../library/multiprocessing.rst:1575 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1576 +#: ../../library/multiprocessing.rst:1583 +msgid "Return the current value of semaphore." +msgstr "" + +#: ../../library/multiprocessing.rst:1598 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1581 +#: ../../library/multiprocessing.rst:1603 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -2317,32 +2323,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1589 +#: ../../library/multiprocessing.rst:1611 msgid "Shared :mod:`ctypes` Objects" msgstr "共享的 :mod:`ctypes` 物件" -#: ../../library/multiprocessing.rst:1591 +#: ../../library/multiprocessing.rst:1613 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1596 +#: ../../library/multiprocessing.rst:1618 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1600 -#: ../../library/multiprocessing.rst:1687 +#: ../../library/multiprocessing.rst:1622 +#: ../../library/multiprocessing.rst:1709 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1604 +#: ../../library/multiprocessing.rst:1626 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -2352,24 +2358,24 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1611 +#: ../../library/multiprocessing.rst:1633 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1637 msgid "counter.value += 1" msgstr "counter.value += 1" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1639 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1642 msgid "" "with counter.get_lock():\n" " counter.value += 1" @@ -2377,19 +2383,19 @@ msgstr "" "with counter.get_lock():\n" " counter.value += 1" -#: ../../library/multiprocessing.rst:1623 -#: ../../library/multiprocessing.rst:1713 -#: ../../library/multiprocessing.rst:1728 +#: ../../library/multiprocessing.rst:1645 +#: ../../library/multiprocessing.rst:1735 +#: ../../library/multiprocessing.rst:1750 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1627 +#: ../../library/multiprocessing.rst:1649 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1630 +#: ../../library/multiprocessing.rst:1652 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -2399,7 +2405,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1637 +#: ../../library/multiprocessing.rst:1659 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -2409,28 +2415,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1666 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1646 +#: ../../library/multiprocessing.rst:1668 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1651 +#: ../../library/multiprocessing.rst:1673 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr ":mod:`multiprocessing.sharedctypes` 模組" -#: ../../library/multiprocessing.rst:1656 +#: ../../library/multiprocessing.rst:1678 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1662 +#: ../../library/multiprocessing.rst:1684 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -2439,11 +2445,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1670 +#: ../../library/multiprocessing.rst:1692 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1672 +#: ../../library/multiprocessing.rst:1694 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -2453,40 +2459,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1679 +#: ../../library/multiprocessing.rst:1701 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1685 +#: ../../library/multiprocessing.rst:1707 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1691 +#: ../../library/multiprocessing.rst:1713 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1695 +#: ../../library/multiprocessing.rst:1717 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1701 +#: ../../library/multiprocessing.rst:1723 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1705 -#: ../../library/multiprocessing.rst:1721 +#: ../../library/multiprocessing.rst:1727 +#: ../../library/multiprocessing.rst:1743 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -2496,113 +2502,113 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1717 +#: ../../library/multiprocessing.rst:1739 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1732 +#: ../../library/multiprocessing.rst:1754 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1737 +#: ../../library/multiprocessing.rst:1759 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1741 +#: ../../library/multiprocessing.rst:1763 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1745 +#: ../../library/multiprocessing.rst:1767 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1748 +#: ../../library/multiprocessing.rst:1770 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1752 +#: ../../library/multiprocessing.rst:1774 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1757 +#: ../../library/multiprocessing.rst:1779 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1757 +#: ../../library/multiprocessing.rst:1779 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1757 +#: ../../library/multiprocessing.rst:1779 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1759 +#: ../../library/multiprocessing.rst:1781 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1759 +#: ../../library/multiprocessing.rst:1781 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1759 +#: ../../library/multiprocessing.rst:1781 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1760 +#: ../../library/multiprocessing.rst:1782 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1760 +#: ../../library/multiprocessing.rst:1782 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1761 +#: ../../library/multiprocessing.rst:1783 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1761 +#: ../../library/multiprocessing.rst:1783 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1761 +#: ../../library/multiprocessing.rst:1783 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1762 +#: ../../library/multiprocessing.rst:1784 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1762 +#: ../../library/multiprocessing.rst:1784 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1762 +#: ../../library/multiprocessing.rst:1784 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1766 +#: ../../library/multiprocessing.rst:1788 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1769 +#: ../../library/multiprocessing.rst:1791 msgid "" "from multiprocessing import Process, Lock\n" "from multiprocessing.sharedctypes import Value, Array\n" @@ -2668,11 +2674,11 @@ msgstr "" " print(s.value)\n" " print([(a.x, a.y) for a in A])" -#: ../../library/multiprocessing.rst:1804 +#: ../../library/multiprocessing.rst:1826 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1806 +#: ../../library/multiprocessing.rst:1828 msgid "" "49\n" "0.1111111111111111\n" @@ -2684,11 +2690,11 @@ msgstr "" "HELLO WORLD\n" "[(3.515625, 39.0625), (33.0625, 4.0), (5.640625, 90.25)]" -#: ../../library/multiprocessing.rst:1817 +#: ../../library/multiprocessing.rst:1839 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1819 +#: ../../library/multiprocessing.rst:1841 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -2697,7 +2703,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1828 +#: ../../library/multiprocessing.rst:1850 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -2705,31 +2711,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1836 +#: ../../library/multiprocessing.rst:1858 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1842 +#: ../../library/multiprocessing.rst:1864 msgid "Create a BaseManager object." msgstr "建立一個 BaseManager 物件。" -#: ../../library/multiprocessing.rst:1844 +#: ../../library/multiprocessing.rst:1866 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1847 +#: ../../library/multiprocessing.rst:1869 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1850 +#: ../../library/multiprocessing.rst:1872 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -2737,19 +2743,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1855 +#: ../../library/multiprocessing.rst:1877 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1858 +#: ../../library/multiprocessing.rst:1880 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1861 +#: ../../library/multiprocessing.rst:1883 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -2757,24 +2763,24 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1866 +#: ../../library/multiprocessing.rst:1888 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1871 +#: ../../library/multiprocessing.rst:1893 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1876 +#: ../../library/multiprocessing.rst:1898 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1880 +#: ../../library/multiprocessing.rst:1902 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> manager = BaseManager(address=('', 50000), authkey=b'abc')\n" @@ -2786,15 +2792,15 @@ msgstr "" ">>> server = manager.get_server()\n" ">>> server.serve_forever()" -#: ../../library/multiprocessing.rst:1885 +#: ../../library/multiprocessing.rst:1907 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1889 +#: ../../library/multiprocessing.rst:1911 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1891 +#: ../../library/multiprocessing.rst:1913 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> m = BaseManager(address=('127.0.0.1', 50000), authkey=b'abc')\n" @@ -2804,29 +2810,29 @@ msgstr "" ">>> m = BaseManager(address=('127.0.0.1', 50000), authkey=b'abc')\n" ">>> m.connect()" -#: ../../library/multiprocessing.rst:1897 +#: ../../library/multiprocessing.rst:1919 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1900 +#: ../../library/multiprocessing.rst:1922 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1904 +#: ../../library/multiprocessing.rst:1926 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1907 +#: ../../library/multiprocessing.rst:1929 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1910 +#: ../../library/multiprocessing.rst:1932 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -2834,14 +2840,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1916 +#: ../../library/multiprocessing.rst:1938 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1920 +#: ../../library/multiprocessing.rst:1942 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2852,7 +2858,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1929 +#: ../../library/multiprocessing.rst:1951 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -2862,22 +2868,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1936 +#: ../../library/multiprocessing.rst:1958 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1940 +#: ../../library/multiprocessing.rst:1962 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1944 +#: ../../library/multiprocessing.rst:1966 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1946 +#: ../../library/multiprocessing.rst:1968 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2885,129 +2891,129 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1952 +#: ../../library/multiprocessing.rst:1974 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:1957 +#: ../../library/multiprocessing.rst:1979 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:1961 +#: ../../library/multiprocessing.rst:1983 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:1967 +#: ../../library/multiprocessing.rst:1989 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1974 +#: ../../library/multiprocessing.rst:1996 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1979 +#: ../../library/multiprocessing.rst:2001 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1982 +#: ../../library/multiprocessing.rst:2004 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:1990 +#: ../../library/multiprocessing.rst:2012 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1994 +#: ../../library/multiprocessing.rst:2016 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1998 +#: ../../library/multiprocessing.rst:2020 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2002 +#: ../../library/multiprocessing.rst:2024 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2006 +#: ../../library/multiprocessing.rst:2028 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2010 +#: ../../library/multiprocessing.rst:2032 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:2015 +#: ../../library/multiprocessing.rst:2037 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2019 +#: ../../library/multiprocessing.rst:2041 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:2026 +#: ../../library/multiprocessing.rst:2048 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2031 +#: ../../library/multiprocessing.rst:2053 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2037 +#: ../../library/multiprocessing.rst:2059 msgid "Create a shared :class:`set` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2039 +#: ../../library/multiprocessing.rst:2061 msgid ":class:`set` support was added." msgstr "已新增對 :class:`set` 的支援。" -#: ../../library/multiprocessing.rst:2042 +#: ../../library/multiprocessing.rst:2064 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:2049 +#: ../../library/multiprocessing.rst:2071 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:2051 +#: ../../library/multiprocessing.rst:2073 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:2054 +#: ../../library/multiprocessing.rst:2076 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:2058 +#: ../../library/multiprocessing.rst:2080 msgid "" ">>> mp_context = multiprocessing.get_context('spawn')\n" ">>> manager = mp_context.Manager()\n" @@ -3019,18 +3025,18 @@ msgid "" "Namespace(x=10, y='hello')" msgstr "" -#: ../../library/multiprocessing.rst:2071 +#: ../../library/multiprocessing.rst:2093 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:2073 +#: ../../library/multiprocessing.rst:2095 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2077 +#: ../../library/multiprocessing.rst:2099 msgid "" "from multiprocessing.managers import BaseManager\n" "\n" @@ -3070,23 +3076,23 @@ msgstr "" " print(maths.add(4, 3)) # 印出 7\n" " print(maths.mul(7, 8)) # 印出 56" -#: ../../library/multiprocessing.rst:2098 +#: ../../library/multiprocessing.rst:2120 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:2100 +#: ../../library/multiprocessing.rst:2122 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:2103 +#: ../../library/multiprocessing.rst:2125 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:2106 +#: ../../library/multiprocessing.rst:2128 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> from queue import Queue\n" @@ -3106,11 +3112,11 @@ msgstr "" ">>> s = m.get_server()\n" ">>> s.serve_forever()" -#: ../../library/multiprocessing.rst:2115 +#: ../../library/multiprocessing.rst:2137 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2117 +#: ../../library/multiprocessing.rst:2139 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> class QueueManager(BaseManager): pass\n" @@ -3130,11 +3136,11 @@ msgstr "" ">>> queue = m.get_queue()\n" ">>> queue.put('hello')" -#: ../../library/multiprocessing.rst:2125 +#: ../../library/multiprocessing.rst:2147 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:2127 +#: ../../library/multiprocessing.rst:2149 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> class QueueManager(BaseManager): pass\n" @@ -3156,13 +3162,13 @@ msgstr "" ">>> queue.get()\n" "'hello'" -#: ../../library/multiprocessing.rst:2136 +#: ../../library/multiprocessing.rst:2158 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2139 +#: ../../library/multiprocessing.rst:2161 msgid "" ">>> from multiprocessing import Process, Queue\n" ">>> from multiprocessing.managers import BaseManager\n" @@ -3202,18 +3208,18 @@ msgstr "" ">>> s = m.get_server()\n" ">>> s.serve_forever()" -#: ../../library/multiprocessing.rst:2161 +#: ../../library/multiprocessing.rst:2183 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2163 +#: ../../library/multiprocessing.rst:2185 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:2167 +#: ../../library/multiprocessing.rst:2189 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -3221,7 +3227,7 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2171 +#: ../../library/multiprocessing.rst:2193 msgid "" ">>> mp_context = multiprocessing.get_context('spawn')\n" ">>> manager = mp_context.Manager()\n" @@ -3247,14 +3253,14 @@ msgstr "" ">>> l[2:5]\n" "[4, 9, 16]" -#: ../../library/multiprocessing.rst:2185 +#: ../../library/multiprocessing.rst:2207 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:2189 +#: ../../library/multiprocessing.rst:2211 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -3262,7 +3268,7 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2194 +#: ../../library/multiprocessing.rst:2216 msgid "" ">>> a = manager.list()\n" ">>> b = manager.list()\n" @@ -3274,11 +3280,11 @@ msgid "" "['hello'] ['hello']" msgstr "" -#: ../../library/multiprocessing.rst:2205 +#: ../../library/multiprocessing.rst:2227 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2207 +#: ../../library/multiprocessing.rst:2229 msgid "" ">>> l_outer = manager.list([ manager.dict() for i in range(2) ])\n" ">>> d_first_inner = l_outer[0]\n" @@ -3302,7 +3308,7 @@ msgstr "" ">>> print(l_outer[1])\n" "{'c': 3, 'z': 26}" -#: ../../library/multiprocessing.rst:2218 +#: ../../library/multiprocessing.rst:2240 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -3313,7 +3319,7 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2226 +#: ../../library/multiprocessing.rst:2248 msgid "" "# create a list proxy and append a mutable object (a dictionary)\n" "lproxy = manager.list()\n" @@ -3327,20 +3333,20 @@ msgid "" "lproxy[0] = d" msgstr "" -#: ../../library/multiprocessing.rst:2237 +#: ../../library/multiprocessing.rst:2259 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2243 +#: ../../library/multiprocessing.rst:2265 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2246 +#: ../../library/multiprocessing.rst:2268 msgid "" ">>> manager.list([1,2,3]) == [1,2,3]\n" "False" @@ -3348,48 +3354,48 @@ msgstr "" ">>> manager.list([1,2,3]) == [1,2,3]\n" "False" -#: ../../library/multiprocessing.rst:2251 +#: ../../library/multiprocessing.rst:2273 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2255 +#: ../../library/multiprocessing.rst:2277 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2259 +#: ../../library/multiprocessing.rst:2281 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2261 +#: ../../library/multiprocessing.rst:2283 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2263 +#: ../../library/multiprocessing.rst:2285 msgid "proxy._callmethod(methodname, args, kwds)" msgstr "proxy._callmethod(methodname, args, kwds)" -#: ../../library/multiprocessing.rst:2265 +#: ../../library/multiprocessing.rst:2287 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2267 +#: ../../library/multiprocessing.rst:2289 msgid "getattr(obj, methodname)(*args, **kwds)" msgstr "getattr(obj, methodname)(*args, **kwds)" -#: ../../library/multiprocessing.rst:2269 +#: ../../library/multiprocessing.rst:2291 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2271 +#: ../../library/multiprocessing.rst:2293 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2275 +#: ../../library/multiprocessing.rst:2297 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -3397,17 +3403,17 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2280 +#: ../../library/multiprocessing.rst:2302 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2283 +#: ../../library/multiprocessing.rst:2305 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2285 +#: ../../library/multiprocessing.rst:2307 msgid "" ">>> l = manager.list(range(10))\n" ">>> l._callmethod('__len__')\n" @@ -3429,69 +3435,69 @@ msgstr "" "...\n" "IndexError: list index out of range" -#: ../../library/multiprocessing.rst:2299 +#: ../../library/multiprocessing.rst:2321 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2301 +#: ../../library/multiprocessing.rst:2323 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2305 +#: ../../library/multiprocessing.rst:2327 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2309 +#: ../../library/multiprocessing.rst:2331 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2313 +#: ../../library/multiprocessing.rst:2335 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2315 +#: ../../library/multiprocessing.rst:2337 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2318 +#: ../../library/multiprocessing.rst:2340 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2323 +#: ../../library/multiprocessing.rst:2345 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2328 +#: ../../library/multiprocessing.rst:2350 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2333 +#: ../../library/multiprocessing.rst:2355 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2337 +#: ../../library/multiprocessing.rst:2359 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.process_cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2340 -#: ../../library/multiprocessing.rst:2904 +#: ../../library/multiprocessing.rst:2362 +#: ../../library/multiprocessing.rst:2926 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2343 +#: ../../library/multiprocessing.rst:2365 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -3499,7 +3505,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2348 +#: ../../library/multiprocessing.rst:2370 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -3507,13 +3513,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2354 +#: ../../library/multiprocessing.rst:2376 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2358 +#: ../../library/multiprocessing.rst:2380 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -3521,28 +3527,28 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2363 +#: ../../library/multiprocessing.rst:2385 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2367 +#: ../../library/multiprocessing.rst:2389 msgid "Added the *maxtasksperchild* parameter." msgstr "新增 *maxtasksperchild* 參數。" -#: ../../library/multiprocessing.rst:2370 +#: ../../library/multiprocessing.rst:2392 msgid "Added the *context* parameter." msgstr "新增 *context* 參數。" -#: ../../library/multiprocessing.rst:2373 +#: ../../library/multiprocessing.rst:2395 msgid "" "*processes* uses :func:`os.process_cpu_count` by default, instead of :func:" "`os.cpu_count`." msgstr "" -#: ../../library/multiprocessing.rst:2379 +#: ../../library/multiprocessing.rst:2401 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -3553,7 +3559,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2389 +#: ../../library/multiprocessing.rst:2411 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -3561,14 +3567,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2396 +#: ../../library/multiprocessing.rst:2418 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2399 -#: ../../library/multiprocessing.rst:2430 +#: ../../library/multiprocessing.rst:2421 +#: ../../library/multiprocessing.rst:2452 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -3576,60 +3582,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2404 -#: ../../library/multiprocessing.rst:2435 +#: ../../library/multiprocessing.rst:2426 +#: ../../library/multiprocessing.rst:2457 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2408 -#: ../../library/multiprocessing.rst:2439 +#: ../../library/multiprocessing.rst:2430 +#: ../../library/multiprocessing.rst:2461 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2413 +#: ../../library/multiprocessing.rst:2435 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2417 +#: ../../library/multiprocessing.rst:2439 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2421 +#: ../../library/multiprocessing.rst:2443 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2427 +#: ../../library/multiprocessing.rst:2449 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2444 +#: ../../library/multiprocessing.rst:2466 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2446 +#: ../../library/multiprocessing.rst:2468 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2451 +#: ../../library/multiprocessing.rst:2473 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -3637,65 +3643,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2458 +#: ../../library/multiprocessing.rst:2480 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2464 +#: ../../library/multiprocessing.rst:2486 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2468 +#: ../../library/multiprocessing.rst:2490 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2475 +#: ../../library/multiprocessing.rst:2497 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2483 +#: ../../library/multiprocessing.rst:2505 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2488 +#: ../../library/multiprocessing.rst:2510 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2494 +#: ../../library/multiprocessing.rst:2516 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2497 +#: ../../library/multiprocessing.rst:2519 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2505 +#: ../../library/multiprocessing.rst:2527 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2510 +#: ../../library/multiprocessing.rst:2532 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -3703,31 +3709,31 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2517 +#: ../../library/multiprocessing.rst:2539 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2521 +#: ../../library/multiprocessing.rst:2543 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2525 +#: ../../library/multiprocessing.rst:2547 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2528 +#: ../../library/multiprocessing.rst:2550 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2532 +#: ../../library/multiprocessing.rst:2554 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2534 +#: ../../library/multiprocessing.rst:2556 msgid "" "from multiprocessing import Pool\n" "import time\n" @@ -3755,17 +3761,17 @@ msgid "" "TimeoutError" msgstr "" -#: ../../library/multiprocessing.rst:2559 +#: ../../library/multiprocessing.rst:2581 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2564 +#: ../../library/multiprocessing.rst:2586 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2568 +#: ../../library/multiprocessing.rst:2590 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -3774,46 +3780,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2577 +#: ../../library/multiprocessing.rst:2599 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2580 +#: ../../library/multiprocessing.rst:2602 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2586 +#: ../../library/multiprocessing.rst:2608 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2589 +#: ../../library/multiprocessing.rst:2611 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2594 +#: ../../library/multiprocessing.rst:2616 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2597 +#: ../../library/multiprocessing.rst:2619 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2601 -#: ../../library/multiprocessing.rst:2636 +#: ../../library/multiprocessing.rst:2623 +#: ../../library/multiprocessing.rst:2658 msgid "" "If *authkey* is given and not ``None``, it should be a byte string and will " "be used as the secret key for an HMAC-based authentication challenge. No " @@ -3822,26 +3828,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2609 +#: ../../library/multiprocessing.rst:2631 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2612 +#: ../../library/multiprocessing.rst:2634 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2617 +#: ../../library/multiprocessing.rst:2639 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2621 +#: ../../library/multiprocessing.rst:2643 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -3855,49 +3861,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2632 +#: ../../library/multiprocessing.rst:2654 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2644 +#: ../../library/multiprocessing.rst:2666 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2651 +#: ../../library/multiprocessing.rst:2673 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2655 +#: ../../library/multiprocessing.rst:2677 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2659 +#: ../../library/multiprocessing.rst:2681 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2663 +#: ../../library/multiprocessing.rst:2685 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2666 +#: ../../library/multiprocessing.rst:2688 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2673 +#: ../../library/multiprocessing.rst:2695 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -3906,32 +3912,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2679 +#: ../../library/multiprocessing.rst:2701 msgid "" "For both POSIX and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2682 +#: ../../library/multiprocessing.rst:2704 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2683 +#: ../../library/multiprocessing.rst:2705 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2684 +#: ../../library/multiprocessing.rst:2706 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2687 +#: ../../library/multiprocessing.rst:2709 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2690 +#: ../../library/multiprocessing.rst:2712 msgid "" "**POSIX**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -3939,7 +3945,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2696 +#: ../../library/multiprocessing.rst:2718 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -3949,18 +3955,18 @@ msgid "" "handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2706 +#: ../../library/multiprocessing.rst:2728 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2708 +#: ../../library/multiprocessing.rst:2730 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2712 +#: ../../library/multiprocessing.rst:2734 msgid "" "from multiprocessing.connection import Listener\n" "from array import array\n" @@ -3978,13 +3984,13 @@ msgid "" " conn.send_bytes(array('i', [42, 1729]))" msgstr "" -#: ../../library/multiprocessing.rst:2727 +#: ../../library/multiprocessing.rst:2749 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2730 +#: ../../library/multiprocessing.rst:2752 msgid "" "from multiprocessing.connection import Client\n" "from array import array\n" @@ -4014,13 +4020,13 @@ msgstr "" " print(conn.recv_bytes_into(arr)) # => 8\n" " print(arr) # => array('i', [42, 1729, 0, 0, 0])" -#: ../../library/multiprocessing.rst:2744 +#: ../../library/multiprocessing.rst:2766 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2747 +#: ../../library/multiprocessing.rst:2769 msgid "" "from multiprocessing import Process, Pipe, current_process\n" "from multiprocessing.connection import wait\n" @@ -4054,23 +4060,23 @@ msgid "" " print(msg)" msgstr "" -#: ../../library/multiprocessing.rst:2782 +#: ../../library/multiprocessing.rst:2804 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2784 +#: ../../library/multiprocessing.rst:2806 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2787 +#: ../../library/multiprocessing.rst:2809 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2790 +#: ../../library/multiprocessing.rst:2812 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -4079,17 +4085,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2795 +#: ../../library/multiprocessing.rst:2817 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2802 +#: ../../library/multiprocessing.rst:2824 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2804 +#: ../../library/multiprocessing.rst:2826 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -4097,7 +4103,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2810 +#: ../../library/multiprocessing.rst:2832 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -4105,7 +4111,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2816 +#: ../../library/multiprocessing.rst:2838 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -4116,17 +4122,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2846 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2828 +#: ../../library/multiprocessing.rst:2850 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2830 +#: ../../library/multiprocessing.rst:2852 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -4134,27 +4140,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2837 +#: ../../library/multiprocessing.rst:2859 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2840 +#: ../../library/multiprocessing.rst:2862 msgid "" "When first created the logger has level :const:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2844 +#: ../../library/multiprocessing.rst:2866 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2851 +#: ../../library/multiprocessing.rst:2873 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -4163,11 +4169,11 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2857 +#: ../../library/multiprocessing.rst:2879 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2859 +#: ../../library/multiprocessing.rst:2881 msgid "" ">>> import multiprocessing, logging\n" ">>> logger = multiprocessing.log_to_stderr()\n" @@ -4195,21 +4201,21 @@ msgstr "" "[INFO/MainProcess] sending shutdown message to manager\n" "[INFO/SyncManager-...] manager exiting with exitcode 0" -#: ../../library/multiprocessing.rst:2872 +#: ../../library/multiprocessing.rst:2894 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2876 +#: ../../library/multiprocessing.rst:2898 msgid "The :mod:`multiprocessing.dummy` module" msgstr ":mod:`multiprocessing.dummy` 模組" -#: ../../library/multiprocessing.rst:2881 +#: ../../library/multiprocessing.rst:2903 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2886 +#: ../../library/multiprocessing.rst:2908 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -4217,7 +4223,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2894 +#: ../../library/multiprocessing.rst:2916 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -4227,18 +4233,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2901 +#: ../../library/multiprocessing.rst:2923 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.process_cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2907 +#: ../../library/multiprocessing.rst:2929 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2911 +#: ../../library/multiprocessing.rst:2933 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -4248,7 +4254,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2918 +#: ../../library/multiprocessing.rst:2940 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -4257,69 +4263,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2928 +#: ../../library/multiprocessing.rst:2950 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2930 +#: ../../library/multiprocessing.rst:2952 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2935 +#: ../../library/multiprocessing.rst:2957 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2937 +#: ../../library/multiprocessing.rst:2959 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2939 +#: ../../library/multiprocessing.rst:2961 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2941 +#: ../../library/multiprocessing.rst:2963 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2944 +#: ../../library/multiprocessing.rst:2966 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:2948 +#: ../../library/multiprocessing.rst:2970 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2950 +#: ../../library/multiprocessing.rst:2972 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2952 +#: ../../library/multiprocessing.rst:2974 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2954 +#: ../../library/multiprocessing.rst:2976 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2957 +#: ../../library/multiprocessing.rst:2979 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2959 +#: ../../library/multiprocessing.rst:2981 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2961 +#: ../../library/multiprocessing.rst:2983 msgid "" "On POSIX when a process finishes but has not been joined it becomes a " "zombie. There should never be very many because each time a new process " @@ -4330,11 +4336,11 @@ msgid "" "explicitly join all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2969 +#: ../../library/multiprocessing.rst:2991 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2971 +#: ../../library/multiprocessing.rst:2993 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -4344,11 +4350,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2979 +#: ../../library/multiprocessing.rst:3001 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2981 +#: ../../library/multiprocessing.rst:3003 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -4356,18 +4362,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2987 +#: ../../library/multiprocessing.rst:3009 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:2991 +#: ../../library/multiprocessing.rst:3013 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2993 +#: ../../library/multiprocessing.rst:3015 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -4376,7 +4382,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2999 +#: ../../library/multiprocessing.rst:3021 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -4385,11 +4391,11 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:3005 +#: ../../library/multiprocessing.rst:3027 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:3007 +#: ../../library/multiprocessing.rst:3029 msgid "" "from multiprocessing import Process, Queue\n" "\n" @@ -4404,17 +4410,17 @@ msgid "" " obj = queue.get()" msgstr "" -#: ../../library/multiprocessing.rst:3019 +#: ../../library/multiprocessing.rst:3041 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:3022 +#: ../../library/multiprocessing.rst:3044 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:3024 +#: ../../library/multiprocessing.rst:3046 msgid "" "On POSIX using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -4422,7 +4428,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:3029 +#: ../../library/multiprocessing.rst:3051 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -4431,11 +4437,11 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:3036 +#: ../../library/multiprocessing.rst:3058 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:3038 +#: ../../library/multiprocessing.rst:3060 msgid "" "from multiprocessing import Process, Lock\n" "\n" @@ -4457,11 +4463,11 @@ msgstr "" " for i in range(10):\n" " Process(target=f).start()" -#: ../../library/multiprocessing.rst:3048 +#: ../../library/multiprocessing.rst:3070 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:3050 +#: ../../library/multiprocessing.rst:3072 msgid "" "from multiprocessing import Process, Lock\n" "\n" @@ -4483,25 +4489,25 @@ msgstr "" " for i in range(10):\n" " Process(target=f, args=(lock,)).start()" -#: ../../library/multiprocessing.rst:3060 +#: ../../library/multiprocessing.rst:3082 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:3062 +#: ../../library/multiprocessing.rst:3084 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:3064 +#: ../../library/multiprocessing.rst:3086 msgid "os.close(sys.stdin.fileno())" msgstr "os.close(sys.stdin.fileno())" -#: ../../library/multiprocessing.rst:3066 +#: ../../library/multiprocessing.rst:3088 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:3069 +#: ../../library/multiprocessing.rst:3091 msgid "" "sys.stdin.close()\n" "sys.stdin = open(os.open(os.devnull, os.O_RDONLY), closefd=False)" @@ -4509,7 +4515,7 @@ msgstr "" "sys.stdin.close()\n" "sys.stdin = open(os.open(os.devnull, os.O_RDONLY), closefd=False)" -#: ../../library/multiprocessing.rst:3072 +#: ../../library/multiprocessing.rst:3094 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -4519,14 +4525,14 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:3079 +#: ../../library/multiprocessing.rst:3101 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:3083 +#: ../../library/multiprocessing.rst:3105 msgid "" "@property\n" "def cache(self):\n" @@ -4544,26 +4550,26 @@ msgstr "" " self._cache = []\n" " return self._cache" -#: ../../library/multiprocessing.rst:3091 +#: ../../library/multiprocessing.rst:3113 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:3097 +#: ../../library/multiprocessing.rst:3119 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:3099 +#: ../../library/multiprocessing.rst:3121 msgid "" "There are a few extra restrictions which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:3102 +#: ../../library/multiprocessing.rst:3124 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:3104 +#: ../../library/multiprocessing.rst:3126 msgid "" "Ensure that all arguments to :class:`~multiprocessing.Process` are " "picklable. Also, if you subclass ``Process.__init__``, you must make sure " @@ -4571,11 +4577,11 @@ msgid "" "` method is called." msgstr "" -#: ../../library/multiprocessing.rst:3109 +#: ../../library/multiprocessing.rst:3131 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:3111 +#: ../../library/multiprocessing.rst:3133 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -4583,30 +4589,30 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:3116 +#: ../../library/multiprocessing.rst:3138 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:3121 +#: ../../library/multiprocessing.rst:3143 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:3123 +#: ../../library/multiprocessing.rst:3145 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:3127 +#: ../../library/multiprocessing.rst:3149 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:3131 +#: ../../library/multiprocessing.rst:3153 msgid "" "from multiprocessing import Process\n" "\n" @@ -4624,13 +4630,13 @@ msgstr "" "p = Process(target=foo)\n" "p.start()" -#: ../../library/multiprocessing.rst:3139 +#: ../../library/multiprocessing.rst:3161 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:3142 +#: ../../library/multiprocessing.rst:3164 msgid "" "from multiprocessing import Process, freeze_support, set_start_method\n" "\n" @@ -4654,33 +4660,33 @@ msgstr "" " p = Process(target=foo)\n" " p.start()" -#: ../../library/multiprocessing.rst:3153 +#: ../../library/multiprocessing.rst:3175 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:3156 +#: ../../library/multiprocessing.rst:3178 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:3159 +#: ../../library/multiprocessing.rst:3181 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3166 +#: ../../library/multiprocessing.rst:3188 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3168 +#: ../../library/multiprocessing.rst:3190 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3170 +#: ../../library/multiprocessing.rst:3192 msgid "" "from multiprocessing import freeze_support\n" "from multiprocessing.managers import BaseManager, BaseProxy\n" @@ -4774,11 +4780,11 @@ msgid "" " test()\n" msgstr "" -#: ../../library/multiprocessing.rst:3174 +#: ../../library/multiprocessing.rst:3196 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "使用 :class:`~multiprocessing.pool.Pool`:" -#: ../../library/multiprocessing.rst:3176 +#: ../../library/multiprocessing.rst:3198 msgid "" "import multiprocessing\n" "import time\n" @@ -4938,13 +4944,13 @@ msgid "" " test()\n" msgstr "" -#: ../../library/multiprocessing.rst:3180 +#: ../../library/multiprocessing.rst:3202 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" msgstr "" -#: ../../library/multiprocessing.rst:3183 +#: ../../library/multiprocessing.rst:3205 msgid "" "import time\n" "import random\n" diff --git a/library/stdtypes.po b/library/stdtypes.po index 561cd75a32..8a3e100bc8 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-25 00:13+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -693,7 +693,8 @@ msgstr "" "算:" #: ../../library/stdtypes.rst:374 -msgid ":func:`math.trunc(\\ x) `" +#, fuzzy +msgid ":func:`math.trunc( x) `" msgstr ":func:`math.trunc(\\ x) `" #: ../../library/stdtypes.rst:374 @@ -711,7 +712,8 @@ msgid "" msgstr "*x* 進位至小數點後第 *n* 位,使用偶數捨入法。若省略 *n* ,則預設為 0。" #: ../../library/stdtypes.rst:381 -msgid ":func:`math.floor(\\ x) `" +#, fuzzy +msgid ":func:`math.floor( x) `" msgstr ":func:`math.floor(\\ x) `" #: ../../library/stdtypes.rst:381 diff --git a/library/tkinter.font.po b/library/tkinter.font.po index 23fe238c81..b2b3a10acc 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2024-02-15 23:09+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -52,15 +52,15 @@ msgstr "" msgid "arguments:" msgstr "引數:" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:32 msgid "*font* - font specifier tuple (family, size, options)" msgstr "*font* - 字型指定符號元組 (family, size, options)" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:33 msgid "*name* - unique font name" msgstr "*name* - 獨特字型名稱" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:34 msgid "*exists* - self points to existing named font if true" msgstr "*exists* - 如果存在的話,指向現有的已命名字型" @@ -68,39 +68,39 @@ msgstr "*exists* - 如果存在的話,指向現有的已命名字型" msgid "additional keyword options (ignored if *font* is specified):" msgstr "額外的關鍵字選項(若已指定 *font* 則會忽略):" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:38 msgid "*family* - font family i.e. Courier, Times" msgstr "*family* - 字型家族,例如:Courier、Times" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:39 msgid "*size* - font size" msgstr "*size* - 字級" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:40 msgid "If *size* is positive it is interpreted as size in points." msgstr "如果 *size* 是正數則會直譯成以點 (point) 為單位的字級。" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:41 msgid "If *size* is a negative number its absolute value is treated" msgstr "如果 *size* 是負數則會變成絕對值" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:42 msgid "as size in pixels." msgstr "以像素 (pixel) 為單位的字級。" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:43 msgid "*weight* - font emphasis (NORMAL, BOLD)" msgstr "*weight* - 強調字型,例如:NORMAL(標準體)、BOLD(粗體)" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:44 msgid "*slant* - ROMAN, ITALIC" msgstr "*slant* - 例如:ROMAN(正體)、ITALIC(斜體)" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:45 msgid "*underline* - font underlining (0 - none, 1 - underline)" msgstr "*underline* - 字型加上底線(0 - 無底線、 1 - 加上底線)" -#: ../../library/tkinter.font.rst:0 +#: ../../library/tkinter.font.rst:46 msgid "*overstrike* - font strikeout (0 - none, 1 - strikeout)" msgstr "*overstrike* - 字型加上刪除線(0 - 無刪除線、 1 - 加上刪除線)" diff --git a/library/turtle.po b/library/turtle.po index c2139ceb15..4a251a317e 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-12 00:16+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,6 +61,10 @@ msgid "" "degrees clockwise." msgstr "" +#: ../../library/turtle.rst:43 +msgid "Turtle star" +msgstr "" + #: ../../library/turtle.rst:45 msgid "" "Turtle can draw intricate shapes using programs that repeat simple moves." @@ -547,71 +551,71 @@ msgstr "" msgid "Move and draw" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:336 msgid ":func:`forward` | :func:`fd`" msgstr ":func:`forward` | :func:`fd`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:337 msgid ":func:`backward` | :func:`bk` | :func:`back`" msgstr ":func:`backward` | :func:`bk` | :func:`back`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:338 msgid ":func:`right` | :func:`rt`" msgstr ":func:`right` | :func:`rt`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:339 msgid ":func:`left` | :func:`lt`" msgstr ":func:`left` | :func:`lt`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:340 msgid ":func:`goto` | :func:`setpos` | :func:`setposition`" msgstr ":func:`goto` | :func:`setpos` | :func:`setposition`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:341 msgid ":func:`teleport`" msgstr ":func:`teleport`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:342 msgid ":func:`setx`" msgstr ":func:`setx`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:343 msgid ":func:`sety`" msgstr ":func:`sety`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:344 msgid ":func:`setheading` | :func:`seth`" msgstr ":func:`setheading` | :func:`seth`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:345 msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2864 +#: ../../library/turtle.rst:346 ../../library/turtle.rst:2864 msgid ":func:`circle`" msgstr ":func:`circle`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:347 msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2842 +#: ../../library/turtle.rst:348 ../../library/turtle.rst:2842 msgid ":func:`stamp`" msgstr ":func:`stamp`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:349 msgid ":func:`clearstamp`" msgstr ":func:`clearstamp`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:350 msgid ":func:`clearstamps`" msgstr ":func:`clearstamps`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:351 msgid ":func:`undo`" msgstr ":func:`undo`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:352 msgid ":func:`speed`" msgstr ":func:`speed`" @@ -619,27 +623,27 @@ msgstr ":func:`speed`" msgid "Tell Turtle's state" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:355 msgid ":func:`position` | :func:`pos`" msgstr ":func:`position` | :func:`pos`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:356 msgid ":func:`towards`" msgstr ":func:`towards`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:357 msgid ":func:`xcor`" msgstr ":func:`xcor`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:358 msgid ":func:`ycor`" msgstr ":func:`ycor`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:359 msgid ":func:`heading`" msgstr ":func:`heading`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:360 msgid ":func:`distance`" msgstr ":func:`distance`" @@ -647,11 +651,11 @@ msgstr ":func:`distance`" msgid "Setting and measurement" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:363 msgid ":func:`degrees`" msgstr ":func:`degrees`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:364 msgid ":func:`radians`" msgstr ":func:`radians`" @@ -659,23 +663,23 @@ msgstr ":func:`radians`" msgid "Drawing state" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:368 msgid ":func:`pendown` | :func:`pd` | :func:`down`" msgstr ":func:`pendown` | :func:`pd` | :func:`down`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:369 msgid ":func:`penup` | :func:`pu` | :func:`up`" msgstr ":func:`penup` | :func:`pu` | :func:`up`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:370 msgid ":func:`pensize` | :func:`width`" msgstr ":func:`pensize` | :func:`width`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:371 msgid ":func:`pen`" msgstr ":func:`pen`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:372 msgid ":func:`isdown`" msgstr ":func:`isdown`" @@ -683,15 +687,15 @@ msgstr ":func:`isdown`" msgid "Color control" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:375 msgid ":func:`color`" msgstr ":func:`color`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:376 msgid ":func:`pencolor`" msgstr ":func:`pencolor`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:377 msgid ":func:`fillcolor`" msgstr ":func:`fillcolor`" @@ -699,19 +703,19 @@ msgstr ":func:`fillcolor`" msgid "Filling" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:380 msgid ":func:`filling`" msgstr ":func:`filling`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:381 msgid ":func:`fill`" msgstr ":func:`fill`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:382 msgid ":func:`begin_fill`" msgstr ":func:`begin_fill`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:383 msgid ":func:`end_fill`" msgstr ":func:`end_fill`" @@ -719,15 +723,15 @@ msgstr ":func:`end_fill`" msgid "More drawing control" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:386 msgid ":func:`reset`" msgstr ":func:`reset`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:387 msgid ":func:`clear`" msgstr ":func:`clear`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:388 msgid ":func:`write`" msgstr ":func:`write`" @@ -739,15 +743,15 @@ msgstr "" msgid "Visibility" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:392 msgid ":func:`showturtle` | :func:`st`" msgstr ":func:`showturtle` | :func:`st`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:393 msgid ":func:`hideturtle` | :func:`ht`" msgstr ":func:`hideturtle` | :func:`ht`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:394 msgid ":func:`isvisible`" msgstr ":func:`isvisible`" @@ -755,35 +759,35 @@ msgstr ":func:`isvisible`" msgid "Appearance" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:397 msgid ":func:`shape`" msgstr ":func:`shape`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:398 msgid ":func:`resizemode`" msgstr ":func:`resizemode`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:399 msgid ":func:`shapesize` | :func:`turtlesize`" msgstr ":func:`shapesize` | :func:`turtlesize`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:400 msgid ":func:`shearfactor`" msgstr ":func:`shearfactor`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:401 msgid ":func:`tiltangle`" msgstr ":func:`tiltangle`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:402 msgid ":func:`tilt`" msgstr ":func:`tilt`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:403 msgid ":func:`shapetransform`" msgstr ":func:`shapetransform`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:404 msgid ":func:`get_shapepoly`" msgstr ":func:`get_shapepoly`" @@ -791,15 +795,15 @@ msgstr ":func:`get_shapepoly`" msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2836 +#: ../../library/turtle.rst:407 ../../library/turtle.rst:2836 msgid ":func:`onclick`" msgstr ":func:`onclick`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:408 msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2819 +#: ../../library/turtle.rst:409 ../../library/turtle.rst:2819 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" @@ -807,39 +811,39 @@ msgstr ":func:`ondrag`" msgid "Special Turtle methods" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:412 msgid ":func:`poly`" msgstr ":func:`poly`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:413 msgid ":func:`begin_poly`" msgstr ":func:`begin_poly`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:414 msgid ":func:`end_poly`" msgstr ":func:`end_poly`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:415 msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2858 +#: ../../library/turtle.rst:416 ../../library/turtle.rst:2858 msgid ":func:`clone`" msgstr ":func:`clone`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:417 msgid ":func:`getturtle` | :func:`getpen`" msgstr ":func:`getturtle` | :func:`getpen`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:418 msgid ":func:`getscreen`" msgstr ":func:`getscreen`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:419 msgid ":func:`setundobuffer`" msgstr ":func:`setundobuffer`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:420 msgid ":func:`undobufferentries`" msgstr ":func:`undobufferentries`" @@ -851,27 +855,27 @@ msgstr "" msgid "Window control" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:427 msgid ":func:`bgcolor`" msgstr ":func:`bgcolor`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:428 msgid ":func:`bgpic`" msgstr ":func:`bgpic`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:429 msgid ":func:`clearscreen`" msgstr ":func:`clearscreen`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:430 msgid ":func:`resetscreen`" msgstr ":func:`resetscreen`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:431 msgid ":func:`screensize`" msgstr ":func:`screensize`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:432 msgid ":func:`setworldcoordinates`" msgstr ":func:`setworldcoordinates`" @@ -879,19 +883,19 @@ msgstr ":func:`setworldcoordinates`" msgid "Animation control" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:435 msgid ":func:`no_animation`" msgstr ":func:`no_animation`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:436 msgid ":func:`delay`" msgstr ":func:`delay`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:437 msgid ":func:`tracer`" msgstr ":func:`tracer`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:438 msgid ":func:`update`" msgstr ":func:`update`" @@ -899,27 +903,27 @@ msgstr ":func:`update`" msgid "Using screen events" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:441 msgid ":func:`listen`" msgstr ":func:`listen`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:442 msgid ":func:`onkey` | :func:`onkeyrelease`" msgstr ":func:`onkey` | :func:`onkeyrelease`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:443 msgid ":func:`onkeypress`" msgstr ":func:`onkeypress`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:444 msgid ":func:`onclick` | :func:`onscreenclick`" msgstr ":func:`onclick` | :func:`onscreenclick`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:445 msgid ":func:`ontimer`" msgstr ":func:`ontimer`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:446 msgid ":func:`mainloop` | :func:`done`" msgstr ":func:`mainloop` | :func:`done`" @@ -927,35 +931,35 @@ msgstr ":func:`mainloop` | :func:`done`" msgid "Settings and special methods" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:449 msgid ":func:`mode`" msgstr ":func:`mode`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:450 msgid ":func:`colormode`" msgstr ":func:`colormode`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:451 msgid ":func:`getcanvas`" msgstr ":func:`getcanvas`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:452 msgid ":func:`getshapes`" msgstr ":func:`getshapes`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:453 msgid ":func:`register_shape` | :func:`addshape`" msgstr ":func:`register_shape` | :func:`addshape`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:454 msgid ":func:`turtles`" msgstr ":func:`turtles`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:455 msgid ":func:`window_height`" msgstr ":func:`window_height`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:456 msgid ":func:`window_width`" msgstr ":func:`window_width`" @@ -963,11 +967,11 @@ msgstr ":func:`window_width`" msgid "Input methods" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:459 msgid ":func:`textinput`" msgstr ":func:`textinput`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:460 msgid ":func:`numinput`" msgstr ":func:`numinput`" @@ -975,23 +979,23 @@ msgstr ":func:`numinput`" msgid "Methods specific to Screen" msgstr "" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:463 msgid ":func:`bye`" msgstr ":func:`bye`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:464 msgid ":func:`exitonclick`" msgstr ":func:`exitonclick`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:465 msgid ":func:`save`" msgstr ":func:`save`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:466 msgid ":func:`setup`" msgstr ":func:`setup`" -#: ../../library/turtle.rst:0 +#: ../../library/turtle.rst:467 msgid ":func:`title`" msgstr ":func:`title`" diff --git a/library/xml.sax.handler.po b/library/xml.sax.handler.po index 2dea812f61..56431110ec 100644 --- a/library/xml.sax.handler.po +++ b/library/xml.sax.handler.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-30 00:16+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -87,7 +87,7 @@ msgstr "" msgid "true: Perform Namespace processing." msgstr "" -#: ../../library/xml.sax.handler.rst:65 +#: ../../library/xml.sax.handler.rst:64 msgid "" "false: Optionally do not perform Namespace processing (implies namespace-" "prefixes; default)." @@ -104,13 +104,13 @@ msgstr "" msgid "value: ``\"http://xml.org/sax/features/namespace-prefixes\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:73 +#: ../../library/xml.sax.handler.rst:72 msgid "" "true: Report the original prefixed names and attributes used for Namespace " "declarations." msgstr "" -#: ../../library/xml.sax.handler.rst:75 +#: ../../library/xml.sax.handler.rst:74 msgid "" "false: Do not report attributes used for Namespace declarations, and " "optionally do not report original prefixed names (default)." @@ -120,7 +120,7 @@ msgstr "" msgid "value: ``\"http://xml.org/sax/features/string-interning\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:83 +#: ../../library/xml.sax.handler.rst:82 msgid "" "true: All element names, prefixes, attribute names, Namespace URIs, and " "local names are interned using the built-in intern function." @@ -135,7 +135,7 @@ msgstr "" msgid "value: ``\"http://xml.org/sax/features/validation\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:92 +#: ../../library/xml.sax.handler.rst:91 msgid "" "true: Report all validation errors (implies external-general-entities and " "external-parameter-entities)." @@ -169,13 +169,13 @@ msgstr "" msgid "value: ``\"http://xml.org/sax/features/external-parameter-entities\"``" msgstr "" -#: ../../library/xml.sax.handler.rst:117 +#: ../../library/xml.sax.handler.rst:116 msgid "" "true: Include all external parameter entities, including the external DTD " "subset." msgstr "" -#: ../../library/xml.sax.handler.rst:119 +#: ../../library/xml.sax.handler.rst:118 msgid "" "false: Do not include any external parameter entities, even the external DTD " "subset." @@ -193,7 +193,7 @@ msgstr "" msgid "data type: xml.sax.handler.LexicalHandler (not supported in Python 2)" msgstr "" -#: ../../library/xml.sax.handler.rst:133 +#: ../../library/xml.sax.handler.rst:132 msgid "" "description: An optional extension handler for lexical events like comments." msgstr "" @@ -210,7 +210,7 @@ msgstr "" msgid "data type: xml.sax.sax2lib.DeclHandler (not supported in Python 2)" msgstr "" -#: ../../library/xml.sax.handler.rst:142 +#: ../../library/xml.sax.handler.rst:141 msgid "" "description: An optional extension handler for DTD-related events other than " "notations and unparsed entities." @@ -224,7 +224,7 @@ msgstr "" msgid "data type: org.w3c.dom.Node (not supported in Python 2)" msgstr "" -#: ../../library/xml.sax.handler.rst:151 +#: ../../library/xml.sax.handler.rst:150 msgid "" "description: When parsing, the current DOM node being visited if this is a " "DOM iterator; when not parsing, the root DOM node for iteration." @@ -238,7 +238,7 @@ msgstr "" msgid "data type: Bytes" msgstr "" -#: ../../library/xml.sax.handler.rst:160 +#: ../../library/xml.sax.handler.rst:159 msgid "" "description: The literal string of characters that was the source for the " "current event." diff --git a/reference/executionmodel.po b/reference/executionmodel.po index d09914b954..036403c608 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -591,15 +591,17 @@ msgid "" "how it runs on the host look something like this:" msgstr "" -#: ../../reference/executionmodel.rst:0 +#: ../../reference/executionmodel.rst:415 +#: ../../reference/executionmodel.rst:474 msgid "**host machine**" msgstr "" -#: ../../reference/executionmodel.rst:0 +#: ../../reference/executionmodel.rst:416 +#: ../../reference/executionmodel.rst:475 msgid "**process** (global resources)" msgstr "" -#: ../../reference/executionmodel.rst:0 +#: ../../reference/executionmodel.rst:417 msgid "**thread** (runs machine code)" msgstr "" @@ -681,19 +683,19 @@ msgid "" "data layers specific to Python:" msgstr "" -#: ../../reference/executionmodel.rst:0 +#: ../../reference/executionmodel.rst:476 msgid "Python global runtime (*state*)" msgstr "" -#: ../../reference/executionmodel.rst:0 +#: ../../reference/executionmodel.rst:477 msgid "Python interpreter (*state*)" msgstr "" -#: ../../reference/executionmodel.rst:0 +#: ../../reference/executionmodel.rst:478 msgid "**thread** (runs Python bytecode and \"C-API\")" msgstr "" -#: ../../reference/executionmodel.rst:0 +#: ../../reference/executionmodel.rst:479 msgid "Python thread *state*" msgstr "" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 2b9178f6a6..33a6e2225f 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,11 +34,10 @@ msgid "" "that a secondary prompt on a line by itself in an example means you must " "type a blank line; this is used to end a multi-line command." msgstr "" -"在下面的例子中,輸入與輸出的區別在於有無提示字元(prompt,:term:`>>>` " -"和 :term:`...`\\ ):如果要重做範例,你必須在提示字元出現的時候,輸入提示字元" -"後方的所有內容;那些非提示字元開始的文字行是直譯器的輸出。注意到在範例中,若" -"出現單行只有次提示字元時,代表該行你必須直接換行;這被使用在多行指令結束輸入" -"時。" +"在下面的例子中,輸入與輸出的區別在於有無提示字元(prompt,:term:`>>>` 和 :" +"term:`...`\\ ):如果要重做範例,你必須在提示字元出現的時候,輸入提示字元後方" +"的所有內容;那些非提示字元開始的文字行是直譯器的輸出。注意到在範例中,若出現" +"單行只有次提示字元時,代表該行你必須直接換行;這被使用在多行指令結束輸入時。" #: ../../tutorial/introduction.rst:16 msgid "" @@ -99,8 +98,9 @@ msgid "Numbers" msgstr "數字 (Number)" #: ../../tutorial/introduction.rst:52 +#, fuzzy msgid "" -"The interpreter acts as a simple calculator: you can type an expression at " +"The interpreter acts as a simple calculator: you can type an expression into " "it and it will write the value. Expression syntax is straightforward: the " "operators ``+``, ``-``, ``*`` and ``/`` can be used to perform arithmetic; " "parentheses (``()``) can be used for grouping. For example::" @@ -132,9 +132,8 @@ msgstr "" #: ../../tutorial/introduction.rst:67 msgid "" "The integer numbers (e.g. ``2``, ``4``, ``20``) have type :class:`int`, the " -"ones with a fractional part (e.g. ``5.0``, ``1.6``) have " -"type :class:`float`. We will see more about numeric types later in the " -"tutorial." +"ones with a fractional part (e.g. ``5.0``, ``1.6``) have type :class:" +"`float`. We will see more about numeric types later in the tutorial." msgstr "" "整數數字(即 ``2``、``4``、``20``)為 :class:`int` 型別,數字有小數點部份的" "(即 ``5.0``、``1.6``)為 :class:`float` 型別。我們將在之後的教學中看到更多數" @@ -286,15 +285,15 @@ msgstr "" #: ../../tutorial/introduction.rst:131 msgid "" "In addition to :class:`int` and :class:`float`, Python supports other types " -"of numbers, such as :class:`~decimal.Decimal` " -"and :class:`~fractions.Fraction`. Python also has built-in support " -"for :ref:`complex numbers `, and uses the ``j`` or ``J`` " -"suffix to indicate the imaginary part (e.g. ``3+5j``)." +"of numbers, such as :class:`~decimal.Decimal` and :class:`~fractions." +"Fraction`. Python also has built-in support for :ref:`complex numbers " +"`, and uses the ``j`` or ``J`` suffix to indicate the " +"imaginary part (e.g. ``3+5j``)." msgstr "" -"除了 :class:`int` 和 :class:`float`,Python 還支援了其他的數字型別,包" -"含 :class:`~decimal.Decimal` 和 :class:`~fractions.Fraction`。Python 亦內建支" -"援\\ :ref:`複數 (complex numbers) `,並使用 ``j`` 和 ``J`` 後綴" -"來指定虛數的部份(即 ``3+5j``)。" +"除了 :class:`int` 和 :class:`float`,Python 還支援了其他的數字型別,包含 :" +"class:`~decimal.Decimal` 和 :class:`~fractions.Fraction`。Python 亦內建支援" +"\\ :ref:`複數 (complex numbers) `,並使用 ``j`` 和 ``J`` 後綴來" +"指定虛數的部份(即 ``3+5j``)。" #: ../../tutorial/introduction.rst:141 msgid "Text" @@ -936,11 +935,11 @@ msgstr "" #: ../../tutorial/introduction.rst:422 msgid "" -"You can also add new items at the end of the list, by using " -"the :meth:`list.append` *method* (we will see more about methods later)::" +"You can also add new items at the end of the list, by using the :meth:`list." +"append` *method* (we will see more about methods later)::" msgstr "" -"你也可以在 list 的最後加入新元素,透過使用 :meth:`list.append` *方法*\\ " -"(我們稍後會看到更多方法的說明): ::" +"你也可以在 list 的最後加入新元素,透過使用 :meth:`list.append` *方法*\\ (我" +"們稍後會看到更多方法的說明): ::" #: ../../tutorial/introduction.rst:425 msgid "" diff --git a/using/configure.po b/using/configure.po index 05f3ed6bcc..9aad1a3c2c 100644 --- a/using/configure.po +++ b/using/configure.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 16:45+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -196,11 +196,11 @@ msgstr ":mod:`curses`" msgid "`OpenSSL `_" msgstr "`OpenSSL `_" -#: ../../using/configure.rst:0 +#: ../../using/configure.rst:97 msgid "3.0.18 recommended" msgstr "" -#: ../../using/configure.rst:0 +#: ../../using/configure.rst:98 msgid "(1.1.1 minimum)" msgstr "" @@ -329,7 +329,8 @@ msgid "" "OpenSSL 1.1.1 is now required for :mod:`hashlib` and :mod:`ssl`. SQLite " "3.7.15 is now required for :mod:`sqlite3`." msgstr "" -":mod:`hashlib` 和 :mod:`ssl` 現在需要 OpenSSL 1.1.1。:mod:`sqlite3` 現在需要 SQLite 3.7.15。" +":mod:`hashlib` 和 :mod:`ssl` 現在需要 OpenSSL 1.1.1。:mod:`sqlite3` 現在需要 " +"SQLite 3.7.15。" #: ../../using/configure.rst:153 msgid "Tcl/Tk version 8.5.12 is now required for :mod:`tkinter`." diff --git a/using/windows.po b/using/windows.po index a052607d86..44cb2fdffe 100644 --- a/using/windows.po +++ b/using/windows.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-14 19:37+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2289,9 +2289,10 @@ msgid "The default installation directory for all-user installs" msgstr "" #: ../../using/windows.rst:1411 +#, fuzzy msgid "" -":file:`%ProgramFiles%\\\\\\ Python X.Y` or :file:`\\ %ProgramFiles(x86)%\\\\" -"\\ Python X.Y`" +":file:`%ProgramFiles%\\\\ Python X.Y` or :file:` %ProgramFiles(x86)%\\\\ " +"Python X.Y`" msgstr "" ":file:`%ProgramFiles%\\\\\\ Python X.Y` 或 :file:`\\ %ProgramFiles(x86)%\\\\" "\\ Python X.Y`" @@ -2305,10 +2306,11 @@ msgid "The default install directory for just-for-me installs" msgstr "預設安裝目錄給 只有給我 安裝方式" #: ../../using/windows.rst:1416 +#, fuzzy msgid "" -":file:`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY` or :file:" -"`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-32` or :file:" -"`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-64`" +":file:`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY` or :file:" +"`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-32` or :file:" +"`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-64`" msgstr "" ":file:`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY` 或 :file:" "`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-32` 或 :file:" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 71e9f4f35b..af313e7247 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,8 +33,8 @@ msgstr "Pablo Galindo Salgado" #: ../../whatsnew/3.11.rst:47 msgid "" "This article explains the new features in Python 3.11, compared to 3.10. " -"Python 3.11 was released on October 24, 2022. For full details, see " -"the :ref:`changelog `." +"Python 3.11 was released on October 24, 2022. For full details, see the :ref:" +"`changelog `." msgstr "" "此文章解釋了 Python 3.11 和 3.10 相比多了哪些新功能。Python 3.11 於 2022 年 " "10 月 24 日發布。完整細節請見 :ref:`changelog`。" @@ -46,8 +46,8 @@ msgstr "發布重點摘要" #: ../../whatsnew/3.11.rst:60 msgid "" "Python 3.11 is between 10-60% faster than Python 3.10. On average, we " -"measured a 1.25x speedup on the standard benchmark suite. " -"See :ref:`whatsnew311-faster-cpython` for details." +"measured a 1.25x speedup on the standard benchmark suite. See :ref:" +"`whatsnew311-faster-cpython` for details." msgstr "" "Python 3.11 比 Python 3.10 快了 10-60%。我們使用了標準基準量測套裝軟體 " "(benchmark suite) 測得平均加速了 1.25x。細節請見\\ :ref:`whatsnew311-faster-" @@ -244,13 +244,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:159 msgid "" "Additionally, the information used by the enhanced traceback feature is made " -"available via a general API, that can be used to " -"correlate :term:`bytecode` :ref:`instructions ` with source code " -"location. This information can be retrieved using:" +"available via a general API, that can be used to correlate :term:`bytecode` :" +"ref:`instructions ` with source code location. This information " +"can be retrieved using:" msgstr "" -"此外,強化回溯特性所使用的資訊可以透過一般的 API 來取得,以用來" -"使 :term:`bytecode` :ref:`指示 (instruction) `\\ 與原始碼位置相互" -"關聯。此項資訊可以用以下方式取得:" +"此外,強化回溯特性所使用的資訊可以透過一般的 API 來取得,以用來使 :term:" +"`bytecode` :ref:`指示 (instruction) `\\ 與原始碼位置相互關聯。此項" +"資訊可以用以下方式取得:" #: ../../whatsnew/3.11.rst:164 msgid "The :meth:`codeobject.co_positions` method in Python." @@ -265,8 +265,8 @@ msgid "" "See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan " "Taskaya and Ammar Askar in :issue:`43950`.)" msgstr "" -"詳情請見 :pep:`657`。(由 Pablo Galindo、Batuhan Taskaya 與 Ammar Askar " -"於 :issue:`43950` 中所貢獻。)" +"詳情請見 :pep:`657`。(由 Pablo Galindo、Batuhan Taskaya 與 Ammar Askar 於 :" +"issue:`43950` 中所貢獻。)" #: ../../whatsnew/3.11.rst:171 msgid "" @@ -274,8 +274,8 @@ msgid "" "may result in a small increase in interpreter memory usage and disk usage " "for compiled Python files. To avoid storing the extra information and " "deactivate printing the extra traceback information, use the :option:`-X " -"no_debug_ranges <-X>` command line option or " -"the :envvar:`PYTHONNODEBUGRANGES` environment variable." +"no_debug_ranges <-X>` command line option or the :envvar:" +"`PYTHONNODEBUGRANGES` environment variable." msgstr "" "這個特性必須要將欄的位置 (column position) 儲存於 :ref:`codeobjects`,這可能" "會導致直譯器用於編譯 Python 檔案的記憶體使用量與硬碟使用量增加。為了避免儲存" @@ -289,16 +289,16 @@ msgstr "PEP 654:例外群組與 ``except*``" #: ../../whatsnew/3.11.rst:185 msgid "" ":pep:`654` introduces language features that enable a program to raise and " -"handle multiple unrelated exceptions simultaneously. The builtin " -"types :exc:`ExceptionGroup` and :exc:`BaseExceptionGroup` make it possible " -"to group exceptions and raise them together, and the new :keyword:`except* " +"handle multiple unrelated exceptions simultaneously. The builtin types :exc:" +"`ExceptionGroup` and :exc:`BaseExceptionGroup` make it possible to group " +"exceptions and raise them together, and the new :keyword:`except* " "` syntax generalizes :keyword:`except` to match subgroups of " "exception groups." msgstr "" ":pep:`654` 引入了新的的語言特性,可讓程式同時引發並處理多個相互無關的例外。內" "建型別 :exc:`ExceptionGroup` 和 :exc:`BaseExceptionGroup` 使得程式可為多個例" -"外組成群組並同時引發,新的 :keyword:`except* ` 語法也" -"將 :keyword:`except` 泛用化、能夠比對例外群組的子群組。" +"外組成群組並同時引發,新的 :keyword:`except* ` 語法也將 :" +"keyword:`except` 泛用化、能夠比對例外群組的子群組。" #: ../../whatsnew/3.11.rst:192 msgid "See :pep:`654` for more details." @@ -346,33 +346,33 @@ msgstr "Windows ``py.exe`` 啟動程式 (launcher) 的改進" #: ../../whatsnew/3.11.rst:219 msgid "" "The copy of the :ref:`launcher` included with Python 3.11 has been " -"significantly updated. It now supports company/tag syntax as defined " -"in :pep:`514` using the :samp:`-V:{}/{}` argument instead of " -"the limited :samp:`-{}.{}`. This allows launching " -"distributions other than ``PythonCore``, the one hosted on `python.org " -"`_." +"significantly updated. It now supports company/tag syntax as defined in :pep:" +"`514` using the :samp:`-V:{}/{}` argument instead of the " +"limited :samp:`-{}.{}`. This allows launching distributions " +"other than ``PythonCore``, the one hosted on `python.org `_." msgstr "" -"Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支" -"援 :pep:`514` 所定義的公司/標籤 (tag) 語法,可用 :samp:`-V:{}/" -"{}` 引數來取代受限的 :samp:`-{}.{}`。這允許了 `python.org " -"`_ 上的 ``PythonCore`` 以外的發行版本發布。" +"Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支援 :pep:" +"`514` 所定義的公司/標籤 (tag) 語法,可用 :samp:`-V:{}/{}` 引數" +"來取代受限的 :samp:`-{}.{}`。這允許了 `python.org `_ 上的 ``PythonCore`` 以外的發行版本發布。" #: ../../whatsnew/3.11.rst:225 msgid "" "When using ``-V:`` selectors, either company or tag can be omitted, but all " "installs will be searched. For example, ``-V:OtherPython/`` will select the " -"\"best\" tag registered for ``OtherPython``, while ``-V:3.11`` or ``-V:/" -"3.11`` will select the \"best\" distribution with tag ``3.11``." +"\"best\" tag registered for ``OtherPython``, while ``-V:3.11`` or ``-" +"V:/3.11`` will select the \"best\" distribution with tag ``3.11``." msgstr "" -"使用 ``-V:`` 選擇器時,可以省略公司或標籤,但會搜尋所有安裝。例如,``-" -"V:OtherPython/`` 將選擇 ``OtherPython`` 註冊的「最佳」標籤,而 ``-V:3.11`` " -"或 ``-V:/3.11`` 將選擇帶有 ``3.11`` 標籤的「最佳」發行版。" +"使用 ``-V:`` 選擇器時,可以省略公司或標籤,但會搜尋所有安裝。例如,``-V:" +"OtherPython/`` 將選擇 ``OtherPython`` 註冊的「最佳」標籤,而 ``-V:3.11`` 或 " +"``-V:/3.11`` 將選擇帶有 ``3.11`` 標籤的「最佳」發行版。" #: ../../whatsnew/3.11.rst:230 msgid "" -"When using the legacy :samp:`-{}`, :samp:`-{}.{}" -"`, :samp:`-{}-{}` or :samp:`-{}.{}-{}" -"` arguments, all existing behaviour should be preserved from past versions, " +"When using the legacy :samp:`-{}`, :samp:`-{}.{}`, :" +"samp:`-{}-{}` or :samp:`-{}.{}-{}` " +"arguments, all existing behaviour should be preserved from past versions, " "and only releases from ``PythonCore`` will be selected. However, the ``-64`` " "suffix now implies \"not 32-bit\" (not necessarily x86-64), as there are " "multiple supported 64-bit platforms. 32-bit runtimes are detected by " @@ -393,8 +393,8 @@ msgstr "型別提示相關的新特性" #: ../../whatsnew/3.11.rst:246 msgid "" -"This section covers major changes affecting :pep:`484` type hints and " -"the :mod:`typing` module." +"This section covers major changes affecting :pep:`484` type hints and the :" +"mod:`typing` module." msgstr "" "這個部分涵蓋影響 :pep:`484` 型別提示 (type hints) 與 :mod:`typing` 模組的重大" "變更。" @@ -406,10 +406,10 @@ msgstr "PEP 646:可變參數泛型 (variadic generics)" #: ../../whatsnew/3.11.rst:255 msgid "" ":pep:`484` previously introduced :data:`~typing.TypeVar`, enabling creation " -"of generics parameterised with a single type. :pep:`646` " -"adds :data:`~typing.TypeVarTuple`, enabling parameterisation with an " -"*arbitrary* number of types. In other words, a :data:`~typing.TypeVarTuple` " -"is a *variadic* type variable, enabling *variadic* generics." +"of generics parameterised with a single type. :pep:`646` adds :data:`~typing." +"TypeVarTuple`, enabling parameterisation with an *arbitrary* number of " +"types. In other words, a :data:`~typing.TypeVarTuple` is a *variadic* type " +"variable, enabling *variadic* generics." msgstr "" ":pep:`484` 先前引入了 :data:`~typing.TypeVar`,開啟了帶有單一型別的泛型參數" "化。:pep:`646` 新增 :data:`~typing.TypeVarTuple`,開啟了帶有\\ *任意*\\ 數量" @@ -450,9 +450,9 @@ msgstr "PEP 655:標記獨立 ``TypedDict`` 項目為必要或不必要" #: ../../whatsnew/3.11.rst:280 msgid "" ":data:`~typing.Required` and :data:`~typing.NotRequired` provide a " -"straightforward way to mark whether individual items in " -"a :class:`~typing.TypedDict` must be present. Previously, this was only " -"possible using inheritance." +"straightforward way to mark whether individual items in a :class:`~typing." +"TypedDict` must be present. Previously, this was only possible using " +"inheritance." msgstr "" ":data:`~typing.Required` 與 :data:`~typing.NotRequired` 提供了標記一個獨立項" "目在 :class:`~typing.TypedDict` 中是否必須存在的直覺方法。在這之前,這只有透" @@ -524,9 +524,9 @@ msgstr "" #: ../../whatsnew/3.11.rst:322 msgid "" -"Common use cases include alternative constructors provided " -"as :func:`classmethod `\\s, and :meth:`~object.__enter__` " -"methods that return ``self``::" +"Common use cases include alternative constructors provided as :func:" +"`classmethod `\\s, and :meth:`~object.__enter__` methods that " +"return ``self``::" msgstr "" "常見用例包括作為 :func:`classmethod ` 的替代建構函式和會回傳 " "``self`` 的 :meth:`~object.__enter__` 方法: ::" @@ -659,8 +659,8 @@ msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " "``@dataclass_transform()`` tells a static type checker that the decorated " -"object performs runtime \"magic\" that transforms a class, giving " -"it :func:`dataclass `-like behaviors." +"object performs runtime \"magic\" that transforms a class, giving it :func:" +"`dataclass `-like behaviors." msgstr "" ":data:`~typing.dataclass_transform` 可以用來裝飾一個類別、元類別 " "(metaclass)、或是一個本身就是裝飾器的函式。``@dataclass_transform()`` 的存在" @@ -762,51 +762,51 @@ msgstr "" #: ../../whatsnew/3.11.rst:447 msgid "" -"A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` " -"in :keyword:`with` statements and :meth:`contextlib.ExitStack.enter_context` " -"for objects that do not support the :term:`context manager` protocol, and " -"in :keyword:`async with` statements " -"and :meth:`contextlib.AsyncExitStack.enter_async_context` for objects not " -"supporting the :term:`asynchronous context manager` protocol. (Contributed " -"by Serhiy Storchaka in :issue:`12022` and :issue:`44471`.)" +"A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` in :" +"keyword:`with` statements and :meth:`contextlib.ExitStack.enter_context` for " +"objects that do not support the :term:`context manager` protocol, and in :" +"keyword:`async with` statements and :meth:`contextlib.AsyncExitStack." +"enter_async_context` for objects not supporting the :term:`asynchronous " +"context manager` protocol. (Contributed by Serhiy Storchaka in :issue:" +"`12022` and :issue:`44471`.)" msgstr "" "現在在不支援 :term:`context manager` 協定的物件上使用 :keyword:`with` 陳述式" "和 :meth:`contextlib.ExitStack.enter_context` 或在不支援 :term:`asynchronous " -"context manager` 協定的物件上使用 :keyword:`async with` 陳述式" -"和 :meth:`contextlib.AsyncExitStack.enter_async_context`,會引" -"發 :exc:`TypeError` 而不是 :exc:`AttributeError`。(由 Serhiy Storchaka " -"在 :issue:`12022` 和 :issue:`44471` 中貢獻。)" +"context manager` 協定的物件上使用 :keyword:`async with` 陳述式和 :meth:" +"`contextlib.AsyncExitStack.enter_async_context`,會引發 :exc:`TypeError` 而不" +"是 :exc:`AttributeError`。(由 Serhiy Storchaka 在 :issue:`12022` 和 :issue:" +"`44471` 中貢獻。)" #: ../../whatsnew/3.11.rst:455 msgid "" "Added :meth:`object.__getstate__`, which provides the default implementation " "of the :meth:`!__getstate__` method. :mod:`copy`\\ing and :mod:`pickle`\\ing " -"instances of subclasses of builtin " -"types :class:`bytearray`, :class:`set`, :class:`frozenset`, :class:`collections.OrderedDict`, :class:`collections.deque`, :class:`weakref.WeakSet`, " -"and :class:`datetime.tzinfo` now copies and pickles instance attributes " -"implemented as :term:`slots <__slots__>`. This change has an unintended side " -"effect: It trips up a small minority of existing Python projects not " -"expecting :meth:`object.__getstate__` to exist. See the later comments " -"on :gh:`70766` for discussions of what workarounds such code may need. " -"(Contributed by Serhiy Storchaka in :issue:`26579`.)" +"instances of subclasses of builtin types :class:`bytearray`, :class:`set`, :" +"class:`frozenset`, :class:`collections.OrderedDict`, :class:`collections." +"deque`, :class:`weakref.WeakSet`, and :class:`datetime.tzinfo` now copies " +"and pickles instance attributes implemented as :term:`slots <__slots__>`. " +"This change has an unintended side effect: It trips up a small minority of " +"existing Python projects not expecting :meth:`object.__getstate__` to exist. " +"See the later comments on :gh:`70766` for discussions of what workarounds " +"such code may need. (Contributed by Serhiy Storchaka in :issue:`26579`.)" msgstr "" #: ../../whatsnew/3.11.rst:470 msgid "" "Added a :option:`-P` command line option and a :envvar:`PYTHONSAFEPATH` " -"environment variable, which disable the automatic prepending " -"to :data:`sys.path` of the script's directory when running a script, or the " -"current directory when using :option:`-c` and :option:`-m`. This ensures " -"only stdlib and installed modules are picked up by :keyword:`import`, and " -"avoids unintentionally or maliciously shadowing modules with those in a " -"local (and typically user-writable) directory. (Contributed by Victor " -"Stinner in :gh:`57684`.)" +"environment variable, which disable the automatic prepending to :data:`sys." +"path` of the script's directory when running a script, or the current " +"directory when using :option:`-c` and :option:`-m`. This ensures only stdlib " +"and installed modules are picked up by :keyword:`import`, and avoids " +"unintentionally or maliciously shadowing modules with those in a local (and " +"typically user-writable) directory. (Contributed by Victor Stinner in :gh:" +"`57684`.)" msgstr "" "新增了一個 :option:`-P` 命令列選項和一個 :envvar:`PYTHONSAFEPATH` 環境變數," "它們禁用了當使用 :option:`-c` 和 :option:`-m` 以在運行腳本或目前目錄時自動添" -"加到腳本目錄的 :data:`sys.path`。這確保只有 stdlib 和已安裝的模組會" -"被 :keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可" -"寫入的)目錄中的模組重疊。(由 Victor Stinner 在 :gh:`57684` 中貢獻。)" +"加到腳本目錄的 :data:`sys.path`。這確保只有 stdlib 和已安裝的模組會被 :" +"keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可寫入" +"的)目錄中的模組重疊。(由 Victor Stinner 在 :gh:`57684` 中貢獻。)" #: ../../whatsnew/3.11.rst:481 msgid "" @@ -827,10 +827,10 @@ msgid "" "Thomas Grainger in :gh:`91181`.)" msgstr "" ":data:`sys.path` 不再接受位元組。支援已在 Python 3.2 和 3.6 之間的某個時間停" -"止,直到 Python 3.10.0 發布後才引起人們的注意。此外,由於混合使" -"用 :class:`str` 和 :class:`bytes` 鍵時 :option:`-b` " -"和 :data:`sys.path_importer_cache` 會出現的交互作用,恢復這項支援會出現問題。" -"(由 Thomas Grainger 在 :gh:`91181` 中貢獻。)" +"止,直到 Python 3.10.0 發布後才引起人們的注意。此外,由於混合使用 :class:" +"`str` 和 :class:`bytes` 鍵時 :option:`-b` 和 :data:`sys.path_importer_cache` " +"會出現的交互作用,恢復這項支援會出現問題。(由 Thomas Grainger 在 :gh:" +"`91181` 中貢獻。)" #: ../../whatsnew/3.11.rst:497 msgid "Other CPython Implementation Changes" @@ -838,15 +838,15 @@ msgstr "其他 CPython 實作更動" #: ../../whatsnew/3.11.rst:499 msgid "" -"The special methods :meth:`~object.__complex__` for :class:`complex` " -"and :meth:`~object.__bytes__` for :class:`bytes` are implemented to support " -"the :class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` " -"protocols. (Contributed by Mark Dickinson and Donghee Na in :issue:`24234`.)" +"The special methods :meth:`~object.__complex__` for :class:`complex` and :" +"meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :" +"class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` protocols. " +"(Contributed by Mark Dickinson and Donghee Na in :issue:`24234`.)" msgstr "" "為支援 :class:`typing.SupportsComplex` 與 :class:`typing.SupportsBytes` 協" -"定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方" -"法 :meth:`~object.__complex__` 與 :meth:`~object.__bytes__`。(由 Mark " -"Dickinson 和 Donghee Na 於 :issue:`24234` 中所貢獻。)" +"定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方法 :meth:`~object." +"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Donghee Na " +"於 :issue:`24234` 中所貢獻。)" #: ../../whatsnew/3.11.rst:504 msgid "" @@ -860,16 +860,16 @@ msgstr "" "新增 ``siphash13`` 以作為內部的雜湊演算法,它有與 ``siphash24`` 相似的安全特" "性,但是在處理較長的輸入時會更快一些。現在是 :class:`str`、:class:`bytes` 和" "一些其他型別的 :func:`hash` 預設演算法。:pep:`552` :ref:`基於雜湊的 .pyc 檔" -"案 ` 現在也使用 ``siphash13``。(由 Inada Naoki " -"於 :issue:`29410` 中貢獻。)" +"案 ` 現在也使用 ``siphash13``。(由 Inada Naoki 於 :issue:" +"`29410` 中貢獻。)" #: ../../whatsnew/3.11.rst:513 msgid "" "When an active exception is re-raised by a :keyword:`raise` statement with " -"no parameters, the traceback attached to this exception is now always " -"``sys.exc_info()[1].__traceback__``. This means that changes made to the " -"traceback in the current :keyword:`except` clause are reflected in the re-" -"raised exception. (Contributed by Irit Katriel in :issue:`45711`.)" +"no parameters, the traceback attached to this exception is now always ``sys." +"exc_info()[1].__traceback__``. This means that changes made to the traceback " +"in the current :keyword:`except` clause are reflected in the re-raised " +"exception. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" "當一個仍有效的例外被 :keyword:`raise` 陳述式在沒有參數的情況下重新引發,被附" "於該例外的追蹤資訊現在都會是 ``sys.exc_info()[1].__traceback__``。這代表對於" @@ -906,10 +906,9 @@ msgid "" "initialize :data:`sys.path`. Otherwise, initialization will recalculate the " "path and replace any values added to ``module_search_paths``." msgstr "" -"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始" -"化 :data:`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須" -"被設為 1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` " -"的值。" +"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始化 :data:" +"`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " +"1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" #: ../../whatsnew/3.11.rst:536 msgid "" @@ -920,9 +919,9 @@ msgid "" "help-all`. (Contributed by Éric Araujo in :issue:`46142`.)" msgstr "" ":option:`--help` 選項的輸出現在會在 50 列、80 欄的大小之內,:ref:`Python 環境" -"變數 `\\ 和 :option:`-X` 選項的資訊現在能夠分別透" -"過 :option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-" -"all` 一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)" +"變數 `\\ 和 :option:`-X` 選項的資訊現在能夠分別透過 :" +"option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-all` " +"一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)" #: ../../whatsnew/3.11.rst:543 msgid "" @@ -938,11 +937,11 @@ msgid "" msgstr "" "在除 2(binary、二進制)、4、8(octal、八進制)、16(hexadecimal、十六進制)" "或 32 以外的基數中,例如以 10(decimal、十進制)為基數,進行 :class:`int` " -"和 :class:`str` 之間的轉換且字串形式的位數超過限制,現在會引" -"發 :exc:`ValueError`,以避免由於演算法複雜性而導致的潛在阻斷服務攻擊 (denial " -"of service attacks)。這是針對 :cve:`2020-10735` 的緩解措施,可以透過環境變" -"數、命令列旗標或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉" -"換長度限制 ` 文件。預設限制為字串形式的 4300 位數字。" +"和 :class:`str` 之間的轉換且字串形式的位數超過限制,現在會引發 :exc:" +"`ValueError`,以避免由於演算法複雜性而導致的潛在阻斷服務攻擊 (denial of " +"service attacks)。這是針對 :cve:`2020-10735` 的緩解措施,可以透過環境變數、命" +"令列旗標或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉換長度" +"限制 ` 文件。預設限制為字串形式的 4300 位數字。" #: ../../whatsnew/3.11.rst:557 msgid "New Modules" @@ -976,9 +975,9 @@ msgstr "asyncio" msgid "" "Added the :class:`~asyncio.TaskGroup` class, an :ref:`asynchronous context " "manager ` holding a group of tasks that will wait " -"for all of them upon exit. For new code this is recommended over " -"using :func:`~asyncio.create_task` and :func:`~asyncio.gather` directly. " -"(Contributed by Yury Selivanov and others in :gh:`90908`.)" +"for all of them upon exit. For new code this is recommended over using :func:" +"`~asyncio.create_task` and :func:`~asyncio.gather` directly. (Contributed by " +"Yury Selivanov and others in :gh:`90908`.)" msgstr "" "添加了 :class:`~asyncio.TaskGroup` 類別,為一個會持有任務群組並在退出時等待全" "部完成的\\ :ref:`非同步情境管理器 (asynchronous context manager) ` (the default " -"for :func:`format`, :meth:`str.format` and :term:`f-string`\\s) to always " -"produce the same result as :meth:`Enum.__str__() `: for " -"enums inheriting from :class:`~enum.ReprEnum` it will be the member's value; " -"for all other enums it will be the enum and member name (e.g. ``Color.RED``)." +"Changed :meth:`Enum.__format__() ` (the default for :" +"func:`format`, :meth:`str.format` and :term:`f-string`\\s) to always produce " +"the same result as :meth:`Enum.__str__() `: for enums " +"inheriting from :class:`~enum.ReprEnum` it will be the member's value; for " +"all other enums it will be the enum and member name (e.g. ``Color.RED``)." msgstr "" -"改變了 :meth:`Enum.__format__() ` " -"(被 :func:`format`、:meth:`str.format` 和 :term:`f-string` 預設使用),以使" -"其與 :meth:`enum.Enum.__str__ ` 產生相同結果:對於繼承" -"自 :class:`~enum.ReprEnum` 的列舉,這會是成員之值;而其他的列舉會是列舉與成員" -"名稱(例如 ``Color.RED``)。" +"改變了 :meth:`Enum.__format__() ` (被 :func:" +"`format`、:meth:`str.format` 和 :term:`f-string` 預設使用),以使其與 :meth:" +"`enum.Enum.__str__ ` 產生相同結果:對於繼承自 :class:" +"`~enum.ReprEnum` 的列舉,這會是成員之值;而其他的列舉會是列舉與成員名稱(例" +"如 ``Color.RED``)。" #: ../../whatsnew/3.11.rst:678 msgid "" -"Added a new *boundary* class parameter to :class:`~enum.Flag` enums and " -"the :class:`~enum.FlagBoundary` enum with its options, to control how to " -"handle out-of-range flag values." +"Added a new *boundary* class parameter to :class:`~enum.Flag` enums and the :" +"class:`~enum.FlagBoundary` enum with its options, to control how to handle " +"out-of-range flag values." msgstr "" -"新增 *boundary* 類別參數與其選項到 :class:`~enum.Flag` 列舉" -"和 :class:`~enum.FlagBoundary` 列舉以控制處理超出範圍旗標數值的方法。" +"新增 *boundary* 類別參數與其選項到 :class:`~enum.Flag` 列舉和 :class:`~enum." +"FlagBoundary` 列舉以控制處理超出範圍旗標數值的方法。" #: ../../whatsnew/3.11.rst:682 msgid "" -"Added the :func:`~enum.verify` enum decorator and " -"the :class:`~enum.EnumCheck` enum with its options, to check enum classes " -"against several specific constraints." +"Added the :func:`~enum.verify` enum decorator and the :class:`~enum." +"EnumCheck` enum with its options, to check enum classes against several " +"specific constraints." msgstr "" "新增了 :func:`~enum.verify` 列舉裝飾器和 :class:`~enum.EnumCheck` 列舉及其選" "項,以根據幾個特定限制檢查列舉類別。" @@ -1186,35 +1181,34 @@ msgstr "" #: ../../whatsnew/3.11.rst:689 msgid "" -"Added the :func:`~enum.property` decorator, which works " -"like :func:`property` except for enums. Use this instead " -"of :func:`types.DynamicClassAttribute`." +"Added the :func:`~enum.property` decorator, which works like :func:" +"`property` except for enums. Use this instead of :func:`types." +"DynamicClassAttribute`." msgstr "" "新增 :func:`~enum.property` 裝飾器,它的作用類似 :func:`property` 但是是用於" "列舉,用以替代 :func:`types.DynamicClassAttribute`。" #: ../../whatsnew/3.11.rst:693 msgid "" -"Added the :func:`~enum.global_enum` enum decorator, which " -"adjusts :meth:`~object.__repr__` and :meth:`~object.__str__` to show values " -"as members of their module rather than the enum class. For example, " -"``'re.ASCII'`` for the :const:`~re.ASCII` member of :class:`re.RegexFlag` " -"rather than ``'RegexFlag.ASCII'``." +"Added the :func:`~enum.global_enum` enum decorator, which adjusts :meth:" +"`~object.__repr__` and :meth:`~object.__str__` to show values as members of " +"their module rather than the enum class. For example, ``'re.ASCII'`` for " +"the :const:`~re.ASCII` member of :class:`re.RegexFlag` rather than " +"``'RegexFlag.ASCII'``." msgstr "" "新增 :func:`~enum.global_enum` 列舉裝飾器,用來調整 :meth:`~object.__repr__` " -"和 :meth:`~object.__str__` 以模組成員形式而非列舉類別來顯示值。例" -"如,:class:`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 " +"和 :meth:`~object.__str__` 以模組成員形式而非列舉類別來顯示值。例如,:class:" +"`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 " "``'RegexFlag.ASCII'``。" #: ../../whatsnew/3.11.rst:699 msgid "" -"Enhanced :class:`~enum.Flag` to support :func:`len`, iteration " -"and :keyword:`in`/:keyword:`not in` on its members. For example, the " -"following now works: ``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, " -"AFlag.TWO)``" +"Enhanced :class:`~enum.Flag` to support :func:`len`, iteration and :keyword:" +"`in`/:keyword:`not in` on its members. For example, the following now works: " +"``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" msgstr "" -"強化 :class:`~enum.Flag` 以支援使用 :func:`len`、疊代 (iteration) " -"和 :keyword:`in`/:keyword:`not in` 於其成員。例如,以下程式現在能夠作用了:" +"強化 :class:`~enum.Flag` 以支援使用 :func:`len`、疊代 (iteration) 和 :" +"keyword:`in`/:keyword:`not in` 於其成員。例如,以下程式現在能夠作用了:" "``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" #: ../../whatsnew/3.11.rst:704 @@ -1223,9 +1217,9 @@ msgid "" "defined before :meth:`~object.__init_subclass__` is called; :func:`dir` now " "includes methods, etc., from mixed-in data types." msgstr "" -"更改了 :class:`~enum.Enum` 和 :class:`~enum.Flag` 以在呼" -"叫 :meth:`~object.__init_subclass__` 之前就定義成員;:func:`dir` 現在包括來自" -"混合資料型別的方法。" +"更改了 :class:`~enum.Enum` 和 :class:`~enum.Flag` 以在呼叫 :meth:`~object." +"__init_subclass__` 之前就定義成員;:func:`dir` 現在包括來自混合資料型別的方" +"法。" #: ../../whatsnew/3.11.rst:709 msgid "" @@ -1278,11 +1272,11 @@ msgstr "functools" #: ../../whatsnew/3.11.rst:743 msgid "" -":func:`functools.singledispatch` now supports :class:`types.UnionType` " -"and :class:`typing.Union` as annotations to the dispatch argument.::" +":func:`functools.singledispatch` now supports :class:`types.UnionType` and :" +"class:`typing.Union` as annotations to the dispatch argument.::" msgstr "" -":func:`functools.singledispatch` 現在支援 :class:`types.UnionType` " -"和 :class:`typing.Union` 作為調度 (dispatch) 引數的標註。 ::" +":func:`functools.singledispatch` 現在支援 :class:`types.UnionType` 和 :class:" +"`typing.Union` 作為調度 (dispatch) 引數的標註。 ::" #: ../../whatsnew/3.11.rst:746 msgid "" @@ -1341,14 +1335,13 @@ msgstr "gzip" #: ../../whatsnew/3.11.rst:776 msgid "" "The :func:`gzip.compress` function is now faster when used with the " -"**mtime=0** argument as it delegates the compression entirely to a " -"single :func:`zlib.compress` operation. There is one side effect of this " -"change: The gzip file header contains an \"OS\" byte in its header. That was " -"traditionally always set to a value of 255 representing \"unknown\" by " -"the :mod:`gzip` module. Now, when using :func:`~gzip.compress` with " -"**mtime=0**, it may be set to a different value by the underlying zlib C " -"library Python was linked against. (See :gh:`112346` for details on the side " -"effect.)" +"**mtime=0** argument as it delegates the compression entirely to a single :" +"func:`zlib.compress` operation. There is one side effect of this change: The " +"gzip file header contains an \"OS\" byte in its header. That was " +"traditionally always set to a value of 255 representing \"unknown\" by the :" +"mod:`gzip` module. Now, when using :func:`~gzip.compress` with **mtime=0**, " +"it may be set to a different value by the underlying zlib C library Python " +"was linked against. (See :gh:`112346` for details on the side effect.)" msgstr "" #: ../../whatsnew/3.11.rst:789 @@ -1402,8 +1395,8 @@ msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" msgstr "" -"當帶有輸入與輸出地儲存 Shell 時,也會包含提示字元。(由 Terry Jan Reedy " -"於 :gh:`95191` 中所貢獻。)" +"當帶有輸入與輸出地儲存 Shell 時,也會包含提示字元。(由 Terry Jan Reedy 於 :" +"gh:`95191` 中所貢獻。)" #: ../../whatsnew/3.11.rst:822 msgid "inspect" @@ -1422,12 +1415,11 @@ msgstr "" #: ../../whatsnew/3.11.rst:828 msgid "" "Add :func:`~inspect.ismethodwrapper` for checking if the type of an object " -"is a :class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik " -"in :issue:`29418`.)" +"is a :class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik in :" +"issue:`29418`.)" msgstr "" -"新增 :func:`inspect.ismethodwrapper`,用來檢查一個物件的型別是否" -"為 :class:`~types.MethodWrapperType`。(由 Hakan Çelik 於 :issue:`29418` 中所" -"貢獻。)" +"新增 :func:`inspect.ismethodwrapper`,用來檢查一個物件的型別是否為 :class:" +"`~types.MethodWrapperType`。(由 Hakan Çelik 於 :issue:`29418` 中所貢獻。)" #: ../../whatsnew/3.11.rst:832 msgid "" @@ -1437,10 +1429,10 @@ msgid "" "interfaces) that includes the extended :pep:`657` position information (end " "line number, column and end column). The affected functions are:" msgstr "" -"更改 :mod:`inspect` 模組中與幀相關的函式以回傳新" -"的 :class:`~inspect.FrameInfo` 和 :class:`~inspect.Traceback` 類別實例(向後" -"相容之前類似於 :term:`named tuple` 的介面),包括擴充的 :pep:`657` 位置資訊" -"(結束行號、欄和結束欄)。受影響的功能是:" +"更改 :mod:`inspect` 模組中與幀相關的函式以回傳新的 :class:`~inspect." +"FrameInfo` 和 :class:`~inspect.Traceback` 類別實例(向後相容之前類似於 :term:" +"`named tuple` 的介面),包括擴充的 :pep:`657` 位置資訊(結束行號、欄和結束" +"欄)。受影響的功能是:" #: ../../whatsnew/3.11.rst:838 msgid ":func:`inspect.getframeinfo`" @@ -1473,8 +1465,8 @@ msgstr "locale" #: ../../whatsnew/3.11.rst:852 msgid "" "Add :func:`locale.getencoding` to get the current locale encoding. It is " -"similar to ``locale.getpreferredencoding(False)`` but ignores " -"the :ref:`Python UTF-8 Mode `." +"similar to ``locale.getpreferredencoding(False)`` but ignores the :ref:" +"`Python UTF-8 Mode `." msgstr "" "新增 :func:`locale.getencoding` 以取得目前的區域編碼 (locale encoding)。和 " "``locale.getpreferredencoding(False)`` 類似但不考慮 :ref:`Python UTF-8 模式 " @@ -1487,9 +1479,9 @@ msgstr "logging" #: ../../whatsnew/3.11.rst:862 msgid "" "Added :func:`~logging.getLevelNamesMapping` to return a mapping from logging " -"level names (e.g. ``'CRITICAL'``) to the values of their " -"corresponding :ref:`levels` (e.g. ``50``, by default). (Contributed by " -"Andrei Kulakovin in :gh:`88024`.)" +"level names (e.g. ``'CRITICAL'``) to the values of their corresponding :ref:" +"`levels` (e.g. ``50``, by default). (Contributed by Andrei Kulakovin in :gh:" +"`88024`.)" msgstr "" "新增 :func:`~logging.getLevelNamesMapping` 以回傳一個日誌級別名稱(例如 " "``'CRITICAL'``)指到對應的 :ref:`levels` 數值(例如,預設為 ``50``)的對映。" @@ -1497,19 +1489,17 @@ msgstr "" #: ../../whatsnew/3.11.rst:867 msgid "" -"Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method " -"to :class:`~logging.handlers.SysLogHandler`, to " -"match :meth:`SocketHandler.createSocket() " -"`. It is called automatically " -"during handler initialization and when emitting an event, if there is no " -"active socket. (Contributed by Kirill Pinchuk in :gh:`88457`.)" +"Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method to :" +"class:`~logging.handlers.SysLogHandler`, to match :meth:`SocketHandler." +"createSocket() `. It is called " +"automatically during handler initialization and when emitting an event, if " +"there is no active socket. (Contributed by Kirill Pinchuk in :gh:`88457`.)" msgstr "" -"添加了一個 :meth:`~logging.handlers.SysLogHandler.createSocket` 方法" -"到 :class:`~logging.handlers.SysLogHandler`,以匹" -"配 :meth:`SocketHandler.createSocket() " -"` 。如果沒有已啟用的 socket,它" -"會在處理程式初始化期間和發出一個事件時自動呼叫。(由 Kirill Pinchuk " -"在 :gh:`88457` 中貢獻。)" +"添加了一個 :meth:`~logging.handlers.SysLogHandler.createSocket` 方法到 :" +"class:`~logging.handlers.SysLogHandler`,以匹配 :meth:`SocketHandler." +"createSocket() ` 。如果沒有已啟" +"用的 socket,它會在處理程式初始化期間和發出一個事件時自動呼叫。(由 Kirill " +"Pinchuk 在 :gh:`88457` 中貢獻。)" #: ../../whatsnew/3.11.rst:879 msgid "math" @@ -1520,29 +1510,29 @@ msgid "" "Add :func:`math.exp2`: return 2 raised to the power of x. (Contributed by " "Gideon Mitchell in :issue:`45917`.)" msgstr "" -"新增 :func:`math.exp2`:回傳 2 的 x 次方。(由 Gideon Mitchell " -"於 :issue:`45917` 中所貢獻。)" +"新增 :func:`math.exp2`:回傳 2 的 x 次方。(由 Gideon Mitchell 於 :issue:" +"`45917` 中所貢獻。)" #: ../../whatsnew/3.11.rst:884 msgid "" "Add :func:`math.cbrt`: return the cube root of x. (Contributed by Ajith " "Ramachandran in :issue:`44357`.)" msgstr "" -"新增 :func:`math.cbrt`:回傳 x 的立方根。(由 Ajith Ramachandran " -"於 :issue:`44357` 中所貢獻。)" +"新增 :func:`math.cbrt`:回傳 x 的立方根。(由 Ajith Ramachandran 於 :issue:" +"`44357` 中所貢獻。)" #: ../../whatsnew/3.11.rst:887 msgid "" "The behaviour of two :func:`math.pow` corner cases was changed, for " -"consistency with the IEEE 754 specification. The operations ``math.pow(0.0, " -"-math.inf)`` and ``math.pow(-0.0, -math.inf)`` now return ``inf``. " -"Previously they raised :exc:`ValueError`. (Contributed by Mark Dickinson " -"in :issue:`44339`.)" +"consistency with the IEEE 754 specification. The operations ``math.pow(0.0, -" +"math.inf)`` and ``math.pow(-0.0, -math.inf)`` now return ``inf``. Previously " +"they raised :exc:`ValueError`. (Contributed by Mark Dickinson in :issue:" +"`44339`.)" msgstr "" "為了與 IEEE 754 規範保持一致,更改了兩個 :func:`math.pow` 邊角案例 (corner " "case) 的行為。``math.pow(0.0, -math.inf)`` 和 ``math.pow(-0.0, -math.inf)`` " -"現在回傳 ``inf``,之前它們會引發 :exc:`ValueError`。(由 Mark Dickinson " -"在 :issue:`44339` 中貢獻。)" +"現在回傳 ``inf``,之前它們會引發 :exc:`ValueError`。(由 Mark Dickinson 在 :" +"issue:`44339` 中貢獻。)" #: ../../whatsnew/3.11.rst:893 msgid "" @@ -1558,9 +1548,9 @@ msgstr "operator" #: ../../whatsnew/3.11.rst:902 msgid "" -"A new function ``operator.call`` has been added, such that " -"``operator.call(obj, *args, **kwargs) == obj(*args, **kwargs)``. " -"(Contributed by Antony Lee in :issue:`44019`.)" +"A new function ``operator.call`` has been added, such that ``operator." +"call(obj, *args, **kwargs) == obj(*args, **kwargs)``. (Contributed by Antony " +"Lee in :issue:`44019`.)" msgstr "" "新增 ``operator.call`` 函式,使得 ``operator.call(obj, *args, **kwargs) == " "obj(*args, **kwargs)``。(由 Antony Lee 於 :issue:`44019` 中所貢獻。)" @@ -1572,8 +1562,8 @@ msgstr "os" #: ../../whatsnew/3.11.rst:912 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " -"``CryptGenRandom()`` which is deprecated. (Contributed by Donghee Na " -"in :issue:`44611`.)" +"``CryptGenRandom()`` which is deprecated. (Contributed by Donghee Na in :" +"issue:`44611`.)" msgstr "" "在 Windows 上,:func:`os.urandom` 現在使用 ``BCryptGenRandom()`` 以取代被棄用" "的 ``CryptGenRandom()``。(由 Donghee Na 於 :issue:`44611` 中所貢獻。)" @@ -1585,9 +1575,9 @@ msgstr "pathlib" #: ../../whatsnew/3.11.rst:922 msgid "" ":meth:`~pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` return only " -"directories if *pattern* ends with a pathname components " -"separator: :data:`~os.sep` or :data:`~os.altsep`. (Contributed by Eisuke " -"Kawasima in :issue:`22276` and :issue:`33392`.)" +"directories if *pattern* ends with a pathname components separator: :data:" +"`~os.sep` or :data:`~os.altsep`. (Contributed by Eisuke Kawasima in :issue:" +"`22276` and :issue:`33392`.)" msgstr "" "如果 *pattern* 以路徑名稱元件分隔符號 :data:`~os.sep` 或 :data:`~os.altsep` " "結尾,:meth:`~pathlib.Path.glob` 和 :meth:`~pathlib.Path.rglob` 只回傳目錄。" @@ -1605,8 +1595,8 @@ msgid "" msgstr "" "現在正規表示式 (regular expression) 是有支援原子性群組 (atomic grouping) " "(``(?>...)``) 和佔有性量詞 (possessive quantifier) (``*+``, ``++``, ``?+``, " -"``{m,n}+``) 的。(由 Jeffrey C. Jacobs 和 Serhiy Storchaka " -"在 :issue:`433030` 中貢獻。)" +"``{m,n}+``) 的。(由 Jeffrey C. Jacobs 和 Serhiy Storchaka 在 :issue:" +"`433030` 中貢獻。)" #: ../../whatsnew/3.11.rst:941 msgid "shutil" @@ -1617,8 +1607,8 @@ msgid "" "Add optional parameter *dir_fd* in :func:`shutil.rmtree`. (Contributed by " "Serhiy Storchaka in :issue:`46245`.)" msgstr "" -"新增 :func:`shutil.rmtree` 的可選參數 *dir_fd*。(由 Serhiy Storchaka " -"於 :issue:`46245` 中所貢獻。)" +"新增 :func:`shutil.rmtree` 的可選參數 *dir_fd*。(由 Serhiy Storchaka 於 :" +"issue:`46245` 中所貢獻。)" #: ../../whatsnew/3.11.rst:950 msgid "socket" @@ -1626,8 +1616,8 @@ msgstr "socket" #: ../../whatsnew/3.11.rst:952 msgid "" -"Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner " -"in :issue:`30512`.)" +"Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner in :issue:" +"`30512`.)" msgstr "" "新增 NetBSD 對於 CAN Socket 的支援。(由 Thomas Klausner 於 :issue:`30512` 中" "所貢獻。)" @@ -1639,8 +1629,8 @@ msgid "" "raising the last error. (Contributed by Irit Katriel in :issue:`29980`.)" msgstr "" "當連接失敗時,:meth:`~socket.create_connection` 有個選項可以引發一個包含所有" -"錯誤的 :exc:`ExceptionGroup`,而非只引發最後一個錯誤。(由 Irit Katriel " -"於 :issue:`29980` 中貢獻。)" +"錯誤的 :exc:`ExceptionGroup`,而非只引發最後一個錯誤。(由 Irit Katriel 於 :" +"issue:`29980` 中貢獻。)" #: ../../whatsnew/3.11.rst:964 msgid "sqlite3" @@ -1648,49 +1638,48 @@ msgstr "sqlite3" #: ../../whatsnew/3.11.rst:966 msgid "" -"You can now disable the authorizer by passing :const:`None` " -"to :meth:`~sqlite3.Connection.set_authorizer`. (Contributed by Erlend E. " -"Aasland in :issue:`44491`.)" +"You can now disable the authorizer by passing :const:`None` to :meth:" +"`~sqlite3.Connection.set_authorizer`. (Contributed by Erlend E. Aasland in :" +"issue:`44491`.)" msgstr "" -"現在可以透過將 :const:`None` 傳遞" -"給 :meth:`~sqlite3.Connection.set_authorizer` 來停用 authorizer。(由 " -"Erlend E. Aasland 於 :issue:`44491` 中貢獻。)" +"現在可以透過將 :const:`None` 傳遞給 :meth:`~sqlite3.Connection." +"set_authorizer` 來停用 authorizer。(由 Erlend E. Aasland 於 :issue:`44491` " +"中貢獻。)" #: ../../whatsnew/3.11.rst:970 msgid "" "Collation name :meth:`~sqlite3.Connection.create_collation` can now contain " -"any Unicode character. Collation names with invalid characters now " -"raise :exc:`UnicodeEncodeError` instead of :exc:`sqlite3.ProgrammingError`. " +"any Unicode character. Collation names with invalid characters now raise :" +"exc:`UnicodeEncodeError` instead of :exc:`sqlite3.ProgrammingError`. " "(Contributed by Erlend E. Aasland in :issue:`44688`.)" msgstr "" "定序 (collation) 名稱 :meth:`~sqlite3.Connection.create_collation` 現在可以包" -"含任何 Unicode 字元。帶有無效字元的定序名稱現在會引" -"發 :exc:`UnicodeEncodeError` 而不是 :exc:`sqlite3.ProgrammingError`。(由 " -"Erlend E. Aasland 在 :issue:`44688` 中貢獻。)" +"含任何 Unicode 字元。帶有無效字元的定序名稱現在會引發 :exc:" +"`UnicodeEncodeError` 而不是 :exc:`sqlite3.ProgrammingError`。(由 Erlend E. " +"Aasland 在 :issue:`44688` 中貢獻。)" #: ../../whatsnew/3.11.rst:975 msgid "" -":mod:`sqlite3` exceptions now include the SQLite extended error code " -"as :attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name " -"as :attr:`~sqlite3.Error.sqlite_errorname`. (Contributed by Aviv Palivoda, " -"Daniel Shahaf, and Erlend E. Aasland in :issue:`16379` and :issue:`24139`.)" +":mod:`sqlite3` exceptions now include the SQLite extended error code as :" +"attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name as :attr:" +"`~sqlite3.Error.sqlite_errorname`. (Contributed by Aviv Palivoda, Daniel " +"Shahaf, and Erlend E. Aasland in :issue:`16379` and :issue:`24139`.)" msgstr "" -":mod:`sqlite3` 例外現在包含 SQLite 擴充錯誤碼和 SQLite 錯誤名稱(分別" -"為 :attr:`~sqlite3.Error.sqlite_errorcode` " -"和 :attr:`~sqlite3.Error.sqlite_errorname`)。(由 Aviv Palivoda、Daniel " -"Shahaf 和 Erlend E. Aasland 在 :issue:`16379` 和 :issue:`24139` 中貢獻。)" +":mod:`sqlite3` 例外現在包含 SQLite 擴充錯誤碼和 SQLite 錯誤名稱(分別為 :" +"attr:`~sqlite3.Error.sqlite_errorcode` 和 :attr:`~sqlite3.Error." +"sqlite_errorname`)。(由 Aviv Palivoda、Daniel Shahaf 和 Erlend E. Aasland " +"在 :issue:`16379` 和 :issue:`24139` 中貢獻。)" #: ../../whatsnew/3.11.rst:981 msgid "" -"Add :meth:`~sqlite3.Connection.setlimit` " -"and :meth:`~sqlite3.Connection.getlimit` to :class:`sqlite3.Connection` for " -"setting and getting SQLite limits by connection basis. (Contributed by " -"Erlend E. Aasland in :issue:`45243`.)" +"Add :meth:`~sqlite3.Connection.setlimit` and :meth:`~sqlite3.Connection." +"getlimit` to :class:`sqlite3.Connection` for setting and getting SQLite " +"limits by connection basis. (Contributed by Erlend E. Aasland in :issue:" +"`45243`.)" msgstr "" -"將 :meth:`~sqlite3.Connection.setlimit` " -"和 :meth:`~sqlite3.Connection.getlimit` 新增到 :class:`sqlite3.Connection` 以" -"根據連線來設定和取得 SQLite 限制。(由 Erlend E. Aasland 在 :issue:`45243` 中" -"貢獻。)" +"將 :meth:`~sqlite3.Connection.setlimit` 和 :meth:`~sqlite3.Connection." +"getlimit` 新增到 :class:`sqlite3.Connection` 以根據連線來設定和取得 SQLite 限" +"制。(由 Erlend E. Aasland 在 :issue:`45243` 中貢獻。)" #: ../../whatsnew/3.11.rst:986 msgid "" @@ -1721,43 +1710,40 @@ msgid "" "(Contributed by Erlend E. Aasland in :issue:`44092`.)" msgstr "" "跨越不同回滾 (rollback) 的拿取動作不再引發 :exc:`~sqlite3.InterfaceError`,我" -"們將其留給 SQLite 函式庫來處理這些情況。(由 Erlend E. Aasland " -"在 :issue:`44092` 中貢獻。)" +"們將其留給 SQLite 函式庫來處理這些情況。(由 Erlend E. Aasland 在 :issue:" +"`44092` 中貢獻。)" #: ../../whatsnew/3.11.rst:1000 msgid "" -"Add :meth:`~sqlite3.Connection.serialize` " -"and :meth:`~sqlite3.Connection.deserialize` to :class:`sqlite3.Connection` " -"for serializing and deserializing databases. (Contributed by Erlend E. " -"Aasland in :issue:`41930`.)" +"Add :meth:`~sqlite3.Connection.serialize` and :meth:`~sqlite3.Connection." +"deserialize` to :class:`sqlite3.Connection` for serializing and " +"deserializing databases. (Contributed by Erlend E. Aasland in :issue:" +"`41930`.)" msgstr "" -"將 :meth:`~sqlite3.Connection.serialize` " -"和 :meth:`~sqlite3.Connection.deserialize` 新增" -"到 :class:`sqlite3.Connection` 以用於序列化和反序列化資料庫。(由 Erlend E. " -"Aasland 在 :issue:`41930` 中貢獻。)" +"將 :meth:`~sqlite3.Connection.serialize` 和 :meth:`~sqlite3.Connection." +"deserialize` 新增到 :class:`sqlite3.Connection` 以用於序列化和反序列化資料" +"庫。(由 Erlend E. Aasland 在 :issue:`41930` 中貢獻。)" #: ../../whatsnew/3.11.rst:1005 msgid "" -"Add :meth:`~sqlite3.Connection.create_window_function` " -"to :class:`sqlite3.Connection` for creating aggregate window functions. " -"(Contributed by Erlend E. Aasland in :issue:`34916`.)" +"Add :meth:`~sqlite3.Connection.create_window_function` to :class:`sqlite3." +"Connection` for creating aggregate window functions. (Contributed by Erlend " +"E. Aasland in :issue:`34916`.)" msgstr "" -"於 :class:`sqlite3.Connection` 加" -"入 :meth:`~sqlite3.Connection.create_window_function` 已建立聚合視窗函式 " -"(aggregate window function)。(由 Erlend E. Aasland 於 :issue:`34916` 中貢" -"獻。)" +"於 :class:`sqlite3.Connection` 加入 :meth:`~sqlite3.Connection." +"create_window_function` 已建立聚合視窗函式 (aggregate window function)。(由 " +"Erlend E. Aasland 於 :issue:`34916` 中貢獻。)" #: ../../whatsnew/3.11.rst:1009 msgid "" -"Add :meth:`~sqlite3.Connection.blobopen` " -"to :class:`sqlite3.Connection`. :class:`sqlite3.Blob` allows incremental I/O " -"operations on blobs. (Contributed by Aviv Palivoda and Erlend E. Aasland " -"in :issue:`24905`.)" +"Add :meth:`~sqlite3.Connection.blobopen` to :class:`sqlite3.Connection`. :" +"class:`sqlite3.Blob` allows incremental I/O operations on blobs. " +"(Contributed by Aviv Palivoda and Erlend E. Aasland in :issue:`24905`.)" msgstr "" -"在 :class:`sqlite3.Connection` 新" -"增 :meth:`~sqlite3.Connection.blobopen`。 :class:`sqlite3.Blob` 允許對 blob " -"進行增量 I/O 操作 (incremental I/O operations)。(由 Aviv Palivoda 和 Erlend " -"E. Aasland 在 :issue:`24905` 中貢獻。)" +"在 :class:`sqlite3.Connection` 新增 :meth:`~sqlite3.Connection.blobopen`。 :" +"class:`sqlite3.Blob` 允許對 blob 進行增量 I/O 操作 (incremental I/O " +"operations)。(由 Aviv Palivoda 和 Erlend E. Aasland 在 :issue:`24905` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:1017 msgid "string" @@ -1765,15 +1751,15 @@ msgstr "string" #: ../../whatsnew/3.11.rst:1019 msgid "" -"Add :meth:`~string.Template.get_identifiers` " -"and :meth:`~string.Template.is_valid` to :class:`string.Template`, which " -"respectively return all valid placeholders, and whether any invalid " -"placeholders are present. (Contributed by Ben Kehoe in :gh:`90465`.)" +"Add :meth:`~string.Template.get_identifiers` and :meth:`~string.Template." +"is_valid` to :class:`string.Template`, which respectively return all valid " +"placeholders, and whether any invalid placeholders are present. (Contributed " +"by Ben Kehoe in :gh:`90465`.)" msgstr "" -"新增 :meth:`~string.Template.get_identifiers` " -"和 :meth:`~string.Template.is_valid` 於 :class:`string.Template`,分別能夠回" -"傳所有合格的預留位置 (placeholder) 與是否有任何不合格的預留位置存在。(由 " -"Ben Kehoe 於 :gh:`90465` 中貢獻。)" +"新增 :meth:`~string.Template.get_identifiers` 和 :meth:`~string.Template." +"is_valid` 於 :class:`string.Template`,分別能夠回傳所有合格的預留位置 " +"(placeholder) 與是否有任何不合格的預留位置存在。(由 Ben Kehoe 於 :gh:" +"`90465` 中貢獻。)" #: ../../whatsnew/3.11.rst:1029 msgid "sys" @@ -1784,8 +1770,8 @@ msgid "" ":func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields from " "the ``value`` (the exception instance), so when an exception is modified " "while it is being handled, the changes are reflected in the results of " -"subsequent calls to :func:`!exc_info`. (Contributed by Irit Katriel " -"in :issue:`45711`.)" +"subsequent calls to :func:`!exc_info`. (Contributed by Irit Katriel in :" +"issue:`45711`.)" msgstr "" ":func:`sys.exc_info` 現在從 ``value``\\ (例外實例)衍生出 ``type`` 和 " "``traceback`` 欄位,因此當例外在處理過程中被修改時,變更會反映在 :func:`!" @@ -1794,20 +1780,20 @@ msgstr "" #: ../../whatsnew/3.11.rst:1037 msgid "" "Add :func:`sys.exception` which returns the active exception instance " -"(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel " -"in :issue:`46328`.)" +"(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel in :" +"issue:`46328`.)" msgstr "" -"新增會回傳活躍例外實例 (active exception instance) " -"的 :func:`sys.exception`\\ (等價於 ``sys.exc_info()[1]``\\ )。(由 Irit " -"Katriel 於 :issue:`46328` 中所貢獻。)" +"新增會回傳活躍例外實例 (active exception instance) 的 :func:`sys." +"exception`\\ (等價於 ``sys.exc_info()[1]``\\ )。(由 Irit Katriel 於 :" +"issue:`46328` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1041 msgid "" "Add the :data:`sys.flags.safe_path ` flag. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" -"新增 :data:`sys.flags.safe_path ` 旗標。(由 Victor Stinner " -"於 :gh:`57684` 中所貢獻。)" +"新增 :data:`sys.flags.safe_path ` 旗標。(由 Victor Stinner 於 :" +"gh:`57684` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1048 msgid "sysconfig" @@ -1843,13 +1829,13 @@ msgid "" ":class:`~tempfile.SpooledTemporaryFile` objects now fully implement the " "methods of :class:`io.BufferedIOBase` or :class:`io.TextIOBase` (depending " "on file mode). This lets them work correctly with APIs that expect file-like " -"objects, such as compression modules. (Contributed by Carey Metcalfe " -"in :gh:`70363`.)" +"objects, such as compression modules. (Contributed by Carey Metcalfe in :gh:" +"`70363`.)" msgstr "" -":class:`~tempfile.SpooledTemporaryFile` 物件現在完整實作" -"了 :class:`io.BufferedIOBase` 或 :class:`io.TextIOBase` 的方法(取決於檔案模" -"式),這使它們能夠正確地使用需要類檔案物件的 API,例如壓縮模組。(由 Carey " -"Metcalfe 在 :gh:`70363` 中貢獻。)" +":class:`~tempfile.SpooledTemporaryFile` 物件現在完整實作了 :class:`io." +"BufferedIOBase` 或 :class:`io.TextIOBase` 的方法(取決於檔案模式),這使它們" +"能夠正確地使用需要類檔案物件的 API,例如壓縮模組。(由 Carey Metcalfe 在 :gh:" +"`70363` 中貢獻。)" #: ../../whatsnew/3.11.rst:1080 msgid "threading" @@ -1861,13 +1847,13 @@ msgid "" "(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses " "the monotonic clock (:const:`time.CLOCK_MONOTONIC`) for the timeout, rather " "than using the system clock (:const:`time.CLOCK_REALTIME`), to not be " -"affected by system clock changes. (Contributed by Victor Stinner " -"in :issue:`41710`.)" +"affected by system clock changes. (Contributed by Victor Stinner in :issue:" +"`41710`.)" msgstr "" "在 Unix 上,如果 ``sem_clockwait()`` 函式在 C 函式庫(glibc 2.30 與其更新的版" -"本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 " -"(:const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 " -"(:const:`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner " +"本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 (:" +"const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:" +"const:`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner " "在 :issue:`41710` 中貢獻。)" #: ../../whatsnew/3.11.rst:1093 @@ -1883,10 +1869,9 @@ msgid "" "Benjamin Szőke and Victor Stinner in :issue:`21302`.)" msgstr "" "在 Unix 上,如果可用的話,:func:`time.sleep` 現在會使用 " -"``clock_nanosleep()`` 或 ``nanosleep()`` 函式,其解析度為 1 納秒" -"(10\\ :sup:`-9` 秒),而不是使用解析度為 1 微秒(10\\ :sup:`-6` 秒)的 " -"``select()``。(由 Benjamin Szőke 和 Victor Stinner 在 :issue:`21302` 中貢" -"獻。)" +"``clock_nanosleep()`` 或 ``nanosleep()`` 函式,其解析度為 1 納秒(10\\ :sup:" +"`-9` 秒),而不是使用解析度為 1 微秒(10\\ :sup:`-6` 秒)的 ``select()``。" +"(由 Benjamin Szőke 和 Victor Stinner 在 :issue:`21302` 中貢獻。)" #: ../../whatsnew/3.11.rst:1101 msgid "" @@ -1895,15 +1880,15 @@ msgid "" "hardware/drivers/kernel/high-resolution-timers>`_ which has a resolution of " "100 nanoseconds (10\\ :sup:`-7` seconds). Previously, it had a resolution of " "1 millisecond (10\\ :sup:`-3` seconds). (Contributed by Benjamin Szőke, " -"Donghee Na, Eryk Sun and Victor Stinner in :issue:`21302` " -"and :issue:`45429`.)" +"Donghee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:" +"`45429`.)" msgstr "" "在 Windows 8.1 或更新的平台上,:func:`time.sleep` 現在使用了一個基於\\ `高解" "析度計時器 `_\\ 的可等待 (waitable) 計時器,解析度為 100 奈秒" "(即 10\\ :sup:`-7` 秒)。在這之前,它只有 1 微秒(10\\ :sup:`-3` 秒) 的解析" -"度。(由 Benjamin Szőke、Donghee Na、Eryk Sun 和 Victor Stinner " -"於 :issue:`21302` 與 :issue:`45429` 中貢獻。)" +"度。(由 Benjamin Szőke、Donghee Na、Eryk Sun 和 Victor Stinner 於 :issue:" +"`21302` 與 :issue:`45429` 中貢獻。)" #: ../../whatsnew/3.11.rst:1112 msgid "tkinter" @@ -1934,13 +1919,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:1129 msgid "" -"Add :func:`traceback.TracebackException.print`, which prints the " -"formatted :exc:`~traceback.TracebackException` instance to a file. " -"(Contributed by Irit Katriel in :issue:`33809`.)" +"Add :func:`traceback.TracebackException.print`, which prints the formatted :" +"exc:`~traceback.TracebackException` instance to a file. (Contributed by Irit " +"Katriel in :issue:`33809`.)" msgstr "" -"新增 :func:`traceback.TracebackException.print`,它會印出格式化" -"的 :exc:`~traceback.TracebackException` 實例至一個檔案。(由 Irit Katriel " -"在 :issue:`33809` 中貢獻。)" +"新增 :func:`traceback.TracebackException.print`,它會印出格式化的 :exc:" +"`~traceback.TracebackException` 實例至一個檔案。(由 Irit Katriel 在 :issue:" +"`33809` 中貢獻。)" #: ../../whatsnew/3.11.rst:1137 msgid "typing" @@ -1952,16 +1937,14 @@ msgstr "重大變更請見 :ref:`new-feat-related-type-hints-311`。" #: ../../whatsnew/3.11.rst:1141 msgid "" -"Add :func:`typing.assert_never` " -"and :class:`typing.Never`. :func:`typing.assert_never` is useful for asking " -"a type checker to confirm that a line of code is not reachable. At runtime, " -"it raises an :exc:`AssertionError`. (Contributed by Jelle Zijlstra " -"in :gh:`90633`.)" +"Add :func:`typing.assert_never` and :class:`typing.Never`. :func:`typing." +"assert_never` is useful for asking a type checker to confirm that a line of " +"code is not reachable. At runtime, it raises an :exc:`AssertionError`. " +"(Contributed by Jelle Zijlstra in :gh:`90633`.)" msgstr "" -"新增 :func:`typing.assert_never` " -"和 :class:`typing.Never`。 :func:`typing.assert_never` 可用於要型別檢查器確認" -"某行程式碼是否不可觸及。在執行環境,它會引發 :exc:`AssertionError`。(由 " -"Jelle Zijlstra 在 :gh:`90633` 中貢獻。)" +"新增 :func:`typing.assert_never` 和 :class:`typing.Never`。 :func:`typing." +"assert_never` 可用於要型別檢查器確認某行程式碼是否不可觸及。在執行環境,它會" +"引發 :exc:`AssertionError`。(由 Jelle Zijlstra 在 :gh:`90633` 中貢獻。)" #: ../../whatsnew/3.11.rst:1147 msgid "" @@ -1989,16 +1972,16 @@ msgid "" ":data:`typing.TypedDict` types can now be generic. (Contributed by Samodya " "Abeysiriwardane in :gh:`89026`.)" msgstr "" -":data:`typing.TypedDict` 型別現可為泛型。(由 Samodya Abeysiriwardane " -"於 :gh:`89026` 中所貢獻。)" +":data:`typing.TypedDict` 型別現可為泛型。(由 Samodya Abeysiriwardane 於 :gh:" +"`89026` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1160 msgid "" ":class:`~typing.NamedTuple` types can now be generic. (Contributed by Serhiy " "Storchaka in :issue:`43923`.)" msgstr "" -":class:`~typing.NamedTuple` 型別現可為泛型。(由 Serhiy Storchaka " -"於 :issue:`43923` 中所貢獻。)" +":class:`~typing.NamedTuple` 型別現可為泛型。(由 Serhiy Storchaka 於 :issue:" +"`43923` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1163 msgid "" @@ -2021,8 +2004,8 @@ msgstr "" msgid "" "The :func:`typing.get_overloads` function can be used for introspecting the " "overloads of a function. :func:`typing.clear_overloads` can be used to clear " -"all registered overloads of a function. (Contributed by Jelle Zijlstra " -"in :gh:`89263`.)" +"all registered overloads of a function. (Contributed by Jelle Zijlstra in :" +"gh:`89263`.)" msgstr "" ":func:`typing.get_overloads` 函式可用於自我檢查 (introspect) 一個函式的過載 " "(overload)。:func:`typing.clear_overloads` 可用於清除一個函式的所有已註冊過" @@ -2061,28 +2044,28 @@ msgid "" "references in :ref:`PEP 585 generic aliases `. " "(Contributed by Niklas Rosenstein in :gh:`85542`.)" msgstr "" -"作為\\ :ref:`PEP 585 泛化別名 `\\ 中的前向參" -"照,:func:`typing.get_type_hints` 現支援了為字串求值 (evaluate)。(由 Niklas " +"作為\\ :ref:`PEP 585 泛化別名 `\\ 中的前向參照,:func:" +"`typing.get_type_hints` 現支援了為字串求值 (evaluate)。(由 Niklas " "Rosenstein 在 :gh:`85542` 中貢獻。)" #: ../../whatsnew/3.11.rst:1192 msgid "" ":func:`typing.get_type_hints` no longer adds :data:`~typing.Optional` to " -"parameters with ``None`` as a default. (Contributed by Nikita Sobolev " -"in :gh:`90353`.)" +"parameters with ``None`` as a default. (Contributed by Nikita Sobolev in :gh:" +"`90353`.)" msgstr "" ":func:`typing.get_type_hints` 不再將 :data:`~typing.Optional` 新增到預設為 " "``None`` 的參數中。(由 Nikita Sobolev 在 :gh:`90353` 中貢獻。)" #: ../../whatsnew/3.11.rst:1196 msgid "" -":func:`typing.get_type_hints` now supports evaluating bare " -"stringified :data:`~typing.ClassVar` annotations. (Contributed by Gregory " -"Beauregard in :gh:`90711`.)" +":func:`typing.get_type_hints` now supports evaluating bare stringified :data:" +"`~typing.ClassVar` annotations. (Contributed by Gregory Beauregard in :gh:" +"`90711`.)" msgstr "" ":func:`typing.get_type_hints` 現在支援為無修飾 (bare) 字串化 (stringified) " -"的 :data:`~typing.ClassVar` 標註來求值。(由 Gregory Beauregard " -"在 :gh:`90711` 中貢獻。)" +"的 :data:`~typing.ClassVar` 標註來求值。(由 Gregory Beauregard 在 :gh:" +"`90711` 中貢獻。)" #: ../../whatsnew/3.11.rst:1200 msgid "" @@ -2111,21 +2094,17 @@ msgstr "unittest" #: ../../whatsnew/3.11.rst:1219 msgid "" -"Added methods :meth:`~unittest.TestCase.enterContext` " -"and :meth:`~unittest.TestCase.enterClassContext` of " -"class :class:`~unittest.TestCase`, " -"method :meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` of " -"class :class:`~unittest.IsolatedAsyncioTestCase` and " -"function :func:`unittest.enterModuleContext`. (Contributed by Serhiy " -"Storchaka in :issue:`45046`.)" -msgstr "" -"新增 :class:`~unittest.TestCase` 類別" -"的 :meth:`~unittest.TestCase.enterContext` " -"與 :meth:`~unittest.TestCase.enterClassContext` 方" -"法、 :class:`~unittest.IsolatedAsyncioTestCase` 類別 " -"的 :meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` 方" -"法、:func:`unittest.enterModuleContext` 函式。(由 Serhiy Storchaka " -"於 :issue:`45046` 貢獻。)" +"Added methods :meth:`~unittest.TestCase.enterContext` and :meth:`~unittest." +"TestCase.enterClassContext` of class :class:`~unittest.TestCase`, method :" +"meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` of class :class:" +"`~unittest.IsolatedAsyncioTestCase` and function :func:`unittest." +"enterModuleContext`. (Contributed by Serhiy Storchaka in :issue:`45046`.)" +msgstr "" +"新增 :class:`~unittest.TestCase` 類別的 :meth:`~unittest.TestCase." +"enterContext` 與 :meth:`~unittest.TestCase.enterClassContext` 方法、 :class:" +"`~unittest.IsolatedAsyncioTestCase` 類別 的 :meth:`~unittest." +"IsolatedAsyncioTestCase.enterAsyncContext` 方法、:func:`unittest." +"enterModuleContext` 函式。(由 Serhiy Storchaka 於 :issue:`45046` 貢獻。)" #: ../../whatsnew/3.11.rst:1231 msgid "venv" @@ -2139,8 +2118,8 @@ msgid "" "installation scheme is the default. That means that downstream distributors " "can change the default sysconfig install scheme without changing behavior of " "virtual environments. Third party code that also creates new virtual " -"environments should do the same. (Contributed by Miro Hrončok " -"in :issue:`45413`.)" +"environments should do the same. (Contributed by Miro Hrončok in :issue:" +"`45413`.)" msgstr "" "建立新的 Python 虛擬環境時,*venv* :ref:`sysconfig 安裝方案 " "`\\ 會被用於確定環境內的路徑。當 Python 在虛擬環境中運行" @@ -2154,10 +2133,10 @@ msgstr "warnings" #: ../../whatsnew/3.11.rst:1249 msgid "" -":func:`warnings.catch_warnings` now accepts arguments " -"for :func:`warnings.simplefilter`, providing a more concise way to locally " -"ignore warnings or convert them to errors. (Contributed by Zac Hatfield-" -"Dodds in :issue:`47074`.)" +":func:`warnings.catch_warnings` now accepts arguments for :func:`warnings." +"simplefilter`, providing a more concise way to locally ignore warnings or " +"convert them to errors. (Contributed by Zac Hatfield-Dodds in :issue:" +"`47074`.)" msgstr "" ":func:`warnings.catch_warnings` 現在接受 :func:`warnings.simplefilter` 的引" "數,提供了一種更簡潔的方法來在本地端忽略警告或將它們轉換為錯誤。(由 Zac " @@ -2169,8 +2148,8 @@ msgstr "zipfile" #: ../../whatsnew/3.11.rst:1259 msgid "" -"Added support for specifying member name encoding for reading metadata in " -"a :class:`~zipfile.ZipFile`'s directory and file headers. (Contributed by " +"Added support for specifying member name encoding for reading metadata in a :" +"class:`~zipfile.ZipFile`'s directory and file headers. (Contributed by " "Stephen J. Turnbull and Serhiy Storchaka in :issue:`28080`.)" msgstr "" "新增了對指定成員名稱編碼的支援,以便在 :class:`~zipfile.ZipFile` 的目錄和檔案" @@ -2187,13 +2166,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:1267 msgid "" -"Added :attr:`~zipfile.Path.stem`, :attr:`~zipfile.Path.suffix` " -"and :attr:`~zipfile.Path.suffixes` to :class:`zipfile.Path`. (Contributed by " -"Miguel Brito in :gh:`88261`.)" +"Added :attr:`~zipfile.Path.stem`, :attr:`~zipfile.Path.suffix` and :attr:" +"`~zipfile.Path.suffixes` to :class:`zipfile.Path`. (Contributed by Miguel " +"Brito in :gh:`88261`.)" msgstr "" -"於 :class:`zipfile.Path` 新" -"增 :attr:`~zipfile.Path.stem`、:attr:`~zipfile.Path.suffix` " -"和 :attr:`~zipfile.Path.suffixes`。(由 Miguel Brito 於 :gh:`88261` 貢獻。)" +"於 :class:`zipfile.Path` 新增 :attr:`~zipfile.Path.stem`、:attr:`~zipfile." +"Path.suffix` 和 :attr:`~zipfile.Path.suffixes`。(由 Miguel Brito 於 :gh:" +"`88261` 貢獻。)" #: ../../whatsnew/3.11.rst:1275 msgid "Optimizations" @@ -2201,9 +2180,8 @@ msgstr "最佳化" #: ../../whatsnew/3.11.rst:1277 msgid "" -"This section covers specific optimizations independent of " -"the :ref:`whatsnew311-faster-cpython` project, which is covered in its own " -"section." +"This section covers specific optimizations independent of the :ref:" +"`whatsnew311-faster-cpython` project, which is covered in its own section." msgstr "" "這個部分會涵蓋到特定的最佳化,但獨立於擁有自己一個說明的\\ :ref:`whatsnew311-" "faster-cpython` 計畫。" @@ -2224,8 +2202,8 @@ msgstr "" msgid "" "Integer division (``//``) is better tuned for optimization by compilers. It " "is now around 20% faster on x86-64 when dividing an :class:`int` by a value " -"smaller than ``2**30``. (Contributed by Gregory P. Smith and Tim Peters " -"in :gh:`90564`.)" +"smaller than ``2**30``. (Contributed by Gregory P. Smith and Tim Peters in :" +"gh:`90564`.)" msgstr "" "整數除法 (``//``) 為了編譯器最佳化而被調校過。現在將 :class:`int` 除以小於 " "``2**30`` 的值時,在 x86-64 上快了大約 20%。(由 Gregory P. Smith 和 Tim " @@ -2241,21 +2219,20 @@ msgstr "" #: ../../whatsnew/3.11.rst:1294 msgid "" -"Resizing lists is streamlined for the common case, speeding " -"up :meth:`list.append` by ≈15% and simple :term:`list comprehension`\\s by " -"up to 20-30% (Contributed by Dennis Sweeney in :gh:`91165`.)" +"Resizing lists is streamlined for the common case, speeding up :meth:`list." +"append` by ≈15% and simple :term:`list comprehension`\\s by up to 20-30% " +"(Contributed by Dennis Sweeney in :gh:`91165`.)" msgstr "" "調整 list 大小在常見情況下增進了效能,為 :meth:`list.append` 加快了約 15% 並" -"為簡單的 :term:`list comprehension` 加快了高達 20-30%(由 Dennis Sweeney " -"在 :gh:`91165` 中貢獻。)" +"為簡單的 :term:`list comprehension` 加快了高達 20-30%(由 Dennis Sweeney 在 :" +"gh:`91165` 中貢獻。)" #: ../../whatsnew/3.11.rst:1299 msgid "" "Dictionaries don't store hash values when all keys are Unicode objects, " -"decreasing :class:`dict` size. For example, " -"``sys.getsizeof(dict.fromkeys(\"abcdefg\"))`` is reduced from 352 bytes to " -"272 bytes (23% smaller) on 64-bit platforms. (Contributed by Inada Naoki " -"in :issue:`46845`.)" +"decreasing :class:`dict` size. For example, ``sys.getsizeof(dict." +"fromkeys(\"abcdefg\"))`` is reduced from 352 bytes to 272 bytes (23% " +"smaller) on 64-bit platforms. (Contributed by Inada Naoki in :issue:`46845`.)" msgstr "" "當所有鍵都是 Unicode 物件時,字典不儲存雜湊值,減少了 :class:`dict` 的大小。" "例如,``sys.getsizeof(dict.fromkeys(\"abcdefg\"))`` 在 64-bit 平台上從 352 位" @@ -2269,8 +2246,8 @@ msgid "" "for a ≈60 MiB file. (Contributed by msoxzw in :gh:`91487`.)" msgstr "" "使用 :class:`asyncio.DatagramProtocol` 以透過 UDP 傳輸大文件時,現在速度提高" -"了幾個數量級,傳輸 ≈60 MiB 檔案的速度提高了 100 多倍。(由 msoxzw " -"在 :gh:`91487` 中貢獻。)" +"了幾個數量級,傳輸 ≈60 MiB 檔案的速度提高了 100 多倍。(由 msoxzw 在 :gh:" +"`91487` 中貢獻。)" #: ../../whatsnew/3.11.rst:1310 msgid "" @@ -2279,22 +2256,21 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`37295`.)" msgstr "" ":mod:`math` 函式 :func:`~math.comb` 和 :func:`~math.perm` 針對較大引數現在快" -"了 ≈10 倍(對於更大的 *k* 有更大的加速)。(由 Serhiy Storchaka " -"在 :issue:`37295` 中貢獻。)" +"了 ≈10 倍(對於更大的 *k* 有更大的加速)。(由 Serhiy Storchaka 在 :issue:" +"`37295` 中貢獻。)" #: ../../whatsnew/3.11.rst:1314 msgid "" -"The :mod:`statistics` " -"functions :func:`~statistics.mean`, :func:`~statistics.variance` " -"and :func:`~statistics.stdev` now consume iterators in one pass rather than " -"converting them to a :class:`list` first. This is twice as fast and can save " -"substantial memory. (Contributed by Raymond Hettinger in :gh:`90415`.)" +"The :mod:`statistics` functions :func:`~statistics.mean`, :func:`~statistics." +"variance` and :func:`~statistics.stdev` now consume iterators in one pass " +"rather than converting them to a :class:`list` first. This is twice as fast " +"and can save substantial memory. (Contributed by Raymond Hettinger in :gh:" +"`90415`.)" msgstr "" -":mod:`statistics` 函" -"式 :func:`~statistics.mean`、:func:`~statistics.variance` " -"和 :func:`~statistics.stdev` 現在會一次性的消耗疊代器,而不是先將它們轉換" -"為 :class:`list`,這讓速度提升為兩倍並可以節省大量記憶體空間。(由 Raymond " -"Hettinger 在 :gh:`90415` 中貢獻。)" +":mod:`statistics` 函式 :func:`~statistics.mean`、:func:`~statistics." +"variance` 和 :func:`~statistics.stdev` 現在會一次性的消耗疊代器,而不是先將它" +"們轉換為 :class:`list`,這讓速度提升為兩倍並可以節省大量記憶體空間。(由 " +"Raymond Hettinger 在 :gh:`90415` 中貢獻。)" #: ../../whatsnew/3.11.rst:1320 msgid "" @@ -2327,9 +2303,9 @@ msgid "" "startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " "this project are listed separately under :ref:`whatsnew311-optimizations`." msgstr "" -"此計畫專注在 Python 的 :ref:`whatsnew311-faster-startup` " -"和 :ref:`whatsnew311-faster-runtime`。不在此專案內的最佳化被獨立列出" -"在 :ref:`whatsnew311-optimizations`。" +"此計畫專注在 Python 的 :ref:`whatsnew311-faster-startup` 和 :ref:" +"`whatsnew311-faster-runtime`。不在此專案內的最佳化被獨立列出在 :ref:" +"`whatsnew311-optimizations`。" #: ../../whatsnew/3.11.rst:1346 msgid "Faster Startup" @@ -2362,9 +2338,9 @@ msgid "" "statically allocated by the interpreter. This reduces the steps in module " "execution process to:" msgstr "" -"在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的" -"\\ :ref:`程式碼物件 `\\ (和位元組碼)是由直譯器靜態分配的。這將" -"模組執行過程中的步驟減少為:" +"在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的\\ :" +"ref:`程式碼物件 `\\ (和位元組碼)是由直譯器靜態分配的。這將模組" +"執行過程中的步驟減少為:" #: ../../whatsnew/3.11.rst:1367 msgid "Statically allocated code object -> Evaluate" @@ -2420,10 +2396,10 @@ msgstr "" #: ../../whatsnew/3.11.rst:1396 msgid "" "Old-style :ref:`frame objects ` are now created only when " -"requested by debuggers or by Python introspection functions such " -"as :func:`sys._getframe` and :func:`inspect.currentframe`. For most user " -"code, no frame objects are created at all. As a result, nearly all Python " -"functions calls have sped up significantly. We measured a 3-7% speedup in " +"requested by debuggers or by Python introspection functions such as :func:" +"`sys._getframe` and :func:`inspect.currentframe`. For most user code, no " +"frame objects are created at all. As a result, nearly all Python functions " +"calls have sped up significantly. We measured a 3-7% speedup in " "pyperformance." msgstr "" "舊式\\ :ref:`幀物件 `\\ 現在僅在除錯器或 Python 自我檢查函式" @@ -2463,14 +2439,13 @@ msgid "" "Most Python function calls now consume no C stack space, speeding them up. " "In simple recursive functions like fibonacci or factorial, we observed a " "1.7x speedup. This also means recursive functions can recurse significantly " -"deeper (if the user increases the recursion limit " -"with :func:`sys.setrecursionlimit`). We measured a 1-3% improvement in " -"pyperformance." +"deeper (if the user increases the recursion limit with :func:`sys." +"setrecursionlimit`). We measured a 1-3% improvement in pyperformance." msgstr "" "現在大多數 Python 函式的呼叫因為不會佔用 C 堆疊空間而被加速。在斐波那契 " "(fibonacci) 或階乘等簡單遞迴函式中,觀察到 1.7 倍的加速。這也意味著遞迴函式可" -"以遞迴得更深(如果使用者有增加\\ :func:`遞迴限制 " -"`\\ )。我們在 pyperformance 測得 1-3% 的改進。" +"以遞迴得更深(如果使用者有增加\\ :func:`遞迴限制 `\\ )。我們在 pyperformance 測得 1-3% 的改進。" #: ../../whatsnew/3.11.rst:1427 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" @@ -2498,8 +2473,8 @@ msgid "" "more specialized one. This specialized operation uses fast paths available " "only to those use cases/types, which generally outperform their generic " "counterparts. This also brings in another concept called *inline caching*, " -"where Python caches the results of expensive operations directly in " -"the :term:`bytecode`." +"where Python caches the results of expensive operations directly in the :" +"term:`bytecode`." msgstr "" "在執行環境,Python 將嘗試在執行中的程式碼內尋找常用模式和型別穩定,然後 " "Python 將用更特化的操作替換目前操作。這種特化操作運用了僅適用於那些用例/型別" @@ -2531,13 +2506,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:1457 msgid "" -"(PEP written by Mark Shannon, with ideas inspired by Stefan Brunthaler. " -"See :pep:`659` for more information. Implementation by Mark Shannon and " -"Brandt Bucher, with additional help from Irit Katriel and Dennis Sweeney.)" +"(PEP written by Mark Shannon, with ideas inspired by Stefan Brunthaler. See :" +"pep:`659` for more information. Implementation by Mark Shannon and Brandt " +"Bucher, with additional help from Irit Katriel and Dennis Sweeney.)" msgstr "" -"(PEP 由 Mark Shannon 撰寫、概念啟發自 Stefan Brunthaler。詳情請" -"見 :pep:`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis " -"Sweeney 亦提供了額外的幫助。)" +"(PEP 由 Mark Shannon 撰寫、概念啟發自 Stefan Brunthaler。詳情請見 :pep:" +"`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis Sweeney " +"亦提供了額外的幫助。)" #: ../../whatsnew/3.11.rst:1465 msgid "Operation" @@ -2577,9 +2552,9 @@ msgstr "``x * x``" #: ../../whatsnew/3.11.rst:1468 msgid "" -"Binary add, multiply and subtract for common types such " -"as :class:`int`, :class:`float` and :class:`str` take custom fast paths for " -"their underlying types." +"Binary add, multiply and subtract for common types such as :class:`int`, :" +"class:`float` and :class:`str` take custom fast paths for their underlying " +"types." msgstr "" "常見型別如 :class:`int`、:class:`float` 與 :class:`str` 的二元加法、乘法與減" "法,為底層型別採取了特製的快速路徑。" @@ -2602,16 +2577,16 @@ msgstr "``a[i]``" #: ../../whatsnew/3.11.rst:1474 msgid "" -"Subscripting container types such as :class:`list`, :class:`tuple` " -"and :class:`dict` directly index the underlying data structures." +"Subscripting container types such as :class:`list`, :class:`tuple` and :" +"class:`dict` directly index the underlying data structures." msgstr "" "下標容器型別如 :class:`list`、:class:`tuple` 和 :class:`dict` 直接索引底層的" "資料結構。" #: ../../whatsnew/3.11.rst:1478 msgid "" -"Subscripting custom :meth:`~object.__getitem__` is also inlined similar " -"to :ref:`inline-calls`." +"Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" +"ref:`inline-calls`." msgstr "" "下標自定義 :meth:`~object.__getitem__` 也是行內的,類似於 :ref:`inline-" "calls`。" @@ -2654,8 +2629,8 @@ msgstr "``C(arg)``" #: ../../whatsnew/3.11.rst:1484 msgid "" -"Calls to common builtin (C) functions and types such as :func:`len` " -"and :class:`str` directly call their underlying C version. This avoids going " +"Calls to common builtin (C) functions and types such as :func:`len` and :" +"class:`str` directly call their underlying C version. This avoids going " "through the internal calling convention." msgstr "" "常見內建 (C) 函式和型別的呼叫,例如 :func:`len` 和 :class:`str`,會直接呼叫它" @@ -2793,8 +2768,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:1513 msgid "" "A similar optimization already existed since Python 3.10. 3.11 specializes " -"for more forms. Furthermore, all attribute loads should be sped up " -"by :issue:`45947`." +"for more forms. Furthermore, all attribute loads should be sped up by :issue:" +"`45947`." msgstr "" "類似的最佳化自從 Python 3.10 就存在。3.11 特別處理了更多形式。此外,所有屬性" "載入也被 :issue:`45947` 所加速。" @@ -2810,17 +2785,17 @@ msgid "" "Mark Shannon in :issue:`45340` and :issue:`40116`.)" msgstr "" "物件現在因為使用了惰性建立的物件命名空間所以需要更少的記憶體。它們的命名空間" -"字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` " -"和 :issue:`40116` 貢獻。 )" +"字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` 和 :issue:" +"`40116` 貢獻。 )" #: ../../whatsnew/3.11.rst:1527 msgid "" -"\"Zero-cost\" exceptions are implemented, eliminating the cost " -"of :keyword:`try` statements when no exception is raised. (Contributed by " -"Mark Shannon in :issue:`40222`.)" +"\"Zero-cost\" exceptions are implemented, eliminating the cost of :keyword:" +"`try` statements when no exception is raised. (Contributed by Mark Shannon " +"in :issue:`40222`.)" msgstr "" -"實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時" -"的 :keyword:`try` 陳述式開銷。(由 Mark Shannon 於 :issue:`40222` 貢獻。)" +"實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時的 :keyword:" +"`try` 陳述式開銷。(由 Mark Shannon 於 :issue:`40222` 貢獻。)" #: ../../whatsnew/3.11.rst:1531 msgid "" @@ -2836,9 +2811,9 @@ msgid "" ":mod:`re`'s regular expression matching engine has been partially " "refactored, and now uses computed gotos (or \"threaded code\") on supported " "platforms. As a result, Python 3.11 executes the `pyperformance regular " -"expression benchmarks `_ up to 10% faster than Python 3.10. (Contributed " -"by Brandt Bucher in :gh:`91404`.)" +"expression benchmarks `_ up to 10% faster than Python 3.10. (Contributed by Brandt " +"Bucher in :gh:`91404`.)" msgstr "" ":mod:`re` 的正規表示式比對引擎部分被重構,且現在會有支援的平台上使用 " "computed gotos(或者「執行緒程式碼 (threaded code)」),因此 Python 3.11 在執" @@ -2973,9 +2948,9 @@ msgstr ":opcode:`MAKE_CELL` 被用於建立 :ref:`cell-objects`。" #: ../../whatsnew/3.11.rst:1632 msgid "" -":opcode:`CHECK_EG_MATCH` and :opcode:`!PREP_RERAISE_STAR`, to handle " -"the :ref:`new exception groups and except* ` added " -"in :pep:`654`." +":opcode:`CHECK_EG_MATCH` and :opcode:`!PREP_RERAISE_STAR`, to handle the :" +"ref:`new exception groups and except* ` added in :pep:" +"`654`." msgstr "" ":opcode:`CHECK_EG_MATCH` 和 :opcode:`!PREP_RERAISE_STAR`,處理 :pep:`654` 所" "加入的\\ :ref:`新增例外群組和 except* `。" @@ -3006,11 +2981,11 @@ msgstr "新的操作碼" msgid "Notes" msgstr "註記" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1650 msgid ":opcode:`!BINARY_*`" msgstr ":opcode:`!BINARY_*`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1651 msgid ":opcode:`!INPLACE_*`" msgstr ":opcode:`!INPLACE_*`" @@ -3022,31 +2997,31 @@ msgstr ":opcode:`BINARY_OP`" msgid "Replaced all numeric binary/in-place opcodes with a single opcode" msgstr "以單一一個操作碼來取代所有數值的、二進位/原位 (in-place) 操作碼" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1653 msgid ":opcode:`!CALL_FUNCTION`" msgstr ":opcode:`!CALL_FUNCTION`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1654 msgid ":opcode:`!CALL_FUNCTION_KW`" msgstr ":opcode:`!CALL_FUNCTION_KW`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1655 msgid ":opcode:`!CALL_METHOD`" msgstr ":opcode:`!CALL_METHOD`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1653 msgid ":opcode:`CALL`" msgstr ":opcode:`CALL`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1654 msgid ":opcode:`!KW_NAMES`" msgstr ":opcode:`!KW_NAMES`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1655 msgid ":opcode:`!PRECALL`" msgstr ":opcode:`!PRECALL`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1656 msgid ":opcode:`PUSH_NULL`" msgstr ":opcode:`PUSH_NULL`" @@ -3058,35 +3033,35 @@ msgstr "" "將方法的引數搬移 (argument shifting) 與關鍵字引數的處理分離開來;允許更好的呼" "叫特化" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1658 msgid ":opcode:`!DUP_TOP`" msgstr ":opcode:`!DUP_TOP`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1659 msgid ":opcode:`!DUP_TOP_TWO`" msgstr ":opcode:`!DUP_TOP_TWO`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1660 msgid ":opcode:`!ROT_TWO`" msgstr ":opcode:`!ROT_TWO`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1661 msgid ":opcode:`!ROT_THREE`" msgstr ":opcode:`!ROT_THREE`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1662 msgid ":opcode:`!ROT_FOUR`" msgstr ":opcode:`!ROT_FOUR`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1663 msgid ":opcode:`!ROT_N`" msgstr ":opcode:`!ROT_N`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1658 msgid ":opcode:`COPY`" msgstr ":opcode:`COPY`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1659 msgid ":opcode:`SWAP`" msgstr ":opcode:`SWAP`" @@ -3094,11 +3069,11 @@ msgstr ":opcode:`SWAP`" msgid "Stack manipulation instructions" msgstr "堆疊操作指示" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1665 msgid ":opcode:`!JUMP_IF_NOT_EXC_MATCH`" msgstr ":opcode:`!JUMP_IF_NOT_EXC_MATCH`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1665 msgid ":opcode:`CHECK_EXC_MATCH`" msgstr ":opcode:`CHECK_EXC_MATCH`" @@ -3106,27 +3081,27 @@ msgstr ":opcode:`CHECK_EXC_MATCH`" msgid "Now performs check but doesn't jump" msgstr "現在執行檢查但不跳位 (jump)" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1667 msgid ":opcode:`!JUMP_ABSOLUTE`" msgstr ":opcode:`!JUMP_ABSOLUTE`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1668 msgid ":opcode:`!POP_JUMP_IF_FALSE`" msgstr ":opcode:`!POP_JUMP_IF_FALSE`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1669 msgid ":opcode:`!POP_JUMP_IF_TRUE`" msgstr ":opcode:`!POP_JUMP_IF_TRUE`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1667 msgid ":opcode:`JUMP_BACKWARD`" msgstr ":opcode:`JUMP_BACKWARD`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1668 msgid ":opcode:`!POP_JUMP_BACKWARD_IF_*`" msgstr ":opcode:`!POP_JUMP_BACKWARD_IF_*`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1669 msgid ":opcode:`!POP_JUMP_FORWARD_IF_*`" msgstr ":opcode:`!POP_JUMP_FORWARD_IF_*`" @@ -3138,11 +3113,11 @@ msgstr "" "參見 [#bytecode-jump]_;每個方向的 ``TRUE``、``FALSE``、``NONE`` 和 " "``NOT_NONE`` 變體" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1673 msgid ":opcode:`!SETUP_WITH`" msgstr ":opcode:`!SETUP_WITH`" -#: ../../whatsnew/3.11.rst:0 +#: ../../whatsnew/3.11.rst:1674 msgid ":opcode:`!SETUP_ASYNC_WITH`" msgstr ":opcode:`!SETUP_ASYNC_WITH`" @@ -3216,12 +3191,11 @@ msgstr "語言/內建" #: ../../whatsnew/3.11.rst:1720 msgid "" "Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`) is " -"now deprecated. It can no longer be used to wrap other descriptors such " -"as :class:`property`. The core design of this feature was flawed and caused " -"a number of downstream problems. To \"pass-through\" " -"a :class:`classmethod`, consider using the :attr:`!__wrapped__` attribute " -"that was added in Python 3.10. (Contributed by Raymond Hettinger " -"in :gh:`89519`.)" +"now deprecated. It can no longer be used to wrap other descriptors such as :" +"class:`property`. The core design of this feature was flawed and caused a " +"number of downstream problems. To \"pass-through\" a :class:`classmethod`, " +"consider using the :attr:`!__wrapped__` attribute that was added in Python " +"3.10. (Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" "鏈接 :class:`classmethod` 描述器(在 :issue:`19072` 中引入)現已棄用。它不能" "再用於包裝其他描述器,例如 :class:`property`。此功能的核心設計存在缺陷,並導" @@ -3233,26 +3207,26 @@ msgstr "" msgid "" "Octal escapes in string and bytes literals with values larger than ``0o377`` " "(255 in decimal) now produce a :exc:`DeprecationWarning`. In a future Python " -"version, they will raise a :exc:`SyntaxWarning` and eventually " -"a :exc:`SyntaxError`. (Contributed by Serhiy Storchaka in :gh:`81548`.)" +"version, they will raise a :exc:`SyntaxWarning` and eventually a :exc:" +"`SyntaxError`. (Contributed by Serhiy Storchaka in :gh:`81548`.)" msgstr "" "值大於 ``0o377``\\(十進位為 255)的字串和位元組文本值 (bytes literal) 中的八" "進位跳脫 (octal escape) 現在會產生 :exc:`DeprecationWarning`。在未來的 " -"Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一" -"個 :exc:`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" +"Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一個 :exc:" +"`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" #: ../../whatsnew/3.11.rst:1734 msgid "" "The delegation of :func:`int` to :meth:`~object.__trunc__` is now " "deprecated. Calling ``int(a)`` when ``type(a)`` implements :meth:`!" "__trunc__` but not :meth:`~object.__int__` or :meth:`~object.__index__` now " -"raises a :exc:`DeprecationWarning`. (Contributed by Zackery Spytz " -"in :issue:`44977`.)" +"raises a :exc:`DeprecationWarning`. (Contributed by Zackery Spytz in :issue:" +"`44977`.)" msgstr "" ":func:`int` 到 :meth:`~object.__trunc__` 的授權 (delegation) 現已棄用。當 " -"``type(a)`` 有實作 :meth:`!__trunc__` 但沒有 :meth:`~object.__int__` " -"或 :meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一" -"個 :exc:`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" +"``type(a)`` 有實作 :meth:`!__trunc__` 但沒有 :meth:`~object.__int__` 或 :" +"meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一個 :exc:" +"`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" #: ../../whatsnew/3.11.rst:1744 msgid "Modules" @@ -3342,8 +3316,8 @@ msgstr ":mod:`!sunau`" #: ../../whatsnew/3.11.rst:1761 msgid "" -"(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner " -"in :gh:`68966`.)" +"(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" +"`68966`.)" msgstr "" "(由 Brett Cannon 和 Victor Stinner 分別於 :issue:`47061` 與 :gh:`68966` 中所" "貢獻。)" @@ -3372,8 +3346,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:1774 msgid "" "Undocumented modules :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!" -"sre_parse` are now deprecated. (Contributed by Serhiy Storchaka " -"in :issue:`47152`.)" +"sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" +"`47152`.)" msgstr "" "未被記錄於文件中的 :mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!" "sre_parse` 模組現在已被棄用。(由 Serhiy Storchaka 在 :issue:`47152` 中貢" @@ -3413,16 +3387,15 @@ msgid "" ":class:`!configparser.LegacyInterpolation` has been deprecated in the " "docstring since Python 3.2, and is not listed in the :mod:`configparser` " "documentation. It now emits a :exc:`DeprecationWarning` and will be removed " -"in Python 3.13. Use :class:`configparser.BasicInterpolation` " -"or :class:`configparser.ExtendedInterpolation` instead. (Contributed by Hugo " -"van Kemenade in :issue:`46607`.)" +"in Python 3.13. Use :class:`configparser.BasicInterpolation` or :class:" +"`configparser.ExtendedInterpolation` instead. (Contributed by Hugo van " +"Kemenade in :issue:`46607`.)" msgstr "" ":class:`!configparser.LegacyInterpolation` 自 Python 3.2 起已在文件字串中棄" -"用,並且未在 :mod:`configparser` 文件中列出。它現在會發出一" -"個 :exc:`DeprecationWarning` 並將在 Python 3.13 中刪除。請改" -"用 :class:`configparser.BasicInterpolation` " -"或 :class:`configparser.ExtendedInterpolation`。(由 Hugo van Kemenade " -"在 :issue:`46607` 中貢獻。)" +"用,並且未在 :mod:`configparser` 文件中列出。它現在會發出一個 :exc:" +"`DeprecationWarning` 並將在 Python 3.13 中刪除。請改用 :class:`configparser." +"BasicInterpolation` 或 :class:`configparser.ExtendedInterpolation`。(由 " +"Hugo van Kemenade 在 :issue:`46607` 中貢獻。)" #: ../../whatsnew/3.11.rst:1801 msgid "" @@ -3466,10 +3439,9 @@ msgstr ":func:`!importlib.resources.path`" #: ../../whatsnew/3.11.rst:1814 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " -"removed in Python 3.15. " -"Use :func:`locale.setlocale`, :func:`locale.getpreferredencoding(False) " -"` and :func:`locale.getlocale` functions " -"instead. (Contributed by Victor Stinner in :gh:`90817`.)" +"removed in Python 3.15. Use :func:`locale.setlocale`, :func:`locale." +"getpreferredencoding(False) ` and :func:`locale." +"getlocale` functions instead. (Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" ":func:`locale.getdefaultlocale` 函式已被棄用且將於 Python 3.15 中移除。請改" "用 :func:`locale.setlocale`、:func:`locale.getpreferredencoding(False) " @@ -3483,18 +3455,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" ":func:`!locale.resetlocale` 函式已棄用並將於 Python 3.13 中移除,請改用 " -"``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner " -"於 :gh:`90817` 中所貢獻。)" +"``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner 於 :gh:" +"`90817` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1824 msgid "" "Stricter rules will now be applied for numerical group references and group " "names in :ref:`regular expressions `. Only sequences of ASCII " -"digits will now be accepted as a numerical reference, and the group name " -"in :class:`bytes` patterns and replacement strings can only contain ASCII " +"digits will now be accepted as a numerical reference, and the group name in :" +"class:`bytes` patterns and replacement strings can only contain ASCII " "letters, digits and underscores. For now, a deprecation warning is raised " -"for syntax violating these rules. (Contributed by Serhiy Storchaka " -"in :gh:`91760`.)" +"for syntax violating these rules. (Contributed by Serhiy Storchaka in :gh:" +"`91760`.)" msgstr "" "現在將對\\ :ref:`正規表示式 `\\ 中的數值群組參照 (numerical group " "references) 和群組名稱套用更嚴格的規則。現在只接受 ASCII 數字序列作為數值參" @@ -3512,21 +3484,21 @@ msgid "" msgstr "" "在 :mod:`re` 模組中,:func:`!re.template` 函式和相應的 :const:`!re.TEMPLATE` " "和 :const:`!re.T` 旗標被棄用,因為它們沒被記錄於文件中並且缺乏明顯的目的。它" -"們將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok " -"在 :gh:`92728` 中貢獻。)" +"們將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" +"`92728` 中貢獻。)" #: ../../whatsnew/3.11.rst:1838 msgid "" ":func:`!turtle.settiltangle` has been deprecated since Python 3.1; it now " -"emits a deprecation warning and will be removed in Python 3.13. " -"Use :func:`turtle.tiltangle` instead (it was earlier incorrectly marked as " -"deprecated, and its docstring is now corrected). (Contributed by Hugo van " -"Kemenade in :issue:`45837`.)" +"emits a deprecation warning and will be removed in Python 3.13. Use :func:" +"`turtle.tiltangle` instead (it was earlier incorrectly marked as deprecated, " +"and its docstring is now corrected). (Contributed by Hugo van Kemenade in :" +"issue:`45837`.)" msgstr "" ":func:`!turtle.settiltangle` 自 Python 3.1 以來已被棄用;它現在會發出棄用警" "告,並將在 Python 3.13 中刪除。請改用 :func:`turtle.tiltangle`\\ (它之前被錯" -"誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade " -"在 :issue:`45837` 中貢獻。)" +"誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade 在 :issue:" +"`45837` 中貢獻。)" #: ../../whatsnew/3.11.rst:1844 msgid "" @@ -3555,18 +3527,18 @@ msgid "" "itself. (Contributed by Donghee Na in :issue:`42255`.)" msgstr "" ":class:`!webbrowser.MacOSX` 已被棄用且將於 Python 3.13 中移除。它並沒有被測試" -"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Donghee Na " -"於 :issue:`42255`。)" +"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Donghee Na 於 :" +"issue:`42255`。)" #: ../../whatsnew/3.11.rst:1858 msgid "" -"The behavior of returning a value from a :class:`~unittest.TestCase` " -"and :class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " +"The behavior of returning a value from a :class:`~unittest.TestCase` and :" +"class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " "default ``None`` value) is now deprecated." msgstr "" -"回傳從 :class:`~unittest.TestCase` " -"和 :class:`~unittest.IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除" -"外)給定值的行為現已棄用。" +"回傳從 :class:`~unittest.TestCase` 和 :class:`~unittest." +"IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除外)給定值的行為現已棄" +"用。" #: ../../whatsnew/3.11.rst:1862 msgid "" @@ -3900,16 +3872,15 @@ msgstr "被移除的 C API 被\\ :ref:`獨立列出 ` #: ../../whatsnew/3.11.rst:1955 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " -"generator-based coroutines to be compatible " -"with :keyword:`async` / :keyword:`await` code. The function has been " -"deprecated since Python 3.8 and the removal was initially scheduled for " -"Python 3.10. Use :keyword:`async def` instead. (Contributed by Illia " -"Volochii in :issue:`43216`.)" +"generator-based coroutines to be compatible with :keyword:`async` / :keyword:" +"`await` code. The function has been deprecated since Python 3.8 and the " +"removal was initially scheduled for Python 3.10. Use :keyword:`async def` " +"instead. (Contributed by Illia Volochii in :issue:`43216`.)" msgstr "" "刪除了 :func:`!@asyncio.coroutine` :term:`decorator` 使遺留的基於生成器的協" "程 (generator-based coroutine) 與 :keyword:`async` / :keyword:`await` 程式碼" -"相容。該函式自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改" -"用 :keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" +"相容。該函式自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改用 :" +"keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" #: ../../whatsnew/3.11.rst:1962 msgid "" @@ -3917,30 +3888,29 @@ msgid "" "generator-based coroutine objects in the debug mode. (Contributed by Illia " "Volochii in :issue:`43216`.)" msgstr "" -"移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!" -"asyncio.coroutines.CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢" -"獻。)" +"移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!asyncio.coroutines." +"CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢獻。)" #: ../../whatsnew/3.11.rst:1966 msgid "" -"Due to significant security concerns, the *reuse_address* parameter " -"of :meth:`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is " -"now entirely removed. This is because of the behavior of the socket option " -"``SO_REUSEADDR`` in UDP. (Contributed by Hugo van Kemenade " -"in :issue:`45129`.)" +"Due to significant security concerns, the *reuse_address* parameter of :meth:" +"`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " +"entirely removed. This is because of the behavior of the socket option " +"``SO_REUSEADDR`` in UDP. (Contributed by Hugo van Kemenade in :issue:" +"`45129`.)" msgstr "" -"因為有重大的安全性考量,Python 3.9 中停用" -"的 :meth:`asyncio.loop.create_datagram_endpoint` 之 *reuse_address* 參數目前" -"已經移除。這是因為 UDP socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo " -"van Kemenade 於 :issue:`45129` 中貢獻。)" +"因為有重大的安全性考量,Python 3.9 中停用的 :meth:`asyncio.loop." +"create_datagram_endpoint` 之 *reuse_address* 參數目前已經移除。這是因為 UDP " +"socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo van Kemenade 於 :issue:" +"`45129` 中貢獻。)" #: ../../whatsnew/3.11.rst:1972 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" msgstr "" -"移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似" -"的 :mod:`binascii` 函式也一併被移除:" +"移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似的 :mod:" +"`binascii` 函式也一併被移除:" #: ../../whatsnew/3.11.rst:1975 msgid ":func:`!binascii.a2b_hqx`" @@ -3978,34 +3948,32 @@ msgstr "" #: ../../whatsnew/3.11.rst:1988 msgid "" -"Removed the :meth:`~object.__getitem__` methods " -"of :class:`xml.dom.pulldom.DOMEventStream`, :class:`wsgiref.util.FileWrapper` " -"and :class:`fileinput.FileInput`, deprecated since Python 3.9. (Contributed " -"by Hugo van Kemenade in :issue:`45132`.)" +"Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." +"DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." +"FileInput`, deprecated since Python 3.9. (Contributed by Hugo van Kemenade " +"in :issue:`45132`.)" msgstr "" -"將 :class:`xml.dom.pulldom.DOMEventStream`、:class:`wsgiref.util.FileWrapper` " -"和 :class:`fileinput.FileInput` 自 Python 3.9 中棄用" -"的 :meth:`~object.__getitem__` 方法移除。(由 Hugo van Kemenade " -"在 :issue:`45132` 中貢獻。)" +"將 :class:`xml.dom.pulldom.DOMEventStream`、:class:`wsgiref.util." +"FileWrapper` 和 :class:`fileinput.FileInput` 自 Python 3.9 中棄用的 :meth:" +"`~object.__getitem__` 方法移除。(由 Hugo van Kemenade 在 :issue:`45132` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:1993 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" -"ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed " -"the :func:`!bind_textdomain_codeset` function, the :meth:`!" -"NullTranslations.output_charset` and :meth:`!" -"NullTranslations.set_output_charset` methods, and the *codeset* parameter " -"of :func:`!translation` and :func:`!install`, since they are only used for " -"the :func:`!l*gettext` functions. (Contributed by Donghee Na and Serhiy " -"Storchaka in :issue:`44235`.)" -msgstr "" -"刪除了已棄用的 :mod:`gettext` 函式 :func:`!lgettext`、:func:`!" -"ldgettext`、:func:`!lngettext` 和 :func:`!ldngettext`,也刪除了 :func:`!" -"bind_textdomain_codeset` 函式、:meth:`!NullTranslations.output_charset` " -"和 :meth:`!NullTranslations.set_output_charset` 方法,以及 :func:`!" -"translation` 和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!" -"l*gettext` 函式。(由 Donghee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢" -"獻。)" +"ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" +"func:`!bind_textdomain_codeset` function, the :meth:`!NullTranslations." +"output_charset` and :meth:`!NullTranslations.set_output_charset` methods, " +"and the *codeset* parameter of :func:`!translation` and :func:`!install`, " +"since they are only used for the :func:`!l*gettext` functions. (Contributed " +"by Donghee Na and Serhiy Storchaka in :issue:`44235`.)" +msgstr "" +"刪除了已棄用的 :mod:`gettext` 函式 :func:`!lgettext`、:func:`!ldgettext`、:" +"func:`!lngettext` 和 :func:`!ldngettext`,也刪除了 :func:`!" +"bind_textdomain_codeset` 函式、:meth:`!NullTranslations.output_charset` 和 :" +"meth:`!NullTranslations.set_output_charset` 方法,以及 :func:`!translation` " +"和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" +"式。(由 Donghee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" #: ../../whatsnew/3.11.rst:2003 msgid "Removed from the :mod:`inspect` module:" @@ -4013,31 +3981,30 @@ msgstr "於 :mod:`inspect` 模組中移除:" #: ../../whatsnew/3.11.rst:2005 msgid "" -"The :func:`!getargspec` function, deprecated since Python 3.0; " -"use :func:`inspect.signature` or :func:`inspect.getfullargspec` instead." +"The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" +"`inspect.signature` or :func:`inspect.getfullargspec` instead." msgstr "" -"Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` " -"或 :func:`inspect.getfullargspec`。" +"Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` 或 :" +"func:`inspect.getfullargspec`。" #: ../../whatsnew/3.11.rst:2008 msgid "" -"The :func:`!formatargspec` function, deprecated since Python 3.5; use " -"the :func:`inspect.signature` function or the :class:`inspect.Signature` " -"object directly." +"The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" +"func:`inspect.signature` function or the :class:`inspect.Signature` object " +"directly." msgstr "" -"Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接" -"用 :func:`inspect.signature` 函式或 :class:`inspect.Signature` 物件。" +"Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接用 :func:`inspect." +"signature` 函式或 :class:`inspect.Signature` 物件。" #: ../../whatsnew/3.11.rst:2012 msgid "" -"The undocumented :meth:`!Signature.from_builtin` and :meth:`!" -"Signature.from_function` methods, deprecated since Python 3.5; use " -"the :meth:`Signature.from_callable() ` " -"method instead." +"The undocumented :meth:`!Signature.from_builtin` and :meth:`!Signature." +"from_function` methods, deprecated since Python 3.5; use the :meth:" +"`Signature.from_callable() ` method instead." msgstr "" -"Python 3.5 中停用且沒有被紀錄於文件上的 :meth:`!Signature.from_builtin` " -"和 :meth:`!Signature.from_function` 方法;改" -"用 :meth:`Signature.from_callable() ` 方法。" +"Python 3.5 中停用且沒有被紀錄於文件上的 :meth:`!Signature.from_builtin` 和 :" +"meth:`!Signature.from_function` 方法;改用 :meth:`Signature.from_callable() " +"` 方法。" #: ../../whatsnew/3.11.rst:2017 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" @@ -4045,9 +4012,9 @@ msgstr "(由 Hugo van Kemenade 於 :issue:`45320` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2019 msgid "" -"Removed the :meth:`~object.__class_getitem__` method " -"from :class:`pathlib.PurePath`, because it was not used and added by mistake " -"in previous versions. (Contributed by Nikita Sobolev in :issue:`46483`.)" +"Removed the :meth:`~object.__class_getitem__` method from :class:`pathlib." +"PurePath`, because it was not used and added by mistake in previous " +"versions. (Contributed by Nikita Sobolev in :issue:`46483`.)" msgstr "" "自 :class:`pathlib.PurePath` 中移除 :meth:`~object.__class_getitem__` 方法," "因為它是前一版本中誤加且沒被使用。(由 Nikita Sobolev 於 :issue:`46483` 中所" @@ -4064,8 +4031,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:2028 msgid "" -"Removed the deprecated :meth:`!split` method of :class:`!" -"_tkinter.TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" +"Removed the deprecated :meth:`!split` method of :class:`!_tkinter." +"TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" msgstr "" "移除 :class:`!_tkinter.TkappType` 已被棄用的 :meth:`!split` 方法。(由 " "Erlend E. Aasland 於 :issue:`38371` 貢獻。)" @@ -4098,8 +4065,8 @@ msgid "" "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " "been removed." msgstr "" -"移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應" -"的 :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" +"移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應的 :" +"c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" #: ../../whatsnew/3.11.rst:2045 msgid "" @@ -4131,31 +4098,31 @@ msgstr "C API 的移植被\\ :ref:`獨立列出 `。" #: ../../whatsnew/3.11.rst:2063 msgid "" -":func:`open`, :func:`io.open`, :func:`codecs.open` " -"and :class:`fileinput.FileInput` no longer accept ``'U'`` (\"universal " -"newline\") in the file mode. In Python 3, \"universal newline\" mode is used " -"by default whenever a file is opened in text mode, and the ``'U'`` flag has " -"been deprecated since Python 3.3. The :ref:`newline parameter ` to these functions controls how universal newlines work. " -"(Contributed by Victor Stinner in :issue:`37330`.)" -msgstr "" -":func:`open`、:func:`io.open`、:func:`codecs.open` " -"和 :class:`fileinput.FileInput` 不再接受 ``'U'``\\ (\"universal newline\"," -"通用換行符)文件模式。在 Python 3 中,每當以文本模式 (text mode) 打開檔案時," -"預設情況下會使用「通用換行符」模式,並且自 Python 3.3 以來就不推薦使用 " -"``'U'`` 旗標。這些函式的 :ref:`newline 參數 `\\ 控制" -"了通用換行符的作用方式。(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" +":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." +"FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " +"mode. In Python 3, \"universal newline\" mode is used by default whenever a " +"file is opened in text mode, and the ``'U'`` flag has been deprecated since " +"Python 3.3. The :ref:`newline parameter ` to these " +"functions controls how universal newlines work. (Contributed by Victor " +"Stinner in :issue:`37330`.)" +msgstr "" +":func:`open`、:func:`io.open`、:func:`codecs.open` 和 :class:`fileinput." +"FileInput` 不再接受 ``'U'``\\ (\"universal newline\",通用換行符)文件模式。" +"在 Python 3 中,每當以文本模式 (text mode) 打開檔案時,預設情況下會使用「通用" +"換行符」模式,並且自 Python 3.3 以來就不推薦使用 ``'U'`` 旗標。這些函式的 :" +"ref:`newline 參數 `\\ 控制了通用換行符的作用方式。" +"(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" #: ../../whatsnew/3.11.rst:2072 msgid "" -":class:`ast.AST` node positions are now validated when provided " -"to :func:`compile` and other related functions. If invalid positions are " -"detected, a :exc:`ValueError` will be raised. (Contributed by Pablo Galindo " -"in :gh:`93351`)" +":class:`ast.AST` node positions are now validated when provided to :func:" +"`compile` and other related functions. If invalid positions are detected, a :" +"exc:`ValueError` will be raised. (Contributed by Pablo Galindo in :gh:" +"`93351`)" msgstr "" ":class:`ast.AST` 節點位置現在會在提供給 :func:`compile` 和其他相關函式時被驗" -"證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo " -"在 :gh:`93351` 中貢獻)" +"證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo 在 :" +"gh:`93351` 中貢獻)" #: ../../whatsnew/3.11.rst:2076 msgid "" @@ -4163,23 +4130,21 @@ msgid "" "executors to :meth:`asyncio.loop.set_default_executor` following a " "deprecation in Python 3.8. (Contributed by Illia Volochii in :issue:`43234`.)" msgstr "" -"在 Python 3.8 中棄用後,禁止將" -"非 :class:`concurrent.futures.ThreadPoolExecutor` 執行器傳遞" -"給 :meth:`asyncio.loop.set_default_executor`。(由 Illia Volochii " -"在 :issue:`43234` 中貢獻。)" +"在 Python 3.8 中棄用後,禁止將非 :class:`concurrent.futures." +"ThreadPoolExecutor` 執行器傳遞給 :meth:`asyncio.loop.set_default_executor`。" +"(由 Illia Volochii 在 :issue:`43234` 中貢獻。)" #: ../../whatsnew/3.11.rst:2081 msgid "" -":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` " -"and :class:`calendar.LocaleHTMLCalendar` classes now " -"use :func:`locale.getlocale`, instead of " -"using :func:`locale.getdefaultlocale`, if no locale is specified. " +":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" +"`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " +"instead of using :func:`locale.getdefaultlocale`, if no locale is specified. " "(Contributed by Victor Stinner in :issue:`46659`.)" msgstr "" -":mod:`calendar`::class:`calendar.LocaleTextCalendar` " -"和 :class:`calendar.LocaleHTMLCalendar` 類別如果沒有指定語言環境,現在會使" -"用 :func:`locale.getlocale` 而非 :func:`locale.getdefaultlocale`。(由 " -"Victor Stinner 在 :issue:`46659` 中貢獻。)" +":mod:`calendar`::class:`calendar.LocaleTextCalendar` 和 :class:`calendar." +"LocaleHTMLCalendar` 類別如果沒有指定語言環境,現在會使用 :func:`locale." +"getlocale` 而非 :func:`locale.getdefaultlocale`。(由 Victor Stinner 在 :" +"issue:`46659` 中貢獻。)" #: ../../whatsnew/3.11.rst:2087 msgid "" @@ -4194,20 +4159,19 @@ msgstr "" msgid "" "The *population* parameter of :func:`random.sample` must be a sequence, and " "automatic conversion of :class:`set`\\s to :class:`list`\\s is no longer " -"supported. Also, if the sample size is larger than the population size, " -"a :exc:`ValueError` is raised. (Contributed by Raymond Hettinger " -"in :issue:`40465`.)" +"supported. Also, if the sample size is larger than the population size, a :" +"exc:`ValueError` is raised. (Contributed by Raymond Hettinger in :issue:" +"`40465`.)" msgstr "" -":func:`random.sample` 的 *population* 參數必須是一個序列,不再支" -"援 :class:`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小," -"則會引發 :exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢" -"獻。)" +":func:`random.sample` 的 *population* 參數必須是一個序列,不再支援 :class:" +"`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小,則會引發 :" +"exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢獻。)" #: ../../whatsnew/3.11.rst:2097 msgid "" "The *random* optional parameter of :func:`random.shuffle` was removed. It " -"was previously an arbitrary random function to use for the shuffle; " -"now, :func:`random.random` (its previous default) will always be used." +"was previously an arbitrary random function to use for the shuffle; now, :" +"func:`random.random` (its previous default) will always be used." msgstr "" "刪除了 :func:`random.shuffle` 的 *random* 可選參數。它以前是用於隨機排列 " "(shuffle) 的任意隨機函式;現在都會使用 :func:`random.random`\\ (這是它以前的" @@ -4217,8 +4181,8 @@ msgstr "" msgid "" "In :mod:`re` :ref:`re-syntax`, global inline flags (e.g. ``(?i)``) can now " "only be used at the start of regular expressions. Using them elsewhere has " -"been deprecated since Python 3.6. (Contributed by Serhiy Storchaka " -"in :issue:`47066`.)" +"been deprecated since Python 3.6. (Contributed by Serhiy Storchaka in :issue:" +"`47066`.)" msgstr "" "在 :mod:`re` :ref:`re-syntax` 中,全域行內旗標(例如 ``(?i)``)現在只能在正規" "表示式的開頭使用。自 Python 3.6 以來,在其他地方使用它們已被棄用。(由 " @@ -4250,8 +4214,8 @@ msgid "" "limited subset of POSIX APIs; Python standard libraries features and modules " "related to networking, processes, threading, signals, mmap, and users/groups " "are not available or don't work. (Emscripten contributed by Christian Heimes " -"and Ethan Smith in :gh:`84461` and WASI contributed by Christian Heimes " -"in :gh:`90473`; platforms promoted in :gh:`95085`)" +"and Ethan Smith in :gh:`84461` and WASI contributed by Christian Heimes in :" +"gh:`90473`; platforms promoted in :gh:`95085`)" msgstr "" "CPython 現在有 :pep:`11` :pep:`Tier 3 支援 <11#tier-3>` 以用於交叉編譯至 " "`WebAssembly `_ 平台 `Emscripten `_ compiler and standard library. " "`Optional C11 features `_ are not required. " -"(Contributed by Victor Stinner in :issue:`46656`, :issue:`45440` " -"and :issue:`46640`.)" +"(Contributed by Victor Stinner in :issue:`46656`, :issue:`45440` and :issue:" +"`46640`.)" msgstr "" "`C11 `_ 編譯器與標準函式庫。`可選的 C11 " "特性 `_ (when available). :mod:`tkinter` now requires a pkg-config " "command to detect development settings for `Tcl/Tk`_ headers and libraries. " -"(Contributed by Christian Heimes and Erlend Egeberg Aasland " -"in :issue:`45847`, :issue:`45747`, and :issue:`45763`.)" +"(Contributed by Christian Heimes and Erlend Egeberg Aasland in :issue:" +"`45847`, :issue:`45747`, and :issue:`45763`.)" msgstr "" "大多數 stdlib 擴充模組的依賴套件、編譯器旗標 (compiler flag) 和鏈接器旗標 " "(linker flags) 現在可以透過 :program:`configure` 檢測出來。(當可用時)\\ " "`pkg-config `_ 會檢測" "出 libffi、libnsl、libsqlite3、zlib、bzip2、liblzma、libcrypt、Tcl/Tk 和 " "uuid 旗標。:mod:`tkinter` 現在需要一個 pkg-config 命令來檢測 `Tcl/Tk`_ 標頭檔" -"和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland " -"在 :issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" +"和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland 在 :" +"issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" #: ../../whatsnew/3.11.rst:2162 msgid "" @@ -4335,13 +4299,13 @@ msgstr "" msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " -"``--with-lto=thin``. (Contributed by Donghee Na and Brett Holman " -"in :issue:`44340`.)" +"``--with-lto=thin``. (Contributed by Donghee Na and Brett Holman in :issue:" +"`44340`.)" msgstr "" "CPython 現在可以透過將 ``thin`` 傳遞給 :option:`--with-lto`\\ (也就是 ``--" -"with-lto=thin``\\ )來以 `ThinLTO `_ 選項建置。(由 Donghee Na 與 Brett Holman 於 :issue:`44340` " -"中所貢獻。)" +"with-lto=thin``\\ )來以 `ThinLTO `_ 選項建置。(由 Donghee Na 與 Brett Holman 於 :issue:`44340` 中所貢" +"獻。)" #: ../../whatsnew/3.11.rst:2170 msgid "" @@ -4355,14 +4319,13 @@ msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " "test modules can be linked statically into a main binary or library. " -"(Contributed by Brett Cannon and Christian Heimes " -"in :issue:`45548`, :issue:`45570`, :issue:`45571`, and :issue:`43974`.)" +"(Contributed by Brett Cannon and Christian Heimes in :issue:`45548`, :issue:" +"`45570`, :issue:`45571`, and :issue:`43974`.)" msgstr "" "``Modules/Setup`` 和 ``Modules/makesetup`` 已得到改進和綁定。現在可以通過 " "``makesetup`` 建置擴充模組。除了一些測試模組外,所有模組都可以靜態鏈接到主要" -"的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes " -"在 :issue:`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢" -"獻。)" +"的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes 在 :issue:" +"`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢獻。)" #: ../../whatsnew/3.11.rst:2182 msgid "" @@ -4383,20 +4346,20 @@ msgid "" "build Python with RHEL 7's and CentOS 7's Tcl/Tk and OpenSSL." msgstr "" "RHEL 7 和 CentOS 7 上的開發套件並無提供 ``tcl.pc`` 和 ``tk.pc``;要使用 " -"``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``。目錄 ``Misc/rhel7`` 包含 " -"``.pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的" -"指示。" +"``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``。目錄 ``Misc/rhel7`` 包含 ``." +"pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的指" +"示。" #: ../../whatsnew/3.11.rst:2193 msgid "" "CPython will now use 30-bit digits by default for the Python :class:`int` " "implementation. Previously, the default was to use 30-bit digits on " "platforms with ``SIZEOF_VOID_P >= 8``, and 15-bit digits otherwise. It's " -"still possible to explicitly request use of 15-bit digits via either " -"the :option:`--enable-big-digits` option to the configure script or (for " -"Windows) the ``PYLONG_BITS_IN_DIGIT`` variable in ``PC/pyconfig.h``, but " -"this option may be removed at some point in the future. (Contributed by Mark " -"Dickinson in :issue:`45569`.)" +"still possible to explicitly request use of 15-bit digits via either the :" +"option:`--enable-big-digits` option to the configure script or (for Windows) " +"the ``PYLONG_BITS_IN_DIGIT`` variable in ``PC/pyconfig.h``, but this option " +"may be removed at some point in the future. (Contributed by Mark Dickinson " +"in :issue:`45569`.)" msgstr "" "CPython 現在預設使用 30-bit 數字來實作 Python :class:`int`。以前,在 " "``SIZEOF_VOID_P >= 8`` 的平台上預設使用 30-bit 數字,否則使用 15-bit 數字,但" @@ -4414,8 +4377,8 @@ msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -"新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi " -"於 :issue:`42035` 中所貢獻。)" +"新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi 於 :issue:" +"`42035` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2216 msgid "" @@ -4427,20 +4390,20 @@ msgstr "" #: ../../whatsnew/3.11.rst:2219 msgid "" -"Add new :c:func:`PyThreadState_EnterTracing` " -"and :c:func:`PyThreadState_LeaveTracing` functions to the limited C API to " -"suspend and resume tracing and profiling. (Contributed by Victor Stinner " -"in :issue:`43760`.)" +"Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" +"`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " +"resume tracing and profiling. (Contributed by Victor Stinner in :issue:" +"`43760`.)" msgstr "" -"在受限 C API (limited C API) 中新增 :c:func:`PyThreadState_EnterTracing` " -"和 :c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能" -"分析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" +"在受限 C API (limited C API) 中新增 :c:func:`PyThreadState_EnterTracing` 和 :" +"c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能分" +"析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" #: ../../whatsnew/3.11.rst:2224 msgid "" -"Added the :c:data:`Py_Version` constant which bears the same value " -"as :c:macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta " -"in :issue:`43931`.)" +"Added the :c:data:`Py_Version` constant which bears the same value as :c:" +"macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta in :issue:" +"`43931`.)" msgstr "" "添加了 :c:data:`Py_Version` 常數,其值與 :c:macro:`PY_VERSION_HEX` 相同。" "(由 Gabriele N. Tornetta 在 :issue:`43931` 中貢獻。)" @@ -4501,11 +4464,11 @@ msgstr ":c:func:`PyMemoryView_FromBuffer`" #: ../../whatsnew/3.11.rst:2243 msgid "" -":c:member:`~PyBufferProcs.bf_getbuffer` " -"and :c:member:`~PyBufferProcs.bf_releasebuffer` type slots" +":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." +"bf_releasebuffer` type slots" msgstr "" -":c:member:`~PyBufferProcs.bf_getbuffer` " -"與 :c:member:`~PyBufferProcs.bf_releasebuffer` 型別插槽 (type slot)" +":c:member:`~PyBufferProcs.bf_getbuffer` 與 :c:member:`~PyBufferProcs." +"bf_releasebuffer` 型別插槽 (type slot)" #: ../../whatsnew/3.11.rst:2246 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" @@ -4524,38 +4487,39 @@ msgstr "" #: ../../whatsnew/3.11.rst:2253 msgid "" -"Add new functions to pack and unpack C double (serialize and " -"deserialize): :c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`, :c:func:`PyFloat_Unpack2`, :c:func:`PyFloat_Unpack4` " -"and :c:func:`PyFloat_Unpack8`. (Contributed by Victor Stinner " -"in :issue:`46906`.)" +"Add new functions to pack and unpack C double (serialize and deserialize): :" +"c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`, :c:" +"func:`PyFloat_Unpack2`, :c:func:`PyFloat_Unpack4` and :c:func:" +"`PyFloat_Unpack8`. (Contributed by Victor Stinner in :issue:`46906`.)" msgstr "" -"新增函式以打包 (pack) 和取出 (unpack) C double(序列化和反序列" -"化)::c:func:`PyFloat_Pack2`、:c:func:`PyFloat_Pack4`、:c:func:`PyFloat_Pack8`、:c:func:`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` " -"和 :c:func:`PyFloat_Unpack8`。(由 Victor Stinner 在 :issue:`46906` 中貢" -"獻。)" +"新增函式以打包 (pack) 和取出 (unpack) C double(序列化和反序列化)::c:func:" +"`PyFloat_Pack2`、:c:func:`PyFloat_Pack4`、:c:func:`PyFloat_Pack8`、:c:func:" +"`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` 和 :c:func:`PyFloat_Unpack8`。" +"(由 Victor Stinner 在 :issue:`46906` 中貢獻。)" #: ../../whatsnew/3.11.rst:2259 msgid "" -"Add new functions to get frame object " -"attributes: :c:func:`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:`PyFrame_GetGlobals`, :c:func:`PyFrame_GetLasti`." +"Add new functions to get frame object attributes: :c:func:" +"`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:" +"`PyFrame_GetGlobals`, :c:func:`PyFrame_GetLasti`." msgstr "" -"新增取得幀物件屬性的函" -"式::c:func:`PyFrame_GetBuiltins`、:c:func:`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:`PyFrame_GetLasti`。" +"新增取得幀物件屬性的函式::c:func:`PyFrame_GetBuiltins`、:c:func:" +"`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:" +"`PyFrame_GetLasti`。" #: ../../whatsnew/3.11.rst:2263 msgid "" -"Added two new functions to get and set the active exception " -"instance: :c:func:`PyErr_GetHandledException` " -"and :c:func:`PyErr_SetHandledException`. These are alternatives " -"to :c:func:`PyErr_SetExcInfo()` and :c:func:`PyErr_GetExcInfo()` which work " -"with the legacy 3-tuple representation of exceptions. (Contributed by Irit " -"Katriel in :issue:`46343`.)" +"Added two new functions to get and set the active exception instance: :c:" +"func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " +"These are alternatives to :c:func:`PyErr_SetExcInfo()` and :c:func:" +"`PyErr_GetExcInfo()` which work with the legacy 3-tuple representation of " +"exceptions. (Contributed by Irit Katriel in :issue:`46343`.)" msgstr "" -"添加了兩個新函式來獲得和設置仍在作用的例外實" -"例::c:func:`PyErr_GetHandledException` " -"和 :c:func:`PyErr_SetHandledException`。這些是 :c:func:`PyErr_SetExcInfo()` " -"和 :c:func:`PyErr_GetExcInfo()` 的替代品,它們與例外的遺留三元組表示法一起作" -"用。(由 Irit Katriel 在 :issue:`46343` 中貢獻。)" +"添加了兩個新函式來獲得和設置仍在作用的例外實例::c:func:" +"`PyErr_GetHandledException` 和 :c:func:`PyErr_SetHandledException`。這些是 :" +"c:func:`PyErr_SetExcInfo()` 和 :c:func:`PyErr_GetExcInfo()` 的替代品,它們與" +"例外的遺留三元組表示法一起作用。(由 Irit Katriel 在 :issue:`46343` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:2270 msgid "" @@ -4576,11 +4540,11 @@ msgid "" "expected types. See :pep:`670` for more details. (Contributed by Victor " "Stinner and Erlend E. Aasland in :gh:`89653`.)" msgstr "" -"一些巨集已轉換為行內靜態函式以避免\\ `巨集陷阱 (macro pitfalls) `_。這種變化對用戶來說應該是透" -"明的,因為替換函式會將它們的引數轉換為預期的型別,以避免由於靜態型別檢查而產" -"生的編譯器警告。但是,當受限 C API 設置為 >=3.11 時,這些轉換不會完成,使用者" -"需要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。(由 " +"一些巨集已轉換為行內靜態函式以避免\\ `巨集陷阱 (macro pitfalls) `_。這種變化對用戶來說應該是透明" +"的,因為替換函式會將它們的引數轉換為預期的型別,以避免由於靜態型別檢查而產生" +"的編譯器警告。但是,當受限 C API 設置為 >=3.11 時,這些轉換不會完成,使用者需" +"要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。(由 " "Victor Stinner 和 Erlend E. Aasland 在 :gh:`89653` 中貢獻。)" #: ../../whatsnew/3.11.rst:2292 @@ -4641,17 +4605,17 @@ msgstr "" #: ../../whatsnew/3.11.rst:2318 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " -"``co_cellvars`` and ``co_freevars`` fields. Instead, " -"use :c:func:`PyCode_GetCode`, :c:func:`PyCode_GetVarnames`, :c:func:`PyCode_GetCellvars` " +"``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" +"`PyCode_GetCode`, :c:func:`PyCode_GetVarnames`, :c:func:`PyCode_GetCellvars` " "and :c:func:`PyCode_GetFreevars` respectively to access them via the C API. " "(Contributed by Brandt Bucher in :issue:`46841` and Ken Jin in :gh:`92154` " "and :gh:`94936`.)" msgstr "" ":c:type:`PyCodeObject` 不再會有 ``co_code``、``co_varnames``、" -"``co_cellvars`` 和 ``co_freevars`` 欄位。分別被改為透過 C API " -"的 :c:func:`PyCode_GetCode`、:c:func:`PyCode_GetVarnames`、:c:func:`PyCode_GetCellvars` " -"和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher " -"在 :issue:`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" +"``co_cellvars`` 和 ``co_freevars`` 欄位。分別被改為透過 C API 的 :c:func:" +"`PyCode_GetCode`、:c:func:`PyCode_GetVarnames`、:c:func:`PyCode_GetCellvars` " +"和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher 在 :issue:" +"`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" #: ../../whatsnew/3.11.rst:2326 msgid "" @@ -4750,25 +4714,24 @@ msgstr "" msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :c:macro:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function " -"(:c:member:`PyTypeObject.tp_traverse`). (Contributed by Victor Stinner " -"in :issue:`44263`.)" +"(:c:member:`PyTypeObject.tp_traverse`). (Contributed by Victor Stinner in :" +"issue:`44263`.)" msgstr "" "如果一個型別是以 :c:macro:`Py_TPFLAGS_HAVE_GC` 旗標來定義,但卻沒有遍歷函式 " -"(traverse function) (:c:member:`PyTypeObject.tp_traverse`)," -"那 :c:func:`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner " -"於 :issue:`44263` 中貢獻。)" +"(traverse function) (:c:member:`PyTypeObject.tp_traverse`),那 :c:func:" +"`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner 於 :issue:`44263` " +"中貢獻。)" #: ../../whatsnew/3.11.rst:2372 msgid "" "Heap types with the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " -"the :pep:`590` vectorcall protocol. Previously, this was only possible " -"for :ref:`static types `. (Contributed by Erlend E. Aasland " -"in :issue:`43908`)" +"the :pep:`590` vectorcall protocol. Previously, this was only possible for :" +"ref:`static types `. (Contributed by Erlend E. Aasland in :" +"issue:`43908`)" msgstr "" -"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼" -"承 :pep:`590` 向量呼叫協定 (vectorcall protocol)。以前這僅適用" -"於 :ref:`static types `。(由 Erlend E. Aasland " -"在 :issue:`43908` 中貢獻)。" +"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼承 :pep:" +"`590` 向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " +"`。(由 Erlend E. Aasland 在 :issue:`43908` 中貢獻)。" #: ../../whatsnew/3.11.rst:2377 msgid "" @@ -4778,9 +4741,9 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" "由於 :c:func:`Py_TYPE()` 更改為行內靜態函式 (inline static function),因此 " -"``Py_TYPE(obj) = new_type`` 必須替換為 ``Py_SET_TYPE(obj, new_type)``:參" -"見 :c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使" -"用這個巨集:" +"``Py_TYPE(obj) = new_type`` 必須替換為 ``Py_SET_TYPE(obj, new_type)``:參見 :" +"c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這" +"個巨集:" #: ../../whatsnew/3.11.rst:2383 msgid "" @@ -4808,9 +4771,9 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" "由於 :c:func:`Py_SIZE()` 更改為行內靜態函式,因此 ``Py_SIZE(obj) = " -"new_size`` 必須替換為 ``Py_SET_SIZE(obj, new_size)``:參" -"見 :c:func:`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使" -"用這個巨集:" +"new_size`` 必須替換為 ``Py_SET_SIZE(obj, new_size)``:參見 :c:func:" +"`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這個巨" +"集:" #: ../../whatsnew/3.11.rst:2397 msgid "" @@ -4828,9 +4791,9 @@ msgstr "" #: ../../whatsnew/3.11.rst:2405 msgid "" -"```` no longer includes the header files ````, " -"````, ```` and ```` when the ``Py_LIMITED_API`` " -"macro is set to ``0x030b0000`` (Python 3.11) or higher. C extensions should " +"```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " +"set to ``0x030b0000`` (Python 3.11) or higher. C extensions should " "explicitly include the header files after ``#include ``. " "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" @@ -4864,8 +4827,8 @@ msgid "" "Victor Stinner in :issue:`46007`.)" msgstr "" ":c:func:`!PyUnicode_CHECK_INTERNED` 巨集已從受限 C API 中移出,它從來沒辦法被" -"使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner " -"於 :issue:`46007` 中所貢獻。)" +"使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner 於 :issue:" +"`46007` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2424 msgid "" @@ -4975,8 +4938,8 @@ msgid "" "it may be faster." msgstr "" "``f_lasti``:使用 :c:func:`PyFrame_GetLasti`。程式碼中 ``f_lasti`` 有與 " -"``PyCode_Addr2Line()`` 同時使用的部分應該改" -"用 :c:func:`PyFrame_GetLineNumber`;它可能會更快。" +"``PyCode_Addr2Line()`` 同時使用的部分應該改用 :c:func:" +"`PyFrame_GetLineNumber`;它可能會更快。" #: ../../whatsnew/3.11.rst:2464 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" @@ -5024,25 +4987,25 @@ msgstr "``f_valuestack``:已移除。" #: ../../whatsnew/3.11.rst:2474 msgid "" -"The Python frame object is now created lazily. A side effect is that " -"the :attr:`~frame.f_back` member must not be accessed directly, since its " -"value is now also computed lazily. The :c:func:`PyFrame_GetBack` function " -"must be called instead." +"The Python frame object is now created lazily. A side effect is that the :" +"attr:`~frame.f_back` member must not be accessed directly, since its value " +"is now also computed lazily. The :c:func:`PyFrame_GetBack` function must be " +"called instead." msgstr "" "Python 幀物件的建立現為惰性的 (lazily),一個副作用是 :attr:`~frame.f_back` 成" -"員不能被直接存取,因為其職的計算也是惰性的,要改呼" -"叫 :c:func:`PyFrame_GetBack`。" +"員不能被直接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:" +"`PyFrame_GetBack`。" #: ../../whatsnew/3.11.rst:2480 msgid "" -"Debuggers that accessed the :attr:`~frame.f_locals` directly *must* " -"call :c:func:`PyFrame_GetLocals` instead. They no longer need to " -"call :c:func:`!PyFrame_FastToLocalsWithError` or :c:func:`!" -"PyFrame_LocalsToFast`, in fact they should not call those functions. The " -"necessary updating of the frame is now managed by the virtual machine." +"Debuggers that accessed the :attr:`~frame.f_locals` directly *must* call :c:" +"func:`PyFrame_GetLocals` instead. They no longer need to call :c:func:`!" +"PyFrame_FastToLocalsWithError` or :c:func:`!PyFrame_LocalsToFast`, in fact " +"they should not call those functions. The necessary updating of the frame is " +"now managed by the virtual machine." msgstr "" -"直接存取 :attr:`~frame.f_locals` 的除錯器\\ *必須*\\ 改為呼" -"叫 :c:func:`PyFrame_GetLocals`。他們不再需要呼叫 :c:func:`!" +"直接存取 :attr:`~frame.f_locals` 的除錯器\\ *必須*\\ 改為呼叫 :c:func:" +"`PyFrame_GetLocals`。他們不再需要呼叫 :c:func:`!" "PyFrame_FastToLocalsWithError` 或 :c:func:`!PyFrame_LocalsToFast`,事實上他們" "不應該呼叫這些函式。框架的必要更新現在由虛擬機管理。" @@ -5114,13 +5077,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:2516 msgid "" -"``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` " -"and :c:func:`PyThreadState_LeaveTracing` (functions added to Python 3.11 " -"by :issue:`43760`)." +"``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" +"`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" +"`43760`)." msgstr "" -"``tracing``:已變更,改用 :c:func:`PyThreadState_EnterTracing` " -"和 :c:func:`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中" -"新增的函式)。" +"``tracing``:已變更,改用 :c:func:`PyThreadState_EnterTracing` 和 :c:func:" +"`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中新增的函" +"式)。" #: ../../whatsnew/3.11.rst:2519 msgid "" @@ -5235,23 +5198,22 @@ msgid "" "initialize :data:`sys.path`. Otherwise, initialization will recalculate the " "path and replace any values added to ``module_search_paths``." msgstr "" -"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始" -"化 :data:`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須" -"被設為 1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` " -"的值。" +"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始化 :data:" +"`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " +"1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" #: ../../whatsnew/3.11.rst:2571 msgid "" ":c:func:`PyConfig_Read` no longer calculates the initial search path, and " "will not fill any values into :c:member:`PyConfig.module_search_paths`. To " -"calculate default paths and then modify them, finish initialization and " -"use :c:func:`PySys_GetObject` to retrieve :data:`sys.path` as a Python list " +"calculate default paths and then modify them, finish initialization and use :" +"c:func:`PySys_GetObject` to retrieve :data:`sys.path` as a Python list " "object and modify it directly." msgstr "" -":c:func:`PyConfig_Read` 不再計算初始搜尋路徑,並且不會將任何值填充" -"到 :c:member:`PyConfig.module_search_paths` 中。若要計算預設路徑然後修改它" -"們,完成初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 " -"Python 列表物件並直接修改它。" +":c:func:`PyConfig_Read` 不再計算初始搜尋路徑,並且不會將任何值填充到 :c:" +"member:`PyConfig.module_search_paths` 中。若要計算預設路徑然後修改它們,完成" +"初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 Python 列" +"表物件並直接修改它。" #: ../../whatsnew/3.11.rst:2582 msgid "" @@ -5317,12 +5279,11 @@ msgstr "" #: ../../whatsnew/3.11.rst:2601 msgid "" -"Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. " -"Use :c:func:`PyObject_Hash` instead. (Contributed by Inada Naoki " -"in :issue:`46864`.)" +"Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" +"func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" msgstr "" -"棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改" -"用 :c:func:`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" +"棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改用 :c:func:" +"`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2610 msgid "" @@ -5452,8 +5413,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:2659 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " -"``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner " -"in :issue:`45440`.)" +"``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" +"`45440`.)" msgstr "" "移除 ``Py_FORCE_DOUBLE()`` 巨集。它先前被用於 ``Py_IS_INFINITY()`` 巨集。" "(由 Victor Stinner 於 :issue:`45440` 中所貢獻。)" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 4bd6857d4a..54c4904499 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-30 00:13+0000\n" +"POT-Creation-Date: 2025-12-01 00:17+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1048,7 +1048,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:731 msgid "" -"The :meth:`loop.create_datagram_endpoint() \\ ` method gained support for Unix sockets. " "(Contributed by Quentin Dawans in :issue:`31245`.)" msgstr "" From f7dc4da127e3d644414dc9e31e8e91e888745ad7 Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Tue, 2 Dec 2025 05:32:55 +0800 Subject: [PATCH 09/13] fix fuzzy entries and incorrect refs --- c-api/bytes.po | 3 +-- c-api/complex.po | 4 ++-- c-api/datetime.po | 4 ++-- c-api/init.po | 2 +- c-api/veryhigh.po | 4 ++-- extending/extending.po | 3 +-- faq/gui.po | 2 +- howto/functional.po | 3 +-- howto/urllib2.po | 3 +-- library/asyncio-eventloop.po | 15 ++++++++------- library/base64.po | 2 +- library/csv.po | 2 +- library/datetime.po | 2 +- library/enum.po | 4 ++-- library/http.po | 2 +- library/json.po | 2 +- library/logging.config.po | 2 +- library/logging.handlers.po | 2 +- library/logging.po | 2 +- library/os.path.po | 2 +- library/socket.po | 2 +- library/ssl.po | 16 +++++----------- library/statistics.po | 2 +- library/stdtypes.po | 27 +++++++++++---------------- library/unittest.mock.po | 8 ++++---- library/urllib.error.po | 2 +- library/wsgiref.po | 10 +++++----- license.po | 2 +- sphinx.po | 6 ++---- tutorial/introduction.po | 1 - tutorial/stdlib.po | 2 +- using/windows.po | 16 +++++++--------- whatsnew/3.10.po | 2 +- whatsnew/3.11.po | 2 +- whatsnew/3.13.po | 2 +- whatsnew/3.4.po | 3 +-- 36 files changed, 74 insertions(+), 94 deletions(-) diff --git a/c-api/bytes.po b/c-api/bytes.po index 201bf42b04..86da7979be 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -159,9 +159,8 @@ msgid "``%zd``" msgstr "``%zd``" #: ../../c-api/bytes.rst:84 -#, fuzzy msgid ":c:type:` Py_ssize_t`" -msgstr ":c:type:`\\ Py_ssize_t`" +msgstr ":c:type:` Py_ssize_t`" #: ../../c-api/bytes.rst:84 msgid "Equivalent to ``printf(\"%zd\")``. [1]_" diff --git a/c-api/complex.po b/c-api/complex.po index ca8067e5f3..6246d71782 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -194,7 +194,7 @@ msgid "" msgstr "" "如果 *op* 不是 Python 複數物件,但有一個 :meth:`~object.__complex__` 方法,則" "首先會呼叫該方法將 *op* 轉換為 Python 複數物件。如果 :meth:`!__complex__` 並" -"未定義,那麼它會回退到呼叫 :func:`PyFloat_AsDouble` 並回傳其結果。" +"未定義,那麼它會回退到呼叫 :c:func:`PyFloat_AsDouble` 並回傳其結果。" #: ../../c-api/complex.rst:134 ../../c-api/complex.rst:150 msgid "" @@ -222,7 +222,7 @@ msgid "" msgstr "" "如果 *op* 不是 Python 複數物件,但有一個 :meth:`~object.__complex__` 方法,則" "首先會呼叫該方法將 *op* 轉換為 Python 複數物件。如果 :meth:`!__complex__` 並" -"未定義,那麼它會回退到呼叫 :func:`PyFloat_AsDouble` 並於成功時回傳 ``0.0``。" +"未定義,那麼它會回退到呼叫 :c:func:`PyFloat_AsDouble` 並於成功時回傳 ``0.0``。" #: ../../c-api/complex.rst:158 msgid "Return the :c:type:`Py_complex` value of the complex number *op*." diff --git a/c-api/datetime.po b/c-api/datetime.po index 4b4fe76589..9a62a3dbf6 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -129,7 +129,7 @@ msgid "" "is the same object as :class:`datetime.time` in the Python layer." msgstr "" "此 :c:type:`PyTypeObject` 實例代表 Python time 型別,與 Python layer 中的 :" -"class:`datetime.datetime.time` 是同一物件" +"class:`datetime.time` 是同一物件" #: ../../c-api/datetime.rst:80 msgid "" @@ -282,7 +282,7 @@ msgstr "" msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second and microsecond." -msgstr "回傳一個有特定時、分、秒、微秒的物件 :class:`datetime.date`。" +msgstr "回傳一個有特定時、分、秒、微秒的物件 :class:`datetime.time`。" #: ../../c-api/datetime.rst:196 msgid "" diff --git a/c-api/init.po b/c-api/init.po index dd6ad36d34..986d54f8a4 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -389,7 +389,7 @@ msgstr "" #: ../../c-api/init.rst:217 msgid "Set by the :option:`-I` option." -msgstr "由 :option:`-i` 選項設定。" +msgstr "由 :option:`-I` 選項設定。" #: ../../c-api/init.rst:225 msgid "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 870e4814c5..0663dd4fc7 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -444,7 +444,7 @@ msgstr "" #: ../../c-api/veryhigh.rst:405 msgid ":py:func:`dis.stack_effect`" -msgstr "" +msgstr ":py:func:`dis.stack_effect`" #: ../../c-api/veryhigh.rst:410 msgid "Sentinel value representing an invalid stack effect." @@ -452,7 +452,7 @@ msgstr "" #: ../../c-api/veryhigh.rst:412 msgid "This is currently equivalent to ``INT_MAX``." -msgstr "" +msgstr "這目前等同於 ``INT_MAX``。" #: ../../c-api/veryhigh.rst:419 msgid "Compute the stack effect of *opcode* with argument *oparg*." diff --git a/extending/extending.po b/extending/extending.po index b7bfe713bf..f23b5784bf 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -857,14 +857,13 @@ msgid "" msgstr "" #: ../../extending/extending.rst:428 -#, fuzzy msgid "" "When embedding Python, the :c:func:`!PyInit_spam` function is not called " "automatically unless there's an entry in the :c:data:`PyImport_Inittab` " "table. To add the module to the initialization table, use :c:func:" "`PyImport_AppendInittab`, optionally followed by an import of the module::" msgstr "" -"嵌入 Python 時,除非在 :c:data:`!PyImport_Inittab` 表中有相關條目,否則不會自" +"嵌入 Python 時,除非在 :c:data:`PyImport_Inittab` 表中有相關條目,否則不會自" "動呼叫 :c:func:`!PyInit_spam` 函式。要將模組加入初始化表,請使用 :c:func:" "`PyImport_AppendInittab` 並在隨後選擇性地將該模組引入: ::" diff --git a/faq/gui.po b/faq/gui.po index 4d0009f175..3faa585cf1 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -125,7 +125,7 @@ msgid "" "events>` to events with the :meth:`!bind` method don't get handled even when " "the appropriate key is pressed." msgstr "" -"一個經常聽到的抱怨是,儘管事件處理程式 (event handler) 已經\\ :ref:`繫結" +"一個經常聽到的抱怨是,儘管事件處理程式 (event handler) 已經\\ :ref:`繫結 " "`\\ 到帶有 :meth:`!bind` method 的事件,但在按下相應的鍵" "時,該事件也沒有被處理。" diff --git a/howto/functional.po b/howto/functional.po index aca5629ca5..8e186ab544 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -27,9 +27,8 @@ msgid "Author" msgstr "作者" #: ../../howto/functional.rst:7 -#, fuzzy msgid "\\A. M. Kuchling" -msgstr "A. M. Kuchling" +msgstr "\\A. M. Kuchling" #: ../../howto/functional.rst:0 msgid "Release" diff --git a/howto/urllib2.po b/howto/urllib2.po index b1346fa7a7..540848cedb 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -46,13 +46,12 @@ msgid "" msgstr "以下這些與 Python 有關的文章說不定能幫到你::" #: ../../howto/urllib2.rst:18 -#, fuzzy msgid "" "`Basic Authentication `__" msgstr "" "`Basic Authentication `_" +"voidspace.org.uk/python/articles/authentication.shtml>`__" #: ../../howto/urllib2.rst:20 msgid "A tutorial on *Basic Authentication*, with examples in Python." diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 4af79ead25..9bcbd1cff0 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -1064,7 +1064,7 @@ msgid "" msgstr "" "*reuse_port* 告訴核心允許將此端點綁定到與其他現有端點相同的埠,只要它們在建立" "時都設定了此旗標。此選項不受 Windows 和某些 Unix 系統支援。如果未定義 :py:" -"const:`~socket.SO_REUSEPORT` 常數,則不支援此功能。" +"const:`socket.SO_REUSEPORT ` 常數,則不支援此功能。" #: ../../library/asyncio-eventloop.rst:647 msgid "" @@ -1109,7 +1109,7 @@ msgid "" "SO_REUSEADDR ` poses a significant security concern " "for UDP. Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -"不再支援 *reuse_address* 參數,因為使用 :py:const:`~sockets.SO_REUSEADDR` 對" +"不再支援 *reuse_address* 參數,因為使用 :py:const:`~socket.SO_REUSEADDR ` 對" "於 UDP 存有重大的安全疑慮。明確傳遞 ``reuse_address=True`` 將引發例外。" #: ../../library/asyncio-eventloop.rst:677 @@ -1129,7 +1129,8 @@ msgid "" "differing UIDs from assigning sockets to the same socket address." msgstr "" "對於有支援的平台,*reuse_port* 可以用作類似功能的替代方案。使用 " -"*reuse_port*,將改為使用 :py:const:`~sockets.SO_REUSEPORT`,該選項明確禁止具" +"*reuse_port*,將改為使用 :py:const:`~socket.SO_REUSEPORT `,該選項明確禁止具" "有不同 UID 的行程將 socket 分配給相同的 socket 地址。" #: ../../library/asyncio-eventloop.rst:688 @@ -2621,7 +2622,7 @@ msgid "" "The server is closed asynchronously; use the :meth:`wait_closed` coroutine " "to wait until the server is closed (and no more connections are active)." msgstr "" -"伺服器以非同步方式關閉;使用 :meth:`wait_close` 協程等待伺服器關閉(不再有活" +"伺服器以非同步方式關閉;使用 :meth:`wait_closed` 協程等待伺服器關閉(不再有活" "躍連線)。" #: ../../library/asyncio-eventloop.rst:1759 @@ -2648,7 +2649,7 @@ msgstr "立即關閉所有現有的傳入用戶端連線,而不等待待定操 #: ../../library/asyncio-eventloop.rst:1774 msgid "" "Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." -msgstr "在所有關聯的傳輸上呼叫 :meth:`~asyncio.BaseTransport.close`。" +msgstr "在所有關聯的傳輸上呼叫 :meth:`~asyncio.WriteTransport.abort`。" #: ../../library/asyncio-eventloop.rst:1777 msgid "" @@ -3083,8 +3084,8 @@ msgid "" "Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." "SIGTERM` using the :meth:`loop.add_signal_handler` method::" msgstr "" -"使用 :meth:`loop.add_signal_handler` 方法註冊訊號 :py:data:`SIGINT` 和 :py:" -"data:`SIGTERM` 的處理程式: ::" +"使用 :meth:`loop.add_signal_handler` 方法註冊訊號 :const:`~signal.SIGINT` 和 :const:`~signal." +"SIGTERM` 的處理程式: ::" #: ../../library/asyncio-eventloop.rst:2060 msgid "" diff --git a/library/base64.po b/library/base64.po index 5607863d9b..9af6ca2344 100644 --- a/library/base64.po +++ b/library/base64.po @@ -266,7 +266,7 @@ msgid "" "Similar to :func:`b32decode` but uses the Extended Hex Alphabet, as defined " "in :rfc:`4648`." msgstr "" -"類似於 :func:`b32encode`,但使用在 :rfc:`4648` 中定義的擴展十六進位字母表。" +"類似於 :func:`b32decode`,但使用在 :rfc:`4648` 中定義的擴展十六進位字母表。" #: ../../library/base64.rst:160 msgid "" diff --git a/library/csv.po b/library/csv.po index 06484592c0..a88e275851 100644 --- a/library/csv.po +++ b/library/csv.po @@ -603,7 +603,7 @@ msgid "" "``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." msgstr "" "引導 :class:`reader` 物件將空(沒有引號)字串直譯為 ``None``,否則會和 :data:" -"`QUOTE_ALL` 有相同的表現方式。" +"`QUOTE_NONNUMERIC` 有相同的表現方式。" #: ../../library/csv.rst:378 msgid "The :mod:`csv` module defines the following exception:" diff --git a/library/datetime.po b/library/datetime.po index 4a699151dc..0feee5c371 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -68,7 +68,7 @@ msgstr "" #: ../../library/datetime.rst:37 msgid "Package `dateutil `_" -msgstr "" +msgstr "`dateutil `_ 套件" #: ../../library/datetime.rst:38 msgid "Third-party library with expanded time zone and parsing support." diff --git a/library/enum.po b/library/enum.po index 8b6600432b..5b173aab1c 100644 --- a/library/enum.po +++ b/library/enum.po @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/enum.py`" #: ../../library/enum.rst:16 msgid "Important" -msgstr "" +msgstr "重點資訊" #: ../../library/enum.rst:18 msgid "" @@ -1671,7 +1671,7 @@ msgid "" "``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_" msgstr "" "``_repr_*``\\ (例如 ``_repr_html_``),例如用於 `IPython 的豐富顯示 " -"`_" +"`_" #: ../../library/enum.rst:930 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" diff --git a/library/http.po b/library/http.po index 644e1e5a66..d6cdf9f99d 100644 --- a/library/http.po +++ b/library/http.po @@ -1045,7 +1045,7 @@ msgid "" "Supported, `IANA-registered methods `_ available in :class:`http.HTTPMethod` are:" msgstr "" -":class:`http.HTTPStatus` 當中,已支援並且有於 `IANA 註冊的狀態碼 `_\\ 有:" #: ../../library/http.rst:209 diff --git a/library/json.po b/library/json.po index 06f8e7d101..f7f634a860 100644 --- a/library/json.po +++ b/library/json.po @@ -430,7 +430,7 @@ msgid "" "table `. The arguments have the same meaning as in :func:" "`dump`." msgstr "" -"使用此\\ :ref:`轉換表 `\\ 來將 *obj* 序列化為 JSON 格式 :" +"使用此\\ :ref:`轉換表 `\\ 來將 *obj* 序列化為 JSON 格式 :" "class:`str`。這個引數的作用與 :func:`dump` 中的同名引數意義相同。" #: ../../library/json.rst:261 diff --git a/library/logging.config.po b/library/logging.config.po index 96fd07f7bf..0db545cbb3 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/logging/config.py`" #: ../../library/logging.config.rst:12 msgid "Important" -msgstr "" +msgstr "重點資訊" #: ../../library/logging.config.rst:14 msgid "" diff --git a/library/logging.handlers.po b/library/logging.handlers.po index fcc2e9bb1b..931313609d 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -27,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/logging/handlers.py`" #: ../../library/logging.handlers.rst:12 msgid "Important" -msgstr "" +msgstr "重點資訊" #: ../../library/logging.handlers.rst:14 msgid "" diff --git a/library/logging.po b/library/logging.po index c27e99e0ff..1f9b094f1a 100644 --- a/library/logging.po +++ b/library/logging.po @@ -29,7 +29,7 @@ msgstr "**原始碼:**\\ :source:`Lib/logging/__init__.py`" #: ../../library/logging.rst:14 msgid "Important" -msgstr "" +msgstr "重點資訊" #: ../../library/logging.rst:16 msgid "" diff --git a/library/os.path.po b/library/os.path.po index 962c3482de..c99e3cffef 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -359,7 +359,7 @@ msgid "" "for the same path." msgstr "" "如果 *path* 是一個\\ :func:`已存在的 `\\ 目錄,則回傳 ``True``。這將" -"跟隨符號連結,因此同一個路徑可以同時回傳 :func:`islink` 和 :func:`isfile` 的" +"跟隨符號連結,因此同一個路徑可以同時回傳 :func:`islink` 和 :func:`isdir` 的" "結果為真。" #: ../../library/os.path.rst:276 diff --git a/library/socket.po b/library/socket.po index b3f1bc74b0..c7c44fa904 100644 --- a/library/socket.po +++ b/library/socket.po @@ -95,7 +95,7 @@ msgid "" "operations is automatic, and buffer length is implicit on send operations." msgstr "" "Python 的介面是將 Unix 的系統呼叫和 socket 函式庫介面直接轉換成 Python 的物件" -"導向風格::func:`.socket` 函式會回傳一個 :dfn:`socket 物件`,這個物件的方法實" +"導向風格::func:`~socket.socket` 函式會回傳一個 :dfn:`socket 物件`,這個物件的方法實" "作了各種 socket 系統呼叫。與 C 語言介面相比,參數型別較為高階:就像 Python 文" "件操作中的 :meth:`read` 和 :meth:`write` 一樣,接收操作時會自動分配緩衝區,而" "發送操作時的緩衝區長度則是隱含的。" diff --git a/library/ssl.po b/library/ssl.po index 16eea3e0f1..120f87a1a4 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -762,7 +762,7 @@ msgid "" "just about any cert is accepted. Validation errors, such as untrusted or " "expired cert, are ignored and do not abort the TLS/SSL handshake." msgstr "" -":attr:`SSLContext.verify_mode` 可能的值。除了 :attr:`SSLContext.verify_mode` " +":attr:`SSLContext.verify_mode` 可能的值。除了 :const:`PROTOCOL_TLS_CLIENT` " "外,這是預設的模式。對於用戶端的 sockets,幾乎任何憑證都能被允許。驗證錯誤," "像是不被信任或是過期的憑證,會被忽略並不會中止 TLS/SSL 握手。" @@ -4056,9 +4056,8 @@ msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" msgstr ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" #: ../../library/ssl.rst:2828 -#, fuzzy msgid "Donald E. Eastlake, Jeffrey I. Schiller, Steve Crocker" -msgstr "Donald E., Jeffrey I. Schiller" +msgstr "Donald E. Eastlake, Jeffrey I. Schiller, Steve Crocker" #: ../../library/ssl.rst:2830 msgid "" @@ -4069,9 +4068,8 @@ msgstr "" "Certificate Revocation List (CRL) Profile <5280>`" #: ../../library/ssl.rst:2831 -#, fuzzy msgid "David Cooper et al." -msgstr "T. Dierks et. al." +msgstr "David Cooper et al." #: ../../library/ssl.rst:2833 msgid "" @@ -4083,16 +4081,15 @@ msgstr "" #: ../../library/ssl.rst:2834 msgid "Tim Dierks and Eric Rescorla." -msgstr "" +msgstr "Tim Dierks 與 Eric Rescorla." #: ../../library/ssl.rst:2836 msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgstr ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" #: ../../library/ssl.rst:2837 -#, fuzzy msgid "Donald E. Eastlake" -msgstr "D. Eastlake" +msgstr "Donald E. Eastlake" #: ../../library/ssl.rst:2839 msgid "" @@ -4161,6 +4158,3 @@ msgstr "certificates(憑證)" #: ../../library/ssl.rst:2159 msgid "X509 certificate" msgstr "X509 certificate(X509 憑證)" - -#~ msgid "D. Cooper" -#~ msgstr "D. Cooper" diff --git a/library/statistics.po b/library/statistics.po index 73131e7afd..c9a21a156b 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -31,7 +31,7 @@ msgstr "**原始碼:**\\ :source:`Lib/statistics.py`" msgid "" "This module provides functions for calculating mathematical statistics of " "numeric (:class:`~numbers.Real`-valued) data." -msgstr "這個模組提供計算數值 (:class:`Real`-valued) 資料的數學統計函式。" +msgstr "這個模組提供計算數值 (:class:`~numbers.Real`-valued) 資料的數學統計函式。" #: ../../library/statistics.rst:25 msgid "" diff --git a/library/stdtypes.po b/library/stdtypes.po index 8a3e100bc8..65d42784ff 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -693,9 +693,8 @@ msgstr "" "算:" #: ../../library/stdtypes.rst:374 -#, fuzzy msgid ":func:`math.trunc( x) `" -msgstr ":func:`math.trunc(\\ x) `" +msgstr ":func:`math.trunc( x) `" #: ../../library/stdtypes.rst:374 msgid "*x* truncated to :class:`~numbers.Integral`" @@ -712,9 +711,8 @@ msgid "" msgstr "*x* 進位至小數點後第 *n* 位,使用偶數捨入法。若省略 *n* ,則預設為 0。" #: ../../library/stdtypes.rst:381 -#, fuzzy msgid ":func:`math.floor( x) `" -msgstr ":func:`math.floor(\\ x) `" +msgstr ":func:`math.floor( x) `" #: ../../library/stdtypes.rst:381 msgid "the greatest :class:`~numbers.Integral` <= *x*" @@ -3338,16 +3336,15 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:2086 -#, fuzzy msgid "" ">>> 'ASCII characters'.isascii()\n" "True\n" ">>> 'µ'.isascii()\n" "False" msgstr "" -">>> b'ABCabc'.isalpha()\n" +">>> 'ASCII characters'.isascii()\n" "True\n" -">>> b'ABCabc1'.isalpha()\n" +">>> 'µ'.isascii()\n" "False" #: ../../library/stdtypes.rst:2098 @@ -3518,9 +3515,8 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:2240 -#, fuzzy msgid "See also :meth:`split`." -msgstr "另請參閱 :meth:`istitle`。" +msgstr "另請參閱 :meth:`split`。" #: ../../library/stdtypes.rst:2245 msgid "" @@ -3837,9 +3833,8 @@ msgstr "" "['foo ']" #: ../../library/stdtypes.rst:2454 -#, fuzzy msgid "See also :meth:`join`." -msgstr "另請參閱 :meth:`title`。" +msgstr "另請參閱 :meth:`join`。" #: ../../library/stdtypes.rst:2462 msgid "" @@ -7734,8 +7729,8 @@ msgid "" "__exit__` method has actually failed." msgstr "" "傳入的例外不應明確重新引發 - 取而代之的是,此方法應回傳 false 值以指示該方法" -"已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" -"`__exit__` 方法是否曾實際失敗過。" +"已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:`~object." +"__exit__` 方法是否曾實際失敗過。" #: ../../library/stdtypes.rst:5415 msgid "" @@ -8478,7 +8473,7 @@ msgstr "int | str == str | int" #: ../../library/stdtypes.rst:5750 msgid "It creates instances of :class:`typing.Union`::" -msgstr "它會建立 :class:`types.UnionType` 的實例: ::" +msgstr "它會建立 :class:`typing.Union` 的實例: ::" #: ../../library/stdtypes.rst:5752 msgid "" @@ -8532,8 +8527,8 @@ msgid "" "The user-exposed type for the union object can be accessed from :class:" "`typing.Union` and used for :func:`isinstance` checks::" msgstr "" -"構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`types." -"UnionType` 存取並用於 :func:`isinstance` 檢查: ::" +"構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`typing." +"Union` 存取並用於 :func:`isinstance` 檢查: ::" #: ../../library/stdtypes.rst:5781 msgid "" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 49923b419b..27dcb76604 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -803,7 +803,7 @@ msgid "" "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -":attr:`method_calls` 的成員都是 :data:`call` 物件。這些物件可以拆包為元組,以" +":attr:`mock_calls` 的成員都是 :data:`call` 物件。這些物件可以拆包為元組,以" "取得各個引數。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:749 @@ -3287,8 +3287,8 @@ msgid "" "assert_called_once_with` will then succeed no matter what was passed in." msgstr "" "要忽略某些引數,你可以傳入對\\ *所有物件*\\ 來說都相等的物件。那麼無論傳入什" -"麼內容,對 :meth:`~Mock.assert_used_with` 和 :meth:`~Mock." -"assert_used_once_with` 的呼叫都會成功。" +"麼內容,對 :meth:`~Mock.assert_called_with` 和 :meth:`~Mock." +"assert_called_once_with` 的呼叫都會成功。" #: ../../library/unittest.mock.rst:2456 msgid "" @@ -3518,7 +3518,7 @@ msgid "" "__enter__` and :meth:`~object.__exit__` called)." msgstr "" "問題是,即使你 mock 了對 :func:`open` 的呼叫,它也是作為情境管理器使用的\\ *" -"回傳物件*\\ (且其 :meth:`~object.__enter__` 和 :meth:`~ object.__exit__` 已" +"回傳物件*\\ (且其 :meth:`~object.__enter__` 和 :meth:`~object.__exit__` 已" "被呼叫)。" #: ../../library/unittest.mock.rst:2584 diff --git a/library/urllib.error.po b/library/urllib.error.po index 4ae1d93b07..eb4bc5a932 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -62,7 +62,7 @@ msgid "" ":exc:`URLError` used to be a subtype of :exc:`IOError`, which is now an " "alias of :exc:`OSError`." msgstr "" -":exc:`URLError` 過去是 :exc:`OSError` 的子類別,但現在為 :exc:`OSError` 的別" +":exc:`URLError` 過去是 :exc:`IOError` 的子類別,但現在為 :exc:`OSError` 的別" "名。" #: ../../library/urllib.error.rst:36 diff --git a/library/wsgiref.po b/library/wsgiref.po index bc6c212394..2f3a193312 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -333,7 +333,7 @@ msgid "" "headers added to the end of the wrapped list." msgstr "" ":class:`Headers` 物件支援典型對映操作包" -"括 :meth:`__getitem__`、:meth:`~dict.get`、:meth:`~object.__setitem__`、:meth:`~dict.setdefault`、:meth:`~object.__delitem__` " +"括 :meth:`~object.__getitem__`、:meth:`~dict.get`、:meth:`~object.__setitem__`、:meth:`~dict.setdefault`、:meth:`~object.__delitem__` " "以及 :meth:`~object.__contains__`。對於這些方法中的每一個,鍵是標頭名稱(以不" "區分大小寫方式處理),而值則是與該標頭名稱關聯的第一個值。設定標頭會刪除該標" "頭的所有現有值,然後將新值添加到包裝的標頭串列末尾。標頭的現有順序通常保持不" @@ -360,7 +360,7 @@ msgid "" "wrapped header list. In fact, the :meth:`items` method just returns a copy " "of the wrapped header list." msgstr "" -":class:`Headers` 物件還支援 :meth:`keys`、:meth:`value`、和 :meth:`items` 方" +":class:`Headers` 物件還支援 :meth:`keys`、:meth:`values`、和 :meth:`items` 方" "法。由 :meth:`keys` 和 :meth:`items` 回傳的串列在存在多值標頭時可能會包含相同" "的鍵。:class:`Headers` 物件的 ``len()`` 與 :meth:`items` 的長度相同,也與包裝" "標頭串列的長度相同。實際上,:meth:`items` 方法只是回傳包裝的標頭串列的副本。" @@ -373,7 +373,7 @@ msgid "" "line is terminated by a carriage return and line feed, and the bytestring is " "terminated with a blank line." msgstr "" -"對 :class:`Header` 物件呼叫 ``bytes()`` 會回傳適合作為 HTTP 傳輸回應標頭的格" +"對 :class:`Headers` 物件呼叫 ``bytes()`` 會回傳適合作為 HTTP 傳輸回應標頭的格" "式化的位元組字串。每個標頭都與其值一起置於一行上,由冒號與空格分隔。每行以回" "車(carriage return)和換行(line feed)結束,而該位元組字串則以空行結束。" @@ -606,7 +606,7 @@ msgid "" "instance using a :mod:`wsgiref.handlers` class to implement the actual WSGI " "application interface." msgstr "" -"處理 HTTP 請求。預設實作會使用 :mod:`wsgiref.handler` 類別來建立處置程式" +"處理 HTTP 請求。預設實作會使用 :mod:`wsgiref.handlers` 類別來建立處置程式" "(handler)實例來實作實際 WSGI 應用程式介面。" #: ../../library/wsgiref.rst:386 @@ -1180,7 +1180,7 @@ msgid "" "This attribute's default value is true in :class:`BaseHandler`, but false " "in :class:`BaseCGIHandler` and :class:`CGIHandler`." msgstr "" -"這個屬性在 :class:`BaseCGIHandler` 預設值為 true,但是" +"這個屬性在 :class:`BaseHandler` 預設值為 true,但是" "在 :class:`BaseCGIHandler` 和 :class:`CGIHandler` 為 false。" #: ../../library/wsgiref.rst:754 diff --git a/license.po b/license.po index 30fd22c2e6..b4fb5c3d9a 100644 --- a/license.po +++ b/license.po @@ -1993,7 +1993,7 @@ msgid "" "using an included copy of the libffi sources unless the build is configured " "``--with-system-libffi``::" msgstr "" -"除非在建置 :mod:`_ctypes` 模組底下 :mod:`!_ctypes` 擴充程式時設定為 ``--with-" +"除非在建置 :mod:`ctypes` 模組底下 :mod:`!_ctypes` 擴充程式時設定為 ``--with-" "system-libffi``,否則該擴充會用一個內含 libffi 原始碼的副本來建置: ::" #: ../../license.rst:883 diff --git a/sphinx.po b/sphinx.po index 928cc74982..bcac49ad5b 100644 --- a/sphinx.po +++ b/sphinx.po @@ -227,14 +227,12 @@ msgid "CPython implementation detail:" msgstr "CPython 實作細節:" #: ../../tools/templates/dummy.html:30 -#, fuzzy msgid "Deprecated since version %s, will be removed in version %s" -msgstr "自從版本 {deprecated} 後不推薦使用,將會自版本 {removed} 中移除。" +msgstr "自從版本 %s 後不推薦使用,將會自版本 %s 中移除。" #: ../../tools/templates/dummy.html:31 -#, fuzzy msgid "Deprecated since version %s, removed in version %s" -msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" +msgstr "自從版本 %s 後不推薦使用,已從版本 %s 中移除。" #: ../../tools/templates/dummy.html:35 msgid "in development" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 33a6e2225f..a93bb9bf48 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -98,7 +98,6 @@ msgid "Numbers" msgstr "數字 (Number)" #: ../../tutorial/introduction.rst:52 -#, fuzzy msgid "" "The interpreter acts as a simple calculator: you can type an expression into " "it and it will write the value. Expression syntax is straightforward: the " diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index 05ca483590..e4ed439ada 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -691,7 +691,7 @@ msgid "" "providing a persistent database that can be updated and accessed using " "slightly nonstandard SQL syntax." msgstr "" -":mod:`sqllite3` 模組是 SQLite 資料庫函式庫的一層包裝,提供一個具持久性的資料" +":mod:`sqlite3` 模組是 SQLite 資料庫函式庫的一層包裝,提供一個具持久性的資料" "庫,可以使用稍微非標準的 SQL 語法來對它進行更新與存取。" #: ../../tutorial/stdlib.rst:357 diff --git a/using/windows.po b/using/windows.po index 44cb2fdffe..c3d55265db 100644 --- a/using/windows.po +++ b/using/windows.po @@ -2289,13 +2289,12 @@ msgid "The default installation directory for all-user installs" msgstr "" #: ../../using/windows.rst:1411 -#, fuzzy msgid "" ":file:`%ProgramFiles%\\\\ Python X.Y` or :file:` %ProgramFiles(x86)%\\\\ " "Python X.Y`" msgstr "" -":file:`%ProgramFiles%\\\\\\ Python X.Y` 或 :file:`\\ %ProgramFiles(x86)%\\\\" -"\\ Python X.Y`" +":file:`%ProgramFiles%\\\\ Python X.Y` or :file:` %ProgramFiles(x86)%\\\\ " +"Python X.Y`" #: ../../using/windows.rst:1416 msgid "DefaultJustForMeTargetDir" @@ -2303,18 +2302,17 @@ msgstr "DefaultJustForMeTargetDir" #: ../../using/windows.rst:1416 msgid "The default install directory for just-for-me installs" -msgstr "預設安裝目錄給 只有給我 安裝方式" +msgstr "" #: ../../using/windows.rst:1416 -#, fuzzy msgid "" ":file:`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY` or :file:" "`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-32` or :file:" "`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-64`" msgstr "" -":file:`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY` 或 :file:" -"`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-32` 或 :file:" -"`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-64`" +":file:`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY` 或 :file:" +"`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-32` 或 :file:" +"`%LocalAppData%\\\\ Programs\\\\Python\\\\ PythonXY-64`" #: ../../using/windows.rst:1426 msgid "DefaultCustomTargetDir" @@ -2334,7 +2332,7 @@ msgstr "AssociateFiles" #: ../../using/windows.rst:1429 msgid "Create file associations if the launcher is also installed." -msgstr "當執行程序也被安裝時創造檔案關聯" +msgstr "如果啟動器也被安裝,建立檔案關聯。" #: ../../using/windows.rst:1429 ../../using/windows.rst:1443 #: ../../using/windows.rst:1446 ../../using/windows.rst:1450 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 013aea9e8e..6115d42ecc 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -3416,7 +3416,7 @@ msgid "" msgstr "" ":data:`!OP_NO_SSLv2`、:data:`!OP_NO_SSLv3`、:data:`!OP_NO_TLSv1`、:data:`!" "OP_NO_TLSv1_1`、:data:`!OP_NO_TLSv1_2`、和 :data:`!OP_NO_TLSv1_3` 已被替換" -"為 :attr:`~ssl.sslSSLContext.minimum_version` 和 :attr:`~ssl.sslSSLContext." +"為 :attr:`~ssl.SSLContext.minimum_version` 和 :attr:`~ssl.SSLContext." "maximum_version`。" #: ../../whatsnew/3.10.rst:1769 diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index af313e7247..a04e5d6343 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -1852,7 +1852,7 @@ msgid "" msgstr "" "在 Unix 上,如果 ``sem_clockwait()`` 函式在 C 函式庫(glibc 2.30 與其更新的版" "本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 (:" -"const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:" +"const:`time.CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:" "const:`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner " "在 :issue:`41710` 中貢獻。)" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index aca9ebacb5..2c948273fa 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -4819,7 +4819,7 @@ msgstr ":c:func:`!PyEval_CallMethod`:請改用 :c:func:`PyObject_CallMethod` #: ../../whatsnew/3.13.rst:2414 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." -msgstr ":c:func:`!PyCFunction_Call`:請改用 :c:func:`PyCFunction_Call`。" +msgstr ":c:func:`!PyCFunction_Call`:請改用 :c:func:`PyObject_Call`。" #: ../../whatsnew/3.13.rst:2417 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index a49e6dff1c..0f2fc32f80 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -26,9 +26,8 @@ msgid "Author" msgstr "作者" #: ../../whatsnew/3.4.rst:5 -#, fuzzy msgid "\\R. David Murray (Editor)" -msgstr "R. David Murray (編輯者)" +msgstr "\\R. David Murray (編輯者)" #: ../../whatsnew/3.4.rst:63 msgid "" From bd8aaf513d40d3ddf2d6245843eeef6bead77161 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 2 Dec 2025 00:16:27 +0000 Subject: [PATCH 10/13] sync with cpython 76420708 --- c-api/descriptor.po | 58 +++++-- c-api/dict.po | 203 ++++++++++++----------- library/multiprocessing.po | 4 +- library/subprocess.po | 320 +++++++++++++++++++------------------ 4 files changed, 322 insertions(+), 263 deletions(-) diff --git a/c-api/descriptor.po b/c-api/descriptor.po index aac05cf760..0613dc5d61 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-10 00:16+0000\n" +"POT-Creation-Date: 2025-12-02 00:15+0000\n" "PO-Revision-Date: 2021-12-09 20:56+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,8 +37,41 @@ msgstr "" msgid "The type object for the built-in descriptor types." msgstr "內建 descriptor 型別的型別物件。" +#: ../../c-api/descriptor.rst:26 +msgid "" +"The type object for member descriptor objects created from :c:type:" +"`PyMemberDef` structures. These descriptors expose fields of a C struct as " +"attributes on a type, and correspond to :class:`types.MemberDescriptorType` " +"objects in Python." +msgstr "" + #: ../../c-api/descriptor.rst:35 msgid "" +"The type object for get/set descriptor objects created from :c:type:" +"`PyGetSetDef` structures. These descriptors implement attributes whose value " +"is computed by C getter and setter functions, and are used for many built-in " +"type attributes." +msgstr "" + +#: ../../c-api/descriptor.rst:46 +msgid "" +"The type object for method descriptor objects created from :c:type:" +"`PyMethodDef` structures. These descriptors expose C functions as methods on " +"a type, and correspond to :class:`types.MemberDescriptorType` objects in " +"Python." +msgstr "" + +#: ../../c-api/descriptor.rst:57 +msgid "" +"The type object for wrapper descriptor objects created by :c:func:" +"`PyDescr_NewWrapper` and :c:func:`PyWrapper_New`. Wrapper descriptors are " +"used internally to expose special methods implemented via wrapper " +"structures, and appear in Python as :class:`types.WrapperDescriptorType` " +"objects." +msgstr "" + +#: ../../c-api/descriptor.rst:69 +msgid "" "Return non-zero if the descriptor object *descr* describes a data attribute, " "or ``0`` if it describes a method. *descr* must be a descriptor object; " "there is no error checking." @@ -46,48 +79,55 @@ msgstr "" "如果 descriptor 物件 *descr* 描述的是一個資料屬性則回傳非零值,或者如果它描述" "的是一個方法則回傳 ``0``。*descr* 必須為一個 descriptor 物件;沒有錯誤檢查。" -#: ../../c-api/descriptor.rst:44 +#: ../../c-api/descriptor.rst:78 msgid "Built-in descriptors" msgstr "內建描述器" -#: ../../c-api/descriptor.rst:48 +#: ../../c-api/descriptor.rst:82 msgid "" "The type object for super objects. This is the same object as :class:`super` " "in the Python layer." msgstr "" -#: ../../c-api/descriptor.rst:54 +#: ../../c-api/descriptor.rst:88 msgid "" "The type of class method objects. This is the same object as :class:" "`classmethod` in the Python layer." msgstr "" -#: ../../c-api/descriptor.rst:60 +#: ../../c-api/descriptor.rst:94 +msgid "" +"The type object for C-level class method descriptor objects. This is the " +"type of the descriptors created for :func:`classmethod` defined in C " +"extension types, and is the same object as :class:`classmethod` in Python." +msgstr "" + +#: ../../c-api/descriptor.rst:102 msgid "" "Create a new :class:`classmethod` object wrapping *callable*. *callable* " "must be a callable object and must not be ``NULL``." msgstr "" -#: ../../c-api/descriptor.rst:63 +#: ../../c-api/descriptor.rst:105 msgid "" "On success, this function returns a :term:`strong reference` to a new class " "method descriptor. On failure, this function returns ``NULL`` with an " "exception set." msgstr "" -#: ../../c-api/descriptor.rst:70 +#: ../../c-api/descriptor.rst:112 msgid "" "The type of static method objects. This is the same object as :class:" "`staticmethod` in the Python layer." msgstr "" -#: ../../c-api/descriptor.rst:76 +#: ../../c-api/descriptor.rst:118 msgid "" "Create a new :class:`staticmethod` object wrapping *callable*. *callable* " "must be a callable object and must not be ``NULL``." msgstr "" -#: ../../c-api/descriptor.rst:79 +#: ../../c-api/descriptor.rst:121 msgid "" "On success, this function returns a :term:`strong reference` to a new static " "method descriptor. On failure, this function returns ``NULL`` with an " diff --git a/c-api/dict.po b/c-api/dict.po index 67d0229aa5..e23ff15187 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-18 00:15+0000\n" +"POT-Creation-Date: 2025-12-02 00:15+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -64,28 +64,38 @@ msgid "" msgstr "" #: ../../c-api/dict.rst:48 +msgid "" +"The type object for mapping proxy objects created by :c:func:" +"`PyDictProxy_New` and for the read-only ``__dict__`` attribute of many built-" +"in types. A :c:type:`PyDictProxy_Type` instance provides a dynamic, read-" +"only view of an underlying dictionary: changes to the underlying dictionary " +"are reflected in the proxy, but the proxy itself does not support mutation " +"operations. This corresponds to :class:`types.MappingProxyType` in Python." +msgstr "" + +#: ../../c-api/dict.rst:59 msgid "Empty an existing dictionary of all key-value pairs." msgstr "清空現有字典中的所有鍵值對。" -#: ../../c-api/dict.rst:53 +#: ../../c-api/dict.rst:64 msgid "" "Determine if dictionary *p* contains *key*. If an item in *p* matches " "*key*, return ``1``, otherwise return ``0``. On error, return ``-1``. This " "is equivalent to the Python expression ``key in p``." msgstr "" -#: ../../c-api/dict.rst:60 +#: ../../c-api/dict.rst:71 msgid "" "This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a :" "c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:69 +#: ../../c-api/dict.rst:80 msgid "Return a new dictionary that contains the same key-value pairs as *p*." msgstr "回傳一個新的字典,包含與 *p* 相同的鍵值對。" -#: ../../c-api/dict.rst:74 +#: ../../c-api/dict.rst:85 msgid "" "Insert *val* into the dictionary *p* with a key of *key*. *key* must be :" "term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return ``0`` " @@ -93,14 +103,14 @@ msgid "" "to *val*." msgstr "" -#: ../../c-api/dict.rst:82 +#: ../../c-api/dict.rst:93 msgid "" "This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:" "expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:89 +#: ../../c-api/dict.rst:100 msgid "" "Remove the entry in dictionary *p* with key *key*. *key* must be :term:" "`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the " @@ -108,72 +118,72 @@ msgid "" "failure." msgstr "" -#: ../../c-api/dict.rst:97 +#: ../../c-api/dict.rst:108 msgid "" "This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a :c:" "expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:104 +#: ../../c-api/dict.rst:115 msgid "" "Return a new :term:`strong reference` to the object from dictionary *p* " "which has a key *key*:" msgstr "" -#: ../../c-api/dict.rst:107 +#: ../../c-api/dict.rst:118 msgid "" "If the key is present, set *\\*result* to a new :term:`strong reference` to " "the value and return ``1``." msgstr "" -#: ../../c-api/dict.rst:109 +#: ../../c-api/dict.rst:120 msgid "If the key is missing, set *\\*result* to ``NULL`` and return ``0``." msgstr "如果鍵不存在,將 *\\*result* 設為 ``NULL`` 並回傳 ``0``。" -#: ../../c-api/dict.rst:110 ../../c-api/dict.rst:207 +#: ../../c-api/dict.rst:121 ../../c-api/dict.rst:218 msgid "On error, raise an exception and return ``-1``." msgstr "錯誤發生時,引發一個例外並回傳 ``-1``。" -#: ../../c-api/dict.rst:114 +#: ../../c-api/dict.rst:125 msgid "See also the :c:func:`PyObject_GetItem` function." msgstr "另見 :c:func:`PyObject_GetItem` 函式。" -#: ../../c-api/dict.rst:119 +#: ../../c-api/dict.rst:130 msgid "" "Return a :term:`borrowed reference` to the object from dictionary *p* which " "has a key *key*. Return ``NULL`` if the key *key* is missing *without* " "setting an exception." msgstr "" -#: ../../c-api/dict.rst:125 +#: ../../c-api/dict.rst:136 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:129 +#: ../../c-api/dict.rst:140 msgid "" "Calling this API without an :term:`attached thread state` had been allowed " "for historical reason. It is no longer allowed." msgstr "" -#: ../../c-api/dict.rst:136 +#: ../../c-api/dict.rst:147 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:144 +#: ../../c-api/dict.rst:155 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" "expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:150 +#: ../../c-api/dict.rst:161 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods or while creating the temporary :class:`str` object " @@ -181,13 +191,13 @@ msgid "" "function with your own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" -#: ../../c-api/dict.rst:159 +#: ../../c-api/dict.rst:170 msgid "" "Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as a :c:expr:" "`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:168 +#: ../../c-api/dict.rst:179 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 " @@ -197,7 +207,7 @@ msgid "" "the insertion." msgstr "" -#: ../../c-api/dict.rst:179 +#: ../../c-api/dict.rst:190 msgid "" "Inserts *default_value* into the dictionary *p* with a key of *key* if the " "key is not already present in the dictionary. If *result* is not ``NULL``, " @@ -209,7 +219,7 @@ msgid "" "exception, and sets ``*result`` to ``NULL``." msgstr "" -#: ../../c-api/dict.rst:189 +#: ../../c-api/dict.rst:200 msgid "" "For clarity: if you have a strong reference to *default_value* before " "calling this function, then after it returns, you hold a strong reference to " @@ -217,63 +227,63 @@ msgid "" "to the same object: in that case you hold two separate references to it." msgstr "" -#: ../../c-api/dict.rst:200 +#: ../../c-api/dict.rst:211 msgid "" "Remove *key* from dictionary *p* and optionally return the removed value. Do " "not raise :exc:`KeyError` if the key is missing." msgstr "" -#: ../../c-api/dict.rst:203 +#: ../../c-api/dict.rst:214 msgid "" "If the key is present, set *\\*result* to a new reference to the removed " "value if *result* is not ``NULL``, and return ``1``." msgstr "" -#: ../../c-api/dict.rst:205 +#: ../../c-api/dict.rst:216 msgid "" "If the key is missing, set *\\*result* to ``NULL`` if *result* is not " "``NULL``, and return ``0``." msgstr "" -#: ../../c-api/dict.rst:209 +#: ../../c-api/dict.rst:220 msgid "" "Similar to :meth:`dict.pop`, but without the default value and not raising :" "exc:`KeyError` if the key is missing." msgstr "" -#: ../../c-api/dict.rst:217 +#: ../../c-api/dict.rst:228 msgid "" "Similar to :c:func:`PyDict_Pop`, but *key* is specified as a :c:expr:`const " "char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:226 +#: ../../c-api/dict.rst:237 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "回傳一個包含字典中所有項目的 :c:type:`PyListObject`。" -#: ../../c-api/dict.rst:231 +#: ../../c-api/dict.rst:242 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "回傳一個包含字典中所有鍵的 :c:type:`PyListObject`。" -#: ../../c-api/dict.rst:236 +#: ../../c-api/dict.rst:247 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "回傳一個包含字典 *p* 中所有值的 :c:type:`PyListObject`。" -#: ../../c-api/dict.rst:244 +#: ../../c-api/dict.rst:255 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "回傳字典中項目的數量。此與於字典呼叫 ``len(p)`` 等效。" -#: ../../c-api/dict.rst:250 +#: ../../c-api/dict.rst:261 msgid "Similar to :c:func:`PyDict_Size`, but without error checking." msgstr "和 :c:func:`PyDict_Size` 類似,但沒有錯誤檢查。" -#: ../../c-api/dict.rst:255 +#: ../../c-api/dict.rst:266 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 " @@ -287,11 +297,11 @@ msgid "" "structure is sparse, the offsets are not consecutive." msgstr "" -#: ../../c-api/dict.rst:266 +#: ../../c-api/dict.rst:277 msgid "For example::" msgstr "舉例來說: ::" -#: ../../c-api/dict.rst:268 +#: ../../c-api/dict.rst:279 msgid "" "PyObject *key, *value;\n" "Py_ssize_t pos = 0;\n" @@ -309,14 +319,14 @@ msgstr "" " ...\n" "}" -#: ../../c-api/dict.rst:276 +#: ../../c-api/dict.rst:287 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:280 +#: ../../c-api/dict.rst:291 msgid "" "PyObject *key, *value;\n" "Py_ssize_t pos = 0;\n" @@ -354,14 +364,14 @@ msgstr "" " Py_DECREF(o);\n" "}" -#: ../../c-api/dict.rst:298 +#: ../../c-api/dict.rst:309 msgid "" "The function is not thread-safe in the :term:`free-threaded ` build without external synchronization. You can use :c:macro:" "`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating over it::" msgstr "" -#: ../../c-api/dict.rst:303 +#: ../../c-api/dict.rst:314 msgid "" "Py_BEGIN_CRITICAL_SECTION(self->dict);\n" "while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" @@ -375,7 +385,7 @@ msgstr "" "}\n" "Py_END_CRITICAL_SECTION();" -#: ../../c-api/dict.rst:311 +#: ../../c-api/dict.rst:322 msgid "" "On the free-threaded build, this function can be used safely inside a " "critical section. However, the references returned for *pkey* and *pvalue* " @@ -386,7 +396,7 @@ msgid "" "`Py_NewRef`)." msgstr "" -#: ../../c-api/dict.rst:321 +#: ../../c-api/dict.rst:332 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` " @@ -396,7 +406,7 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" -#: ../../c-api/dict.rst:331 +#: ../../c-api/dict.rst:342 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 " @@ -405,7 +415,7 @@ msgid "" "exception was raised." msgstr "" -#: ../../c-api/dict.rst:340 +#: ../../c-api/dict.rst:351 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, " @@ -414,7 +424,7 @@ msgid "" "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" -#: ../../c-api/dict.rst:347 +#: ../../c-api/dict.rst:358 msgid "" "def PyDict_MergeFromSeq2(a, seq2, override):\n" " for key, value in seq2:\n" @@ -426,7 +436,7 @@ msgstr "" " if override or key not in a:\n" " a[key] = value" -#: ../../c-api/dict.rst:354 +#: ../../c-api/dict.rst:365 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 " @@ -434,21 +444,21 @@ msgid "" "exception." msgstr "" -#: ../../c-api/dict.rst:363 +#: ../../c-api/dict.rst:374 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:371 +#: ../../c-api/dict.rst:382 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:379 +#: ../../c-api/dict.rst:390 msgid "" "Mark dictionary *dict* as no longer watched. The callback granted " "*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " @@ -456,7 +466,7 @@ msgid "" "watched by this watcher. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:388 +#: ../../c-api/dict.rst:399 msgid "" "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " "``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " @@ -464,11 +474,11 @@ msgid "" "``PyDict_EVENT_DEALLOCATED``." msgstr "" -#: ../../c-api/dict.rst:396 +#: ../../c-api/dict.rst:407 msgid "Type of a dict watcher callback function." msgstr "" -#: ../../c-api/dict.rst:398 +#: ../../c-api/dict.rst:409 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`` " @@ -477,7 +487,7 @@ msgid "" "dictionary and *new_value* will be ``NULL``." msgstr "" -#: ../../c-api/dict.rst:404 +#: ../../c-api/dict.rst:415 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 " @@ -485,14 +495,14 @@ msgid "" "``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." msgstr "" -#: ../../c-api/dict.rst:410 +#: ../../c-api/dict.rst:421 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:414 +#: ../../c-api/dict.rst:425 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 " @@ -501,20 +511,20 @@ msgid "" "again." msgstr "" -#: ../../c-api/dict.rst:420 +#: ../../c-api/dict.rst:431 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:423 +#: ../../c-api/dict.rst:434 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:427 +#: ../../c-api/dict.rst:438 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 " @@ -523,11 +533,11 @@ msgid "" "it before returning." msgstr "" -#: ../../c-api/dict.rst:437 +#: ../../c-api/dict.rst:448 msgid "Dictionary View Objects" msgstr "字典視圖物件" -#: ../../c-api/dict.rst:441 +#: ../../c-api/dict.rst:452 msgid "" "Return true if *op* is a view of a set inside a dictionary. This is " "currently equivalent to :c:expr:`PyDictKeys_Check(op) || " @@ -536,152 +546,153 @@ msgstr "" "若 *op* 是一個字典中集合的視圖則會回傳 true。這目前等同於 :c:expr:" "`PyDictKeys_Check(op) || PyDictItems_Check(op)`。此函式每次都會執行成功。" -#: ../../c-api/dict.rst:448 +#: ../../c-api/dict.rst:459 msgid "" "Type object for a view of dictionary keys. In Python, this is the type of " "the object returned by :meth:`dict.keys`." msgstr "" -#: ../../c-api/dict.rst:454 +#: ../../c-api/dict.rst:465 msgid "" "Return true if *op* is an instance of a dictionary keys view. This function " "always succeeds." msgstr "若 *op* 是一個字典鍵視圖的實例則會回傳 true。此函式每次都會執行成功。" -#: ../../c-api/dict.rst:460 +#: ../../c-api/dict.rst:471 msgid "" "Type object for a view of dictionary values. In Python, this is the type of " "the object returned by :meth:`dict.values`." msgstr "" -#: ../../c-api/dict.rst:466 +#: ../../c-api/dict.rst:477 msgid "" "Return true if *op* is an instance of a dictionary values view. This " "function always succeeds." msgstr "若 *op* 是一個字典值視圖的實例則會回傳 true。此函式每次都會執行成功。" -#: ../../c-api/dict.rst:472 +#: ../../c-api/dict.rst:483 msgid "" "Type object for a view of dictionary items. In Python, this is the type of " "the object returned by :meth:`dict.items`." msgstr "" -#: ../../c-api/dict.rst:478 +#: ../../c-api/dict.rst:489 msgid "" "Return true if *op* is an instance of a dictionary items view. This function " "always succeeds." msgstr "" "若 *op* 是一個字典項目視圖的實例則會回傳 true。此函式每次都會執行成功。" -#: ../../c-api/dict.rst:483 +#: ../../c-api/dict.rst:494 msgid "Ordered Dictionaries" msgstr "有序字典" -#: ../../c-api/dict.rst:485 +#: ../../c-api/dict.rst:496 msgid "" "Python's C API provides interface for :class:`collections.OrderedDict` from " "C. Since Python 3.7, dictionaries are ordered by default, so there is " "usually little need for these functions; prefer ``PyDict*`` where possible." msgstr "" -#: ../../c-api/dict.rst:492 +#: ../../c-api/dict.rst:503 msgid "" "Type object for ordered dictionaries. This is the same object as :class:" "`collections.OrderedDict` in the Python layer." msgstr "" -"有序字典的型別物件。此與 Python 層中的 :class:`collections.OrderedDict` 為同一個物件。" +"有序字典的型別物件。此與 Python 層中的 :class:`collections.OrderedDict` 為同" +"一個物件。" -#: ../../c-api/dict.rst:498 +#: ../../c-api/dict.rst:509 msgid "" "Return true if *od* is an ordered dictionary object or an instance of a " "subtype of the :class:`~collections.OrderedDict` type. This function always " "succeeds." msgstr "" -"若 *od* 是一個有序字典物件或 :class:`~collections.OrderedDict` 的子型別實例則會回傳 true。" -"此函式每次都會執行成功。" +"若 *od* 是一個有序字典物件或 :class:`~collections.OrderedDict` 的子型別實例則" +"會回傳 true。此函式每次都會執行成功。" -#: ../../c-api/dict.rst:505 +#: ../../c-api/dict.rst:516 msgid "" "Return true if *od* is an ordered dictionary object, but not an instance of " "a subtype of the :class:`~collections.OrderedDict` type. This function " "always succeeds." msgstr "" -"若 *od* 是一個有序字典物件但並不是一個 :class:`~collections.OrderedDict` 子型別的實例," -"則回傳 true。此函式每次都會執行成功。" +"若 *od* 是一個有序字典物件但並不是一個 :class:`~collections.OrderedDict` 子型" +"別的實例,則回傳 true。此函式每次都會執行成功。" -#: ../../c-api/dict.rst:512 +#: ../../c-api/dict.rst:523 msgid "Analogous to :c:type:`PyDictKeys_Type` for ordered dictionaries." msgstr "" -#: ../../c-api/dict.rst:517 +#: ../../c-api/dict.rst:528 msgid "Analogous to :c:type:`PyDictValues_Type` for ordered dictionaries." msgstr "" -#: ../../c-api/dict.rst:522 +#: ../../c-api/dict.rst:533 msgid "Analogous to :c:type:`PyDictItems_Type` for ordered dictionaries." msgstr "" -#: ../../c-api/dict.rst:527 +#: ../../c-api/dict.rst:538 msgid "Return a new empty ordered dictionary, or ``NULL`` on failure." msgstr "回傳一個新的空有序字典,或在失敗時回傳 ``NULL``。" -#: ../../c-api/dict.rst:529 +#: ../../c-api/dict.rst:540 msgid "This is analogous to :c:func:`PyDict_New`." msgstr "這和 :c:func:`PyDict_New` 類似。" -#: ../../c-api/dict.rst:534 +#: ../../c-api/dict.rst:545 msgid "" "Insert *value* into the ordered dictionary *od* with a key of *key*. Return " "``0`` on success or ``-1`` with an exception set on failure." msgstr "" -#: ../../c-api/dict.rst:537 +#: ../../c-api/dict.rst:548 msgid "This is analogous to :c:func:`PyDict_SetItem`." msgstr "這和 :c:func:`PyDict_SetItem` 類似。" -#: ../../c-api/dict.rst:542 +#: ../../c-api/dict.rst:553 msgid "" "Remove the entry in the ordered dictionary *od* with key *key*. Return ``0`` " "on success or ``-1`` with an exception set on failure." msgstr "" -#: ../../c-api/dict.rst:545 +#: ../../c-api/dict.rst:556 msgid "This is analogous to :c:func:`PyDict_DelItem`." msgstr "這和 :c:func:`PyDict_DelItem` 類似。" -#: ../../c-api/dict.rst:548 +#: ../../c-api/dict.rst:559 msgid "These are :term:`soft deprecated` aliases to ``PyDict`` APIs:" msgstr "" -#: ../../c-api/dict.rst:555 +#: ../../c-api/dict.rst:566 msgid "``PyODict``" msgstr "``PyODict``" -#: ../../c-api/dict.rst:556 +#: ../../c-api/dict.rst:567 msgid "``PyDict``" msgstr "``PyDict``" -#: ../../c-api/dict.rst:558 +#: ../../c-api/dict.rst:569 msgid ":c:func:`PyDict_GetItem`" msgstr ":c:func:`PyDict_GetItem`" -#: ../../c-api/dict.rst:560 +#: ../../c-api/dict.rst:571 msgid ":c:func:`PyDict_GetItemWithError`" msgstr ":c:func:`PyDict_GetItemWithError`" -#: ../../c-api/dict.rst:562 +#: ../../c-api/dict.rst:573 msgid ":c:func:`PyDict_GetItemString`" msgstr ":c:func:`PyDict_GetItemString`" -#: ../../c-api/dict.rst:564 +#: ../../c-api/dict.rst:575 msgid ":c:func:`PyDict_Contains`" msgstr ":c:func:`PyDict_Contains`" -#: ../../c-api/dict.rst:566 +#: ../../c-api/dict.rst:577 msgid ":c:func:`PyDict_Size`" msgstr ":c:func:`PyDict_Size`" -#: ../../c-api/dict.rst:568 +#: ../../c-api/dict.rst:579 msgid ":c:func:`PyDict_GET_SIZE`" msgstr ":c:func:`PyDict_GET_SIZE`" @@ -693,10 +704,10 @@ msgstr "object(物件)" msgid "dictionary" msgstr "dictionary(字典)" -#: ../../c-api/dict.rst:242 +#: ../../c-api/dict.rst:253 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/dict.rst:242 +#: ../../c-api/dict.rst:253 msgid "len" msgstr "len" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index f22cb71feb..f5a016fe28 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-01 00:17+0000\n" +"POT-Creation-Date: 2025-12-02 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1356,7 +1356,7 @@ msgstr "" msgid "" "One difference from other Python queue implementations, is that :mod:" "`multiprocessing` queues serializes all objects that are put into them " -"using :mod:`pickle`. The object return by the get method is a re-created " +"using :mod:`pickle`. The object returned by the get method is a re-created " "object that does not share memory with the original object." msgstr "" diff --git a/library/subprocess.po b/library/subprocess.po index ff180dc20c..23c4b21b71 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-30 00:16+0000\n" +"POT-Creation-Date: 2025-12-02 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,7 +53,7 @@ msgstr ":pep:`324` -- 提議 subprocess 模組的 PEP" #: ../../library/subprocess.rst:598 ../../library/subprocess.rst:605 #: ../../library/subprocess.rst:615 ../../library/subprocess.rst:624 #: ../../library/subprocess.rst:633 ../../library/subprocess.rst:639 -#: ../../library/subprocess.rst:1496 ../../library/subprocess.rst:1518 +#: ../../library/subprocess.rst:1501 ../../library/subprocess.rst:1523 #: ../../includes/wasm-mobile-notavail.rst:3 msgid "Availability" msgstr "可用性" @@ -193,8 +193,8 @@ msgid "" msgstr "" #: ../../library/subprocess.rst:122 ../../library/subprocess.rst:506 -#: ../../library/subprocess.rst:1216 ../../library/subprocess.rst:1256 -#: ../../library/subprocess.rst:1319 +#: ../../library/subprocess.rst:1221 ../../library/subprocess.rst:1261 +#: ../../library/subprocess.rst:1324 msgid "" "Changed Windows shell search order for ``shell=True``. The current directory " "and ``%PATH%`` are replaced with ``%COMSPEC%`` and ``%SystemRoot%" @@ -218,7 +218,7 @@ msgid "" "that it ran successfully." msgstr "" -#: ../../library/subprocess.rst:141 ../../library/subprocess.rst:947 +#: ../../library/subprocess.rst:141 ../../library/subprocess.rst:952 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." @@ -395,8 +395,8 @@ msgid "" "binary streams. No encoding or line ending conversion is performed." msgstr "" -#: ../../library/subprocess.rst:314 ../../library/subprocess.rst:1505 -#: ../../library/subprocess.rst:1523 +#: ../../library/subprocess.rst:314 ../../library/subprocess.rst:1510 +#: ../../library/subprocess.rst:1528 msgid "Added the *encoding* and *errors* parameters." msgstr "新增 *encoding* 與 *errors* 參數。" @@ -860,7 +860,7 @@ msgstr "" msgid "*encoding* and *errors* were added." msgstr "新增 *encoding* 與 *errors*。" -#: ../../library/subprocess.rst:665 ../../library/subprocess.rst:1314 +#: ../../library/subprocess.rst:665 ../../library/subprocess.rst:1319 msgid "*text* was added as a more readable alias for *universal_newlines*." msgstr "" @@ -1096,9 +1096,9 @@ msgid "" "create_subprocess_exec`." msgstr "" -#: ../../library/subprocess.rst:811 ../../library/subprocess.rst:854 -#: ../../library/subprocess.rst:1211 ../../library/subprocess.rst:1251 -#: ../../library/subprocess.rst:1305 +#: ../../library/subprocess.rst:811 ../../library/subprocess.rst:859 +#: ../../library/subprocess.rst:1216 ../../library/subprocess.rst:1256 +#: ../../library/subprocess.rst:1310 msgid "*timeout* was added." msgstr "新增 *timeout*。" @@ -1158,53 +1158,61 @@ msgstr "" " proc.kill()\n" " outs, errs = proc.communicate()" -#: ../../library/subprocess.rst:851 +#: ../../library/subprocess.rst:849 +msgid "" +"After a call to :meth:`~Popen.communicate` raises :exc:`TimeoutExpired`, do " +"not call :meth:`~Popen.wait`. Use an additional :meth:`~Popen.communicate` " +"call to finish handling pipes and populate the :attr:`~Popen.returncode` " +"attribute." +msgstr "" + +#: ../../library/subprocess.rst:856 msgid "" "The data read is buffered in memory, so do not use this method if the data " "size is large or unlimited." msgstr "" -#: ../../library/subprocess.rst:860 +#: ../../library/subprocess.rst:865 msgid "Sends the signal *signal* to the child." msgstr "" -#: ../../library/subprocess.rst:862 +#: ../../library/subprocess.rst:867 msgid "Do nothing if the process completed." msgstr "" -#: ../../library/subprocess.rst:866 +#: ../../library/subprocess.rst:871 msgid "" "On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and " "CTRL_BREAK_EVENT can be sent to processes started with a *creationflags* " "parameter which includes ``CREATE_NEW_PROCESS_GROUP``." msgstr "" -#: ../../library/subprocess.rst:873 +#: ../../library/subprocess.rst:878 msgid "" "Stop the child. On POSIX OSs the method sends :py:const:`~signal.SIGTERM` to " "the child. On Windows the Win32 API function :c:func:`!TerminateProcess` is " "called to stop the child." msgstr "" -#: ../../library/subprocess.rst:880 +#: ../../library/subprocess.rst:885 msgid "" "Kills the child. On POSIX OSs the function sends SIGKILL to the child. On " "Windows :meth:`kill` is an alias for :meth:`terminate`." msgstr "" -#: ../../library/subprocess.rst:884 +#: ../../library/subprocess.rst:889 msgid "" "The following attributes are also set by the class for you to access. " "Reassigning them to new values is unsupported:" msgstr "" -#: ../../library/subprocess.rst:889 +#: ../../library/subprocess.rst:894 msgid "" "The *args* argument as it was passed to :class:`Popen` -- a sequence of " "program arguments or else a single string." msgstr "" -#: ../../library/subprocess.rst:896 +#: ../../library/subprocess.rst:901 msgid "" "If the *stdin* argument was :data:`PIPE`, this attribute is a writeable " "stream object as returned by :func:`open`. If the *encoding* or *errors* " @@ -1213,7 +1221,7 @@ msgid "" "*stdin* argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:905 +#: ../../library/subprocess.rst:910 msgid "" "If the *stdout* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " @@ -1223,7 +1231,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:915 +#: ../../library/subprocess.rst:920 msgid "" "If the *stderr* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " @@ -1233,7 +1241,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:924 +#: ../../library/subprocess.rst:929 msgid "" "Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write `, :attr:`.stdout.read ` or :attr:`.stderr.read `__ structure is used for :class:`Popen` " @@ -1282,17 +1290,17 @@ msgid "" "only arguments." msgstr "" -#: ../../library/subprocess.rst:965 +#: ../../library/subprocess.rst:970 msgid "Keyword-only argument support was added." msgstr "" -#: ../../library/subprocess.rst:970 +#: ../../library/subprocess.rst:975 msgid "" "A bit field that determines whether certain :class:`STARTUPINFO` attributes " "are used when the process creates a window. ::" msgstr "" -#: ../../library/subprocess.rst:973 +#: ../../library/subprocess.rst:978 msgid "" "si = subprocess.STARTUPINFO()\n" "si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess." @@ -1302,28 +1310,28 @@ msgstr "" "si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess." "STARTF_USESHOWWINDOW" -#: ../../library/subprocess.rst:978 +#: ../../library/subprocess.rst:983 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` " "is not specified, the default for standard input is the keyboard buffer." msgstr "" -#: ../../library/subprocess.rst:985 +#: ../../library/subprocess.rst:990 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard output handle for the process. Otherwise, this attribute is " "ignored and the default for standard output is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:992 +#: ../../library/subprocess.rst:997 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard error handle for the process. Otherwise, this attribute is " "ignored and the default for standard error is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:998 +#: ../../library/subprocess.rst:1003 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute " "can be any of the values that can be specified in the ``nCmdShow`` parameter " @@ -1332,34 +1340,34 @@ msgid "" "Otherwise, this attribute is ignored." msgstr "" -#: ../../library/subprocess.rst:1005 +#: ../../library/subprocess.rst:1010 msgid "" ":data:`SW_HIDE` is provided for this attribute. It is used when :class:" "`Popen` is called with ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:1010 +#: ../../library/subprocess.rst:1015 msgid "" "A dictionary of additional attributes for process creation as given in " "``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" -#: ../../library/subprocess.rst:1014 +#: ../../library/subprocess.rst:1019 msgid "Supported attributes:" msgstr "" -#: ../../library/subprocess.rst:1016 +#: ../../library/subprocess.rst:1021 msgid "**handle_list**" msgstr "**handle_list**" -#: ../../library/subprocess.rst:1017 +#: ../../library/subprocess.rst:1022 msgid "" "Sequence of handles that will be inherited. *close_fds* must be true if non-" "empty." msgstr "" -#: ../../library/subprocess.rst:1020 +#: ../../library/subprocess.rst:1025 msgid "" "The handles must be temporarily made inheritable by :func:`os." "set_handle_inheritable` when passed to the :class:`Popen` constructor, else :" @@ -1367,7 +1375,7 @@ msgid "" "``ERROR_INVALID_PARAMETER`` (87)." msgstr "" -#: ../../library/subprocess.rst:1027 +#: ../../library/subprocess.rst:1032 msgid "" "In a multithreaded process, use caution to avoid leaking handles that are " "marked inheritable when combining this feature with concurrent calls to " @@ -1376,110 +1384,110 @@ msgid "" "temporarily creates inheritable handles." msgstr "" -#: ../../library/subprocess.rst:1037 +#: ../../library/subprocess.rst:1042 msgid "Windows Constants" msgstr "" -#: ../../library/subprocess.rst:1039 +#: ../../library/subprocess.rst:1044 msgid "The :mod:`subprocess` module exposes the following constants." msgstr "" -#: ../../library/subprocess.rst:1043 +#: ../../library/subprocess.rst:1048 msgid "" "The standard input device. Initially, this is the console input buffer, " "``CONIN$``." msgstr "" -#: ../../library/subprocess.rst:1048 +#: ../../library/subprocess.rst:1053 msgid "" "The standard output device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1053 +#: ../../library/subprocess.rst:1058 msgid "" "The standard error device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1058 +#: ../../library/subprocess.rst:1063 msgid "Hides the window. Another window will be activated." msgstr "" -#: ../../library/subprocess.rst:1062 +#: ../../library/subprocess.rst:1067 msgid "" "Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO." "hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional " "information." msgstr "" -#: ../../library/subprocess.rst:1068 +#: ../../library/subprocess.rst:1073 msgid "" "Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains " "additional information." msgstr "" -#: ../../library/subprocess.rst:1073 +#: ../../library/subprocess.rst:1078 msgid "" "A :attr:`STARTUPINFO.dwFlags` parameter to specify that the *Working in " "Background* mouse cursor will be displayed while a process is launching. " "This is the default behavior for GUI processes." msgstr "" -#: ../../library/subprocess.rst:1082 +#: ../../library/subprocess.rst:1087 msgid "" "A :attr:`STARTUPINFO.dwFlags` parameter to specify that the mouse cursor " "will not be changed when launching a process." msgstr "" -#: ../../library/subprocess.rst:1089 +#: ../../library/subprocess.rst:1094 msgid "" "The new process has a new console, instead of inheriting its parent's " "console (the default)." msgstr "" -#: ../../library/subprocess.rst:1094 +#: ../../library/subprocess.rst:1099 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "group will be created. This flag is necessary for using :func:`os.kill` on " "the subprocess." msgstr "" -#: ../../library/subprocess.rst:1098 +#: ../../library/subprocess.rst:1103 msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" -#: ../../library/subprocess.rst:1102 +#: ../../library/subprocess.rst:1107 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an above average priority." msgstr "" -#: ../../library/subprocess.rst:1109 +#: ../../library/subprocess.rst:1114 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a below average priority." msgstr "" -#: ../../library/subprocess.rst:1116 +#: ../../library/subprocess.rst:1121 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a high priority." msgstr "" -#: ../../library/subprocess.rst:1123 +#: ../../library/subprocess.rst:1128 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an idle (lowest) priority." msgstr "" -#: ../../library/subprocess.rst:1130 +#: ../../library/subprocess.rst:1135 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a normal priority. (default)" msgstr "" -#: ../../library/subprocess.rst:1137 +#: ../../library/subprocess.rst:1142 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have realtime priority. You should almost never use " @@ -1489,20 +1497,20 @@ msgid "" "perform brief tasks that should have limited interruptions." msgstr "" -#: ../../library/subprocess.rst:1148 +#: ../../library/subprocess.rst:1153 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not create a window." msgstr "" -#: ../../library/subprocess.rst:1155 +#: ../../library/subprocess.rst:1160 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not inherit its parent's console. This value cannot be used with " "CREATE_NEW_CONSOLE." msgstr "" -#: ../../library/subprocess.rst:1163 +#: ../../library/subprocess.rst:1168 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "does not inherit the error mode of the calling process. Instead, the new " @@ -1510,43 +1518,43 @@ msgid "" "multithreaded shell applications that run with hard errors disabled." msgstr "" -#: ../../library/subprocess.rst:1173 +#: ../../library/subprocess.rst:1178 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "is not associated with the job." msgstr "" -#: ../../library/subprocess.rst:1181 +#: ../../library/subprocess.rst:1186 msgid "Older high-level API" msgstr "" -#: ../../library/subprocess.rst:1183 +#: ../../library/subprocess.rst:1188 msgid "" "Prior to Python 3.5, these three functions comprised the high level API to " "subprocess. You can now use :func:`run` in many cases, but lots of existing " "code calls these functions." msgstr "" -#: ../../library/subprocess.rst:1190 +#: ../../library/subprocess.rst:1195 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return the :attr:`~Popen.returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:1193 ../../library/subprocess.rst:1233 +#: ../../library/subprocess.rst:1198 ../../library/subprocess.rst:1238 msgid "" "Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" -#: ../../library/subprocess.rst:1195 +#: ../../library/subprocess.rst:1200 msgid "run(...).returncode" msgstr "run(...).returncode" -#: ../../library/subprocess.rst:1197 ../../library/subprocess.rst:1237 +#: ../../library/subprocess.rst:1202 ../../library/subprocess.rst:1242 msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." msgstr "" -#: ../../library/subprocess.rst:1199 ../../library/subprocess.rst:1239 +#: ../../library/subprocess.rst:1204 ../../library/subprocess.rst:1244 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is the same as that of the :class:`Popen` constructor - this " @@ -1554,14 +1562,14 @@ msgid "" "to that interface." msgstr "" -#: ../../library/subprocess.rst:1206 ../../library/subprocess.rst:1246 +#: ../../library/subprocess.rst:1211 ../../library/subprocess.rst:1251 msgid "" "Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. The child " "process will block if it generates enough output to a pipe to fill up the OS " "pipe buffer as the pipes are not being read from." msgstr "" -#: ../../library/subprocess.rst:1226 +#: ../../library/subprocess.rst:1231 msgid "" "Run command with arguments. Wait for command to complete. If the return " "code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" @@ -1570,15 +1578,15 @@ msgid "" "to start the process it will propagate the exception that was raised." msgstr "" -#: ../../library/subprocess.rst:1235 +#: ../../library/subprocess.rst:1240 msgid "run(..., check=True)" msgstr "run(..., check=True)" -#: ../../library/subprocess.rst:1268 +#: ../../library/subprocess.rst:1273 msgid "Run command with arguments and return its output." msgstr "" -#: ../../library/subprocess.rst:1270 +#: ../../library/subprocess.rst:1275 msgid "" "If the return code was non-zero it raises a :exc:`CalledProcessError`. The :" "exc:`CalledProcessError` object will have the return code in the :attr:" @@ -1586,15 +1594,15 @@ msgid "" "`~CalledProcessError.output` attribute." msgstr "" -#: ../../library/subprocess.rst:1275 +#: ../../library/subprocess.rst:1280 msgid "This is equivalent to::" msgstr "這等同於: ::" -#: ../../library/subprocess.rst:1277 +#: ../../library/subprocess.rst:1282 msgid "run(..., check=True, stdout=PIPE).stdout" msgstr "run(..., check=True, stdout=PIPE).stdout" -#: ../../library/subprocess.rst:1279 +#: ../../library/subprocess.rst:1284 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is largely the same as that of :func:`run` - most arguments are " @@ -1604,27 +1612,27 @@ msgid "" "using the parent's standard input file handle." msgstr "" -#: ../../library/subprocess.rst:1286 +#: ../../library/subprocess.rst:1291 msgid "" "By default, this function will return the data as encoded bytes. The actual " "encoding of the output data may depend on the command being invoked, so the " "decoding to text will often need to be handled at the application level." msgstr "" -#: ../../library/subprocess.rst:1290 +#: ../../library/subprocess.rst:1295 msgid "" "This behaviour may be overridden by setting *text*, *encoding*, *errors*, or " "*universal_newlines* to ``True`` as described in :ref:`frequently-used-" "arguments` and :func:`run`." msgstr "" -#: ../../library/subprocess.rst:1294 +#: ../../library/subprocess.rst:1299 msgid "" "To also capture standard error in the result, use ``stderr=subprocess." "STDOUT``::" msgstr "" -#: ../../library/subprocess.rst:1297 +#: ../../library/subprocess.rst:1302 msgid "" ">>> subprocess.check_output(\n" "... \"ls non_existent_file; exit 0\",\n" @@ -1638,32 +1646,32 @@ msgstr "" "... shell=True)\n" "'ls: non_existent_file: No such file or directory\\n'" -#: ../../library/subprocess.rst:1308 +#: ../../library/subprocess.rst:1313 msgid "Support for the *input* keyword argument was added." msgstr "新增 *input* 關鍵字引數的支援。" -#: ../../library/subprocess.rst:1311 +#: ../../library/subprocess.rst:1316 msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "新增 *encoding* 與 *errors*。細節請見 :func:`run`。" -#: ../../library/subprocess.rst:1329 +#: ../../library/subprocess.rst:1334 msgid "Replacing Older Functions with the :mod:`subprocess` Module" msgstr "" -#: ../../library/subprocess.rst:1331 +#: ../../library/subprocess.rst:1336 msgid "" "In this section, \"a becomes b\" means that b can be used as a replacement " "for a." msgstr "" -#: ../../library/subprocess.rst:1335 +#: ../../library/subprocess.rst:1340 msgid "" "All \"a\" functions in this section fail (more or less) silently if the " "executed program cannot be found; the \"b\" replacements raise :exc:" "`OSError` instead." msgstr "" -#: ../../library/subprocess.rst:1339 +#: ../../library/subprocess.rst:1344 msgid "" "In addition, the replacements using :func:`check_output` will fail with a :" "exc:`CalledProcessError` if the requested operation produces a non-zero " @@ -1671,38 +1679,38 @@ msgid "" "output` attribute of the raised exception." msgstr "" -#: ../../library/subprocess.rst:1344 +#: ../../library/subprocess.rst:1349 msgid "" "In the following examples, we assume that the relevant functions have " "already been imported from the :mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1349 +#: ../../library/subprocess.rst:1354 msgid "Replacing :program:`/bin/sh` shell command substitution" msgstr "" -#: ../../library/subprocess.rst:1351 +#: ../../library/subprocess.rst:1356 msgid "output=$(mycmd myarg)" msgstr "output=$(mycmd myarg)" -#: ../../library/subprocess.rst:1355 ../../library/subprocess.rst:1366 -#: ../../library/subprocess.rst:1383 +#: ../../library/subprocess.rst:1360 ../../library/subprocess.rst:1371 +#: ../../library/subprocess.rst:1388 msgid "becomes::" msgstr "變成: ::" -#: ../../library/subprocess.rst:1357 +#: ../../library/subprocess.rst:1362 msgid "output = check_output([\"mycmd\", \"myarg\"])" msgstr "output = check_output([\"mycmd\", \"myarg\"])" -#: ../../library/subprocess.rst:1360 +#: ../../library/subprocess.rst:1365 msgid "Replacing shell pipeline" msgstr "" -#: ../../library/subprocess.rst:1362 ../../library/subprocess.rst:1379 +#: ../../library/subprocess.rst:1367 ../../library/subprocess.rst:1384 msgid "output=$(dmesg | grep hda)" msgstr "output=$(dmesg | grep hda)" -#: ../../library/subprocess.rst:1368 +#: ../../library/subprocess.rst:1373 msgid "" "p1 = Popen([\"dmesg\"], stdout=PIPE)\n" "p2 = Popen([\"grep\", \"hda\"], stdin=p1.stdout, stdout=PIPE)\n" @@ -1710,27 +1718,27 @@ msgid "" "output = p2.communicate()[0]" msgstr "" -#: ../../library/subprocess.rst:1373 +#: ../../library/subprocess.rst:1378 msgid "" "The ``p1.stdout.close()`` call after starting the p2 is important in order " "for p1 to receive a SIGPIPE if p2 exits before p1." msgstr "" -#: ../../library/subprocess.rst:1376 +#: ../../library/subprocess.rst:1381 msgid "" "Alternatively, for trusted input, the shell's own pipeline support may still " "be used directly:" msgstr "" -#: ../../library/subprocess.rst:1385 +#: ../../library/subprocess.rst:1390 msgid "output = check_output(\"dmesg | grep hda\", shell=True)" msgstr "output = check_output(\"dmesg | grep hda\", shell=True)" -#: ../../library/subprocess.rst:1389 +#: ../../library/subprocess.rst:1394 msgid "Replacing :func:`os.system`" msgstr "取代 :func:`os.system`" -#: ../../library/subprocess.rst:1393 +#: ../../library/subprocess.rst:1398 msgid "" "sts = os.system(\"mycmd\" + \" myarg\")\n" "# becomes\n" @@ -1740,32 +1748,32 @@ msgstr "" "# 變成\n" "retcode = call(\"mycmd\" + \" myarg\", shell=True)" -#: ../../library/subprocess.rst:1397 +#: ../../library/subprocess.rst:1402 msgid "Notes:" msgstr "註解:" -#: ../../library/subprocess.rst:1399 +#: ../../library/subprocess.rst:1404 msgid "Calling the program through the shell is usually not required." msgstr "" -#: ../../library/subprocess.rst:1400 +#: ../../library/subprocess.rst:1405 msgid "" "The :func:`call` return value is encoded differently to that of :func:`os." "system`." msgstr "" -#: ../../library/subprocess.rst:1403 +#: ../../library/subprocess.rst:1408 msgid "" "The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " "command is running, but the caller must do this separately when using the :" "mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1407 +#: ../../library/subprocess.rst:1412 msgid "A more realistic example would look like this::" msgstr "" -#: ../../library/subprocess.rst:1409 +#: ../../library/subprocess.rst:1414 msgid "" "try:\n" " retcode = call(\"mycmd\" + \" myarg\", shell=True)\n" @@ -1787,15 +1795,15 @@ msgstr "" "except OSError as e:\n" " print(\"Execution failed:\", e, file=sys.stderr)" -#: ../../library/subprocess.rst:1420 +#: ../../library/subprocess.rst:1425 msgid "Replacing the :func:`os.spawn ` family" msgstr "" -#: ../../library/subprocess.rst:1422 +#: ../../library/subprocess.rst:1427 msgid "P_NOWAIT example::" msgstr "P_NOWAIT 範例: ::" -#: ../../library/subprocess.rst:1424 +#: ../../library/subprocess.rst:1429 msgid "" "pid = os.spawnlp(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n" "==>\n" @@ -1805,11 +1813,11 @@ msgstr "" "==>\n" "pid = Popen([\"/bin/mycmd\", \"myarg\"]).pid" -#: ../../library/subprocess.rst:1428 +#: ../../library/subprocess.rst:1433 msgid "P_WAIT example::" msgstr "P_WAIT 範例: ::" -#: ../../library/subprocess.rst:1430 +#: ../../library/subprocess.rst:1435 msgid "" "retcode = os.spawnlp(os.P_WAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n" "==>\n" @@ -1819,11 +1827,11 @@ msgstr "" "==>\n" "retcode = call([\"/bin/mycmd\", \"myarg\"])" -#: ../../library/subprocess.rst:1434 +#: ../../library/subprocess.rst:1439 msgid "Vector example::" msgstr "向量範例: ::" -#: ../../library/subprocess.rst:1436 +#: ../../library/subprocess.rst:1441 msgid "" "os.spawnvp(os.P_NOWAIT, path, args)\n" "==>\n" @@ -1833,11 +1841,11 @@ msgstr "" "==>\n" "Popen([path] + args[1:])" -#: ../../library/subprocess.rst:1440 +#: ../../library/subprocess.rst:1445 msgid "Environment example::" msgstr "環境範例: ::" -#: ../../library/subprocess.rst:1442 +#: ../../library/subprocess.rst:1447 msgid "" "os.spawnlpe(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\", env)\n" "==>\n" @@ -1847,15 +1855,15 @@ msgstr "" "==>\n" "Popen([\"/bin/mycmd\", \"myarg\"], env={\"PATH\": \"/usr/bin\"})" -#: ../../library/subprocess.rst:1449 +#: ../../library/subprocess.rst:1454 msgid "Replacing :func:`os.popen`" msgstr "取代 :func:`os.popen`" -#: ../../library/subprocess.rst:1451 +#: ../../library/subprocess.rst:1456 msgid "Return code handling translates as follows::" msgstr "" -#: ../../library/subprocess.rst:1453 +#: ../../library/subprocess.rst:1458 msgid "" "pipe = os.popen(cmd, 'w')\n" "...\n" @@ -1881,11 +1889,11 @@ msgstr "" "if process.wait() != 0:\n" " print(\"There were some errors\")" -#: ../../library/subprocess.rst:1467 +#: ../../library/subprocess.rst:1472 msgid "Legacy Shell Invocation Functions" msgstr "" -#: ../../library/subprocess.rst:1469 +#: ../../library/subprocess.rst:1474 msgid "" "This module also provides the following legacy functions from the 2.x " "``commands`` module. These operations implicitly invoke the system shell and " @@ -1893,24 +1901,24 @@ msgid "" "handling consistency are valid for these functions." msgstr "" -#: ../../library/subprocess.rst:1476 +#: ../../library/subprocess.rst:1481 msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1478 +#: ../../library/subprocess.rst:1483 msgid "" "Execute the string *cmd* in a shell with :func:`check_output` and return a 2-" "tuple ``(exitcode, output)``. *encoding* and *errors* are used to decode " "output; see the notes on :ref:`frequently-used-arguments` for more details." msgstr "" -#: ../../library/subprocess.rst:1483 +#: ../../library/subprocess.rst:1488 msgid "" "A trailing newline is stripped from the output. The exit code for the " "command can be interpreted as the return code of subprocess. Example::" msgstr "" -#: ../../library/subprocess.rst:1487 +#: ../../library/subprocess.rst:1492 msgid "" ">>> subprocess.getstatusoutput('ls /bin/ls')\n" "(0, '/bin/ls')\n" @@ -1930,28 +1938,28 @@ msgstr "" ">>> subprocess.getstatusoutput('/bin/kill $$')\n" "(-15, '')" -#: ../../library/subprocess.rst:1498 +#: ../../library/subprocess.rst:1503 msgid "Windows support was added." msgstr "新增對 Windows 的支援。" -#: ../../library/subprocess.rst:1501 +#: ../../library/subprocess.rst:1506 msgid "" "The function now returns (exitcode, output) instead of (status, output) as " "it did in Python 3.3.3 and earlier. exitcode has the same value as :attr:" "`~Popen.returncode`." msgstr "" -#: ../../library/subprocess.rst:1510 +#: ../../library/subprocess.rst:1515 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1512 +#: ../../library/subprocess.rst:1517 msgid "" "Like :func:`getstatusoutput`, except the exit code is ignored and the return " "value is a string containing the command's output. Example::" msgstr "" -#: ../../library/subprocess.rst:1515 +#: ../../library/subprocess.rst:1520 msgid "" ">>> subprocess.getoutput('ls /bin/ls')\n" "'/bin/ls'" @@ -1959,26 +1967,26 @@ msgstr "" ">>> subprocess.getoutput('ls /bin/ls')\n" "'/bin/ls'" -#: ../../library/subprocess.rst:1520 +#: ../../library/subprocess.rst:1525 msgid "Windows support added" msgstr "新增對 Windows 的支援" -#: ../../library/subprocess.rst:1528 +#: ../../library/subprocess.rst:1533 msgid "Notes" msgstr "註解" -#: ../../library/subprocess.rst:1533 +#: ../../library/subprocess.rst:1538 msgid "Timeout Behavior" msgstr "" -#: ../../library/subprocess.rst:1535 +#: ../../library/subprocess.rst:1540 msgid "" "When using the ``timeout`` parameter in functions like :func:`run`, :meth:" "`Popen.wait`, or :meth:`Popen.communicate`, users should be aware of the " "following behaviors:" msgstr "" -#: ../../library/subprocess.rst:1539 +#: ../../library/subprocess.rst:1544 msgid "" "**Process Creation Delay**: The initial process creation itself cannot be " "interrupted on many platform APIs. This means that even when specifying a " @@ -1986,7 +1994,7 @@ msgid "" "after however long process creation takes." msgstr "" -#: ../../library/subprocess.rst:1544 +#: ../../library/subprocess.rst:1549 msgid "" "**Extremely Small Timeout Values**: Setting very small timeout values (such " "as a few milliseconds) may result in almost immediate :exc:`TimeoutExpired` " @@ -1994,42 +2002,42 @@ msgid "" "time." msgstr "" -#: ../../library/subprocess.rst:1551 +#: ../../library/subprocess.rst:1556 msgid "Converting an argument sequence to a string on Windows" msgstr "" -#: ../../library/subprocess.rst:1553 +#: ../../library/subprocess.rst:1558 msgid "" "On Windows, an *args* sequence is converted to a string that can be parsed " "using the following rules (which correspond to the rules used by the MS C " "runtime):" msgstr "" -#: ../../library/subprocess.rst:1557 +#: ../../library/subprocess.rst:1562 msgid "" "Arguments are delimited by white space, which is either a space or a tab." msgstr "" -#: ../../library/subprocess.rst:1560 +#: ../../library/subprocess.rst:1565 msgid "" "A string surrounded by double quotation marks is interpreted as a single " "argument, regardless of white space contained within. A quoted string can " "be embedded in an argument." msgstr "" -#: ../../library/subprocess.rst:1565 +#: ../../library/subprocess.rst:1570 msgid "" "A double quotation mark preceded by a backslash is interpreted as a literal " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1568 +#: ../../library/subprocess.rst:1573 msgid "" "Backslashes are interpreted literally, unless they immediately precede a " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1571 +#: ../../library/subprocess.rst:1576 msgid "" "If backslashes immediately precede a double quotation mark, every pair of " "backslashes is interpreted as a literal backslash. If the number of " @@ -2037,19 +2045,19 @@ msgid "" "mark as described in rule 3." msgstr "" -#: ../../library/subprocess.rst:1580 +#: ../../library/subprocess.rst:1585 msgid ":mod:`shlex`" msgstr ":mod:`shlex`" -#: ../../library/subprocess.rst:1581 +#: ../../library/subprocess.rst:1586 msgid "Module which provides function to parse and escape command lines." msgstr "" -#: ../../library/subprocess.rst:1587 +#: ../../library/subprocess.rst:1592 msgid "Disable use of ``posix_spawn()``" msgstr "停用 ``posix_spawn()``" -#: ../../library/subprocess.rst:1589 +#: ../../library/subprocess.rst:1594 msgid "" "On Linux, :mod:`subprocess` defaults to using the ``vfork()`` system call " "internally when it is safe to do so rather than ``fork()``. This greatly " @@ -2058,11 +2066,11 @@ msgstr "" "在 Linux 上,:mod:`subprocess` 在安全的情況下預設會在內部使用 ``vfork()`` 系" "統呼叫,而不是 ``fork()``,這顯著地提高了性能。" -#: ../../library/subprocess.rst:1595 +#: ../../library/subprocess.rst:1600 msgid "subprocess._USE_POSIX_SPAWN = False # See CPython issue gh-NNNNNN." msgstr "subprocess._USE_POSIX_SPAWN = False # 見 CPython 問題 gh-NNNNNN。" -#: ../../library/subprocess.rst:1597 +#: ../../library/subprocess.rst:1602 msgid "" "It is safe to set this to false on any Python version. It will have no " "effect on older or newer versions where unsupported. Do not assume the " @@ -2073,7 +2081,7 @@ msgstr "" "沒有支援的新版本沒有影響。不要假設屬性可供讀取。儘管它的名稱是這樣,真實值並" "不表示將使用相應的函式,而只是表示可能會使用。" -#: ../../library/subprocess.rst:1602 +#: ../../library/subprocess.rst:1607 msgid "" "Please file issues any time you have to use these private knobs with a way " "to reproduce the issue you were seeing. Link to that issue from a comment in " @@ -2082,7 +2090,7 @@ msgstr "" "每當你需要使用這些私有開關以重現你所看到的問題時,請隨時提出問題 (file " "issues)。從程式碼中的註解連結到該問題。" -#: ../../library/subprocess.rst:1606 +#: ../../library/subprocess.rst:1611 msgid "``_USE_POSIX_SPAWN``" msgstr "``_USE_POSIX_SPAWN``" From 2013b2a7c13345b98f036cfa7d88780e908cdb3c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 3 Dec 2025 00:16:13 +0000 Subject: [PATCH 11/13] sync with cpython 206f1966 --- howto/free-threading-python.po | 178 +++++------- library/select.po | 501 ++++++++++++++++----------------- 2 files changed, 322 insertions(+), 357 deletions(-) diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index 3218edc5d9..74260cfd88 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-07 00:14+0000\n" +"POT-Creation-Date: 2025-12-03 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,55 +34,53 @@ msgstr "" #: ../../howto/free-threading-python.rst:14 msgid "" -"The free-threaded mode is working and continues to be improved, but there is " -"some additional overhead in single-threaded workloads compared to the " -"regular build. Additionally, third-party packages, in particular ones with " -"an :term:`extension module`, may not be ready for use in a free-threaded " -"build, and will re-enable the :term:`GIL`." +"Some third-party packages, in particular ones with an :term:`extension " +"module`, may not be ready for use in a free-threaded build, and will re-" +"enable the :term:`GIL`." msgstr "" -#: ../../howto/free-threading-python.rst:20 +#: ../../howto/free-threading-python.rst:18 msgid "" "This document describes the implications of free threading for Python code. " "See :ref:`freethreading-extensions-howto` for information on how to write C " "extensions that support the free-threaded build." msgstr "" -#: ../../howto/free-threading-python.rst:26 +#: ../../howto/free-threading-python.rst:24 msgid "" ":pep:`703` – Making the Global Interpreter Lock Optional in CPython for an " "overall description of free-threaded Python." msgstr "" -#: ../../howto/free-threading-python.rst:31 +#: ../../howto/free-threading-python.rst:29 msgid "Installation" msgstr "安裝" -#: ../../howto/free-threading-python.rst:33 +#: ../../howto/free-threading-python.rst:31 msgid "" "Starting with Python 3.13, the official macOS and Windows installers " "optionally support installing free-threaded Python binaries. The installers " "are available at https://www.python.org/downloads/." msgstr "" -#: ../../howto/free-threading-python.rst:37 +#: ../../howto/free-threading-python.rst:35 msgid "" "For information on other platforms, see the `Installing a Free-Threaded " "Python `_, a " "community-maintained installation guide for installing free-threaded Python." msgstr "" -#: ../../howto/free-threading-python.rst:41 +#: ../../howto/free-threading-python.rst:39 msgid "" "When building CPython from source, the :option:`--disable-gil` configure " "option should be used to build a free-threaded Python interpreter." msgstr "" -#: ../../howto/free-threading-python.rst:46 +#: ../../howto/free-threading-python.rst:44 msgid "Identifying free-threaded Python" msgstr "" -#: ../../howto/free-threading-python.rst:48 +#: ../../howto/free-threading-python.rst:46 msgid "" "To check if the current interpreter supports free-threading, :option:`python " "-VV <-V>` and :data:`sys.version` contain \"free-threading build\". The new :" @@ -90,7 +88,7 @@ msgid "" "actually disabled in the running process." msgstr "" -#: ../../howto/free-threading-python.rst:53 +#: ../../howto/free-threading-python.rst:51 msgid "" "The ``sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` configuration variable " "can be used to determine whether the build supports free threading. If the " @@ -98,43 +96,43 @@ msgid "" "the recommended mechanism for decisions related to the build configuration." msgstr "" -#: ../../howto/free-threading-python.rst:60 +#: ../../howto/free-threading-python.rst:58 msgid "The global interpreter lock in free-threaded Python" msgstr "" -#: ../../howto/free-threading-python.rst:62 +#: ../../howto/free-threading-python.rst:60 msgid "" "Free-threaded builds of CPython support optionally running with the GIL " "enabled at runtime using the environment variable :envvar:`PYTHON_GIL` or " "the command-line option :option:`-X gil`." msgstr "" -#: ../../howto/free-threading-python.rst:66 +#: ../../howto/free-threading-python.rst:64 msgid "" "The GIL may also automatically be enabled when importing a C-API extension " "module that is not explicitly marked as supporting free threading. A " "warning will be printed in this case." msgstr "" -#: ../../howto/free-threading-python.rst:70 +#: ../../howto/free-threading-python.rst:68 msgid "" "In addition to individual package documentation, the following websites " "track the status of popular packages support for free threading:" msgstr "" -#: ../../howto/free-threading-python.rst:73 +#: ../../howto/free-threading-python.rst:71 msgid "https://py-free-threading.github.io/tracking/" msgstr "https://py-free-threading.github.io/tracking/" -#: ../../howto/free-threading-python.rst:74 +#: ../../howto/free-threading-python.rst:72 msgid "https://hugovk.github.io/free-threaded-wheels/" msgstr "https://hugovk.github.io/free-threaded-wheels/" -#: ../../howto/free-threading-python.rst:78 +#: ../../howto/free-threading-python.rst:76 msgid "Thread safety" msgstr "執行緒安全" -#: ../../howto/free-threading-python.rst:80 +#: ../../howto/free-threading-python.rst:78 msgid "" "The free-threaded build of CPython aims to provide similar thread-safety " "behavior at the Python level to the default GIL-enabled build. Built-in " @@ -146,140 +144,98 @@ msgid "" "current or future behavior." msgstr "" -#: ../../howto/free-threading-python.rst:91 +#: ../../howto/free-threading-python.rst:89 msgid "" "It's recommended to use the :class:`threading.Lock` or other synchronization " "primitives instead of relying on the internal locks of built-in types, when " "possible." msgstr "" -#: ../../howto/free-threading-python.rst:97 +#: ../../howto/free-threading-python.rst:95 msgid "Known limitations" msgstr "已知限制" -#: ../../howto/free-threading-python.rst:99 +#: ../../howto/free-threading-python.rst:97 msgid "" "This section describes known limitations of the free-threaded CPython build." msgstr "" -#: ../../howto/free-threading-python.rst:102 +#: ../../howto/free-threading-python.rst:100 msgid "Immortalization" msgstr "不滅化 (Immortalization)" -#: ../../howto/free-threading-python.rst:104 +#: ../../howto/free-threading-python.rst:102 msgid "" -"The free-threaded build of the 3.13 release makes some objects :term:" -"`immortal`. Immortal objects are not deallocated and have reference counts " -"that are never modified. This is done to avoid reference count contention " -"that would prevent efficient multi-threaded scaling." +"In the free-threaded build, some objects are :term:`immortal`. Immortal " +"objects are not deallocated and have reference counts that are never " +"modified. This is done to avoid reference count contention that would " +"prevent efficient multi-threaded scaling." msgstr "" -#: ../../howto/free-threading-python.rst:109 -msgid "" -"An object will be made immortal when a new thread is started for the first " -"time after the main thread is running. The following objects are " -"immortalized:" +#: ../../howto/free-threading-python.rst:107 +msgid "As of the 3.14 release, immortalization is limited to:" msgstr "" -#: ../../howto/free-threading-python.rst:112 -msgid "" -":ref:`function ` objects declared at the module level" -msgstr "在模組層級宣告的\\ :ref:`函式 `\\ 物件" - -#: ../../howto/free-threading-python.rst:113 -msgid ":ref:`method ` descriptors" -msgstr ":ref:`方法 `\\ 描述器" - -#: ../../howto/free-threading-python.rst:114 -msgid ":ref:`code ` objects" -msgstr ":ref:`程式碼 `\\ 物件" - -#: ../../howto/free-threading-python.rst:115 -msgid ":term:`module` objects and their dictionaries" -msgstr ":term:`模組 `\\ 物件及其字典" - -#: ../../howto/free-threading-python.rst:116 -msgid ":ref:`classes ` (type objects)" -msgstr ":ref:`類別 `\\ (型別物件)" - -#: ../../howto/free-threading-python.rst:118 +#: ../../howto/free-threading-python.rst:109 msgid "" -"Because immortal objects are never deallocated, applications that create " -"many objects of these types may see increased memory usage under Python " -"3.13. This has been addressed in the 3.14 release, where the aforementioned " -"objects use deferred reference counting to avoid reference count contention." +"Code constants: numeric literals, string literals, and tuple literals " +"composed of other constants." msgstr "" -#: ../../howto/free-threading-python.rst:123 -msgid "" -"Additionally, numeric and string literals in the code as well as strings " -"returned by :func:`sys.intern` are also immortalized in the 3.13 release. " -"This behavior is part of the 3.14 release as well and it is expected to " -"remain in future free-threaded builds." +#: ../../howto/free-threading-python.rst:111 +msgid "Strings interned by :func:`sys.intern`." msgstr "" -#: ../../howto/free-threading-python.rst:130 +#: ../../howto/free-threading-python.rst:115 msgid "Frame objects" msgstr "" -#: ../../howto/free-threading-python.rst:132 +#: ../../howto/free-threading-python.rst:117 msgid "" -"It is not safe to access :ref:`frame ` objects from other " -"threads and doing so may cause your program to crash . This means that :" -"func:`sys._current_frames` is generally not safe to use in a free-threaded " -"build. Functions like :func:`inspect.currentframe` and :func:`sys." -"_getframe` are generally safe as long as the resulting frame object is not " -"passed to another thread." +"It is not safe to access :attr:`frame.f_locals` from a :ref:`frame ` object if that frame is currently executing in another thread, and " +"doing so may crash the interpreter." msgstr "" -#: ../../howto/free-threading-python.rst:140 +#: ../../howto/free-threading-python.rst:123 msgid "Iterators" msgstr "疊代器" -#: ../../howto/free-threading-python.rst:142 +#: ../../howto/free-threading-python.rst:125 msgid "" -"Sharing the same iterator object between multiple threads is generally not " -"safe and threads may see duplicate or missing elements when iterating or " -"crash the interpreter." +"It is generally not thread-safe to access the same iterator object from " +"multiple threads concurrently, and threads may see duplicate or missing " +"elements." msgstr "" -#: ../../howto/free-threading-python.rst:148 +#: ../../howto/free-threading-python.rst:131 msgid "Single-threaded performance" msgstr "單執行緒效能" -#: ../../howto/free-threading-python.rst:150 +#: ../../howto/free-threading-python.rst:133 msgid "" "The free-threaded build has additional overhead when executing Python code " -"compared to the default GIL-enabled build. In 3.13, this overhead is about " -"40% on the `pyperformance `_ suite. " -"Programs that spend most of their time in C extensions or I/O will see less " -"of an impact. The largest impact is because the specializing adaptive " -"interpreter (:pep:`659`) is disabled in the free-threaded build." +"compared to the default GIL-enabled build. The amount of overhead depends " +"on the workload and hardware. On the pyperformance benchmark suite, the " +"average overhead ranges from about 1% on macOS aarch64 to 8% on x86-64 Linux " +"systems." msgstr "" -#: ../../howto/free-threading-python.rst:157 -msgid "" -"The specializing adaptive interpreter has been re-enabled in a thread-safe " -"way in the 3.14 release. The performance penalty on single-threaded code in " -"free-threaded mode is now roughly 5-10%, depending on the platform and C " -"compiler used." -msgstr "" - -#: ../../howto/free-threading-python.rst:164 +#: ../../howto/free-threading-python.rst:141 msgid "Behavioral changes" msgstr "" -#: ../../howto/free-threading-python.rst:166 +#: ../../howto/free-threading-python.rst:143 msgid "" "This section describes CPython behavioural changes with the free-threaded " "build." msgstr "" -#: ../../howto/free-threading-python.rst:171 +#: ../../howto/free-threading-python.rst:148 msgid "Context variables" msgstr "" -#: ../../howto/free-threading-python.rst:173 +#: ../../howto/free-threading-python.rst:150 msgid "" "In the free-threaded build, the flag :data:`~sys.flags." "thread_inherit_context` is set to true by default which causes threads " @@ -289,11 +245,11 @@ msgid "" "start with an empty :class:`~contextvars.Context()`." msgstr "" -#: ../../howto/free-threading-python.rst:183 +#: ../../howto/free-threading-python.rst:160 msgid "Warning filters" msgstr "" -#: ../../howto/free-threading-python.rst:185 +#: ../../howto/free-threading-python.rst:162 msgid "" "In the free-threaded build, the flag :data:`~sys.flags." "context_aware_warnings` is set to true by default. In the default GIL-" @@ -303,3 +259,19 @@ msgid "" "catch_warnings` modifies the global filters list, which is not thread-safe. " "See the :mod:`warnings` module for more details." msgstr "" + +#~ msgid "" +#~ ":ref:`function ` objects declared at the module level" +#~ msgstr "在模組層級宣告的\\ :ref:`函式 `\\ 物件" + +#~ msgid ":ref:`method ` descriptors" +#~ msgstr ":ref:`方法 `\\ 描述器" + +#~ msgid ":ref:`code ` objects" +#~ msgstr ":ref:`程式碼 `\\ 物件" + +#~ msgid ":term:`module` objects and their dictionaries" +#~ msgstr ":term:`模組 `\\ 物件及其字典" + +#~ msgid ":ref:`classes ` (type objects)" +#~ msgstr ":ref:`類別 `\\ (型別物件)" diff --git a/library/select.po b/library/select.po index b2d6032182..99c2c83ab2 100644 --- a/library/select.po +++ b/library/select.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-12-03 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,11 +25,11 @@ msgstr ":mod:`!select` --- 等待 I/O 完成" msgid "" "This module provides access to the :c:func:`!select` and :c:func:`!poll` " "functions available in most operating systems, :c:func:`!devpoll` available " -"on Solaris and derivatives, :c:func:`!epoll` available on Linux 2.5+ " -"and :c:func:`!kqueue` available on most BSD. Note that on Windows, it only " -"works for sockets; on other operating systems, it also works for other file " -"types (in particular, on Unix, it works on pipes). It cannot be used on " -"regular files to determine whether a file has grown since it was last read." +"on Solaris and derivatives, :c:func:`!epoll` available on Linux 2.5+ and :c:" +"func:`!kqueue` available on most BSD. Note that on Windows, it only works " +"for sockets; on other operating systems, it also works for other file types " +"(in particular, on Unix, it works on pipes). It cannot be used on regular " +"files to determine whether a file has grown since it was last read." msgstr "" #: ../../library/select.rst:20 @@ -40,7 +40,7 @@ msgid "" "precise control over the OS-level primitives used." msgstr "" -#: ../../library/select.rst:177 ../../includes/wasm-notavail.rst:3 +#: ../../library/select.rst:178 ../../includes/wasm-notavail.rst:3 msgid "Availability" msgstr "可用性" @@ -74,10 +74,9 @@ msgstr "" #: ../../library/select.rst:44 msgid "" ":c:func:`!devpoll` objects are linked to the number of file descriptors " -"allowed at the time of instantiation. If your program reduces this " -"value, :c:func:`!devpoll` will fail. If your program increases this " -"value, :c:func:`!devpoll` may return an incomplete list of active file " -"descriptors." +"allowed at the time of instantiation. If your program reduces this value, :c:" +"func:`!devpoll` will fail. If your program increases this value, :c:func:`!" +"devpoll` may return an incomplete list of active file descriptors." msgstr "" #: ../../library/select.rst:50 ../../library/select.rst:79 @@ -118,9 +117,9 @@ msgstr "" #: ../../library/select.rst:75 msgid "" -"``epoll`` objects support the context management protocol: when used in " -"a :keyword:`with` statement, the new file descriptor is automatically closed " -"at the end of the block." +"``epoll`` objects support the context management protocol: when used in a :" +"keyword:`with` statement, the new file descriptor is automatically closed at " +"the end of the block." msgstr "" #: ../../library/select.rst:81 @@ -149,16 +148,14 @@ msgstr "" #: ../../library/select.rst:103 msgid "" -"(Only supported on BSD.) Returns a kernel queue object; see " -"section :ref:`kqueue-objects` below for the methods supported by kqueue " -"objects." +"(Only supported on BSD.) Returns a kernel queue object; see section :ref:" +"`kqueue-objects` below for the methods supported by kqueue objects." msgstr "" #: ../../library/select.rst:114 msgid "" -"(Only supported on BSD.) Returns a kernel event object; see " -"section :ref:`kevent-objects` below for the methods supported by kevent " -"objects." +"(Only supported on BSD.) Returns a kernel event object; see section :ref:" +"`kevent-objects` below for the methods supported by kevent objects." msgstr "" #: ../../library/select.rst:120 @@ -188,29 +185,29 @@ msgid "" "Empty iterables are allowed, but acceptance of three empty iterables is " "platform-dependent. (It is known to work on Unix but not on Windows.) The " "optional *timeout* argument specifies a time-out as a floating-point number " -"in seconds. When the *timeout* argument is omitted the function blocks " -"until at least one file descriptor is ready. A time-out value of zero " -"specifies a poll and never blocks." +"in seconds. When the *timeout* argument is omitted or ``None``, the function " +"blocks until at least one file descriptor is ready. A time-out value of " +"zero specifies a poll and never blocks." msgstr "" -#: ../../library/select.rst:137 +#: ../../library/select.rst:138 msgid "" "The return value is a triple of lists of objects that are ready: subsets of " "the first three arguments. When the time-out is reached without a file " "descriptor becoming ready, three empty lists are returned." msgstr "" -#: ../../library/select.rst:145 +#: ../../library/select.rst:146 msgid "" "Among the acceptable object types in the iterables are Python :term:`file " -"objects ` (e.g. ``sys.stdin``, or objects returned " -"by :func:`open` or :func:`os.popen`), socket objects returned " -"by :func:`socket.socket`. You may also define a :dfn:`wrapper` class " -"yourself, as long as it has an appropriate :meth:`~io.IOBase.fileno` method " -"(that really returns a file descriptor, not just a random integer)." +"objects ` (e.g. ``sys.stdin``, or objects returned by :func:" +"`open` or :func:`os.popen`), socket objects returned by :func:`socket." +"socket`. You may also define a :dfn:`wrapper` class yourself, as long as it " +"has an appropriate :meth:`~io.IOBase.fileno` method (that really returns a " +"file descriptor, not just a random integer)." msgstr "" -#: ../../library/select.rst:156 +#: ../../library/select.rst:157 msgid "" "File objects on Windows are not acceptable, but sockets are. On Windows, " "the underlying :c:func:`!select` function is provided by the WinSock " @@ -218,318 +215,316 @@ msgid "" "WinSock." msgstr "" -#: ../../library/select.rst:161 ../../library/select.rst:267 -#: ../../library/select.rst:373 ../../library/select.rst:461 -#: ../../library/select.rst:502 +#: ../../library/select.rst:162 ../../library/select.rst:268 +#: ../../library/select.rst:374 ../../library/select.rst:462 +#: ../../library/select.rst:503 msgid "" "The function is now retried with a recomputed timeout when interrupted by a " "signal, except if the signal handler raises an exception (see :pep:`475` for " "the rationale), instead of raising :exc:`InterruptedError`." msgstr "" -#: ../../library/select.rst:170 +#: ../../library/select.rst:171 msgid "" "The minimum number of bytes which can be written without blocking to a pipe " -"when the pipe has been reported as ready for writing " -"by :func:`~select.select`, :func:`!poll` or another interface in this " -"module. This doesn't apply to other kind of file-like objects such as " -"sockets." +"when the pipe has been reported as ready for writing by :func:`~select." +"select`, :func:`!poll` or another interface in this module. This doesn't " +"apply to other kind of file-like objects such as sockets." msgstr "" -#: ../../library/select.rst:175 +#: ../../library/select.rst:176 msgid "This value is guaranteed by POSIX to be at least 512." msgstr "" -#: ../../library/select.rst:185 +#: ../../library/select.rst:186 msgid "``/dev/poll`` Polling Objects" msgstr "" -#: ../../library/select.rst:187 +#: ../../library/select.rst:188 msgid "" "Solaris and derivatives have ``/dev/poll``. While :c:func:`!select` is *O*\\ " "(*highest file descriptor*) and :c:func:`!poll` is *O*\\ (*number of file " "descriptors*), ``/dev/poll`` is *O*\\ (*active file descriptors*)." msgstr "" -#: ../../library/select.rst:191 +#: ../../library/select.rst:192 msgid "" "``/dev/poll`` behaviour is very close to the standard :c:func:`!poll` object." msgstr "" -#: ../../library/select.rst:197 +#: ../../library/select.rst:198 msgid "Close the file descriptor of the polling object." msgstr "" -#: ../../library/select.rst:204 +#: ../../library/select.rst:205 msgid "``True`` if the polling object is closed." msgstr "" -#: ../../library/select.rst:211 +#: ../../library/select.rst:212 msgid "Return the file descriptor number of the polling object." msgstr "" -#: ../../library/select.rst:218 ../../library/select.rst:396 +#: ../../library/select.rst:219 ../../library/select.rst:397 msgid "" -"Register a file descriptor with the polling object. Future calls to " -"the :meth:`poll` method will then check whether the file descriptor has any " -"pending I/O events. *fd* can be either an integer, or an object with " -"a :meth:`~io.IOBase.fileno` method that returns an integer. File objects " +"Register a file descriptor with the polling object. Future calls to the :" +"meth:`poll` method will then check whether the file descriptor has any " +"pending I/O events. *fd* can be either an integer, or an object with a :" +"meth:`~io.IOBase.fileno` method that returns an integer. File objects " "implement :meth:`!fileno`, so they can also be used as the argument." msgstr "" -#: ../../library/select.rst:224 +#: ../../library/select.rst:225 msgid "" "*eventmask* is an optional bitmask describing the type of events you want to " "check for. The constants are the same that with :c:func:`!poll` object. The " -"default value is a combination of the " -"constants :const:`POLLIN`, :const:`POLLPRI`, and :const:`POLLOUT`." +"default value is a combination of the constants :const:`POLLIN`, :const:" +"`POLLPRI`, and :const:`POLLOUT`." msgstr "" -#: ../../library/select.rst:231 +#: ../../library/select.rst:232 msgid "" "Registering a file descriptor that's already registered is not an error, but " "the result is undefined. The appropriate action is to unregister or modify " "it first. This is an important difference compared with :c:func:`!poll`." msgstr "" -#: ../../library/select.rst:239 +#: ../../library/select.rst:240 msgid "" "This method does an :meth:`unregister` followed by a :meth:`register`. It is " "(a bit) more efficient that doing the same explicitly." msgstr "" -#: ../../library/select.rst:246 ../../library/select.rst:440 +#: ../../library/select.rst:247 ../../library/select.rst:441 msgid "" -"Remove a file descriptor being tracked by a polling object. Just like " -"the :meth:`register` method, *fd* can be an integer or an object with " -"a :meth:`~io.IOBase.fileno` method that returns an integer." +"Remove a file descriptor being tracked by a polling object. Just like the :" +"meth:`register` method, *fd* can be an integer or an object with a :meth:" +"`~io.IOBase.fileno` method that returns an integer." msgstr "" -#: ../../library/select.rst:250 +#: ../../library/select.rst:251 msgid "" "Attempting to remove a file descriptor that was never registered is safely " "ignored." msgstr "" -#: ../../library/select.rst:256 +#: ../../library/select.rst:257 msgid "" "Polls the set of registered file descriptors, and returns a possibly empty " "list containing ``(fd, event)`` 2-tuples for the descriptors that have " "events or errors to report. *fd* is the file descriptor, and *event* is a " -"bitmask with bits set for the reported events for that descriptor " -"--- :const:`POLLIN` for waiting input, :const:`POLLOUT` to indicate that the " -"descriptor can be written to, and so forth. An empty list indicates that the " -"call timed out and no file descriptors had any events to report. If " -"*timeout* is given, it specifies the length of time in milliseconds which " -"the system will wait for events before returning. If *timeout* is omitted, " -"-1, or :const:`None`, the call will block until there is an event for this " -"poll object." +"bitmask with bits set for the reported events for that descriptor --- :const:" +"`POLLIN` for waiting input, :const:`POLLOUT` to indicate that the descriptor " +"can be written to, and so forth. An empty list indicates that the call timed " +"out and no file descriptors had any events to report. If *timeout* is given, " +"it specifies the length of time in milliseconds which the system will wait " +"for events before returning. If *timeout* is omitted, -1, or :const:`None`, " +"the call will block until there is an event for this poll object." msgstr "" -#: ../../library/select.rst:277 +#: ../../library/select.rst:278 msgid "Edge and Level Trigger Polling (epoll) Objects" msgstr "" -#: ../../library/select.rst:279 +#: ../../library/select.rst:280 msgid "https://linux.die.net/man/4/epoll" msgstr "https://linux.die.net/man/4/epoll" -#: ../../library/select.rst:281 +#: ../../library/select.rst:282 msgid "*eventmask*" msgstr "" -#: ../../library/select.rst:284 ../../library/select.rst:408 -#: ../../library/select.rst:528 ../../library/select.rst:557 -#: ../../library/select.rst:588 ../../library/select.rst:596 -#: ../../library/select.rst:616 ../../library/select.rst:639 +#: ../../library/select.rst:285 ../../library/select.rst:409 +#: ../../library/select.rst:529 ../../library/select.rst:558 +#: ../../library/select.rst:589 ../../library/select.rst:597 +#: ../../library/select.rst:617 ../../library/select.rst:640 msgid "Constant" msgstr "常數" -#: ../../library/select.rst:284 ../../library/select.rst:408 -#: ../../library/select.rst:528 ../../library/select.rst:557 -#: ../../library/select.rst:588 ../../library/select.rst:596 -#: ../../library/select.rst:616 ../../library/select.rst:639 +#: ../../library/select.rst:285 ../../library/select.rst:409 +#: ../../library/select.rst:529 ../../library/select.rst:558 +#: ../../library/select.rst:589 ../../library/select.rst:597 +#: ../../library/select.rst:617 ../../library/select.rst:640 msgid "Meaning" msgstr "含義" -#: ../../library/select.rst:286 +#: ../../library/select.rst:287 msgid ":const:`EPOLLIN`" msgstr ":const:`EPOLLIN`" -#: ../../library/select.rst:286 +#: ../../library/select.rst:287 msgid "Available for read" msgstr "" -#: ../../library/select.rst:288 +#: ../../library/select.rst:289 msgid ":const:`EPOLLOUT`" msgstr ":const:`EPOLLOUT`" -#: ../../library/select.rst:288 +#: ../../library/select.rst:289 msgid "Available for write" msgstr "" -#: ../../library/select.rst:290 +#: ../../library/select.rst:291 msgid ":const:`EPOLLPRI`" msgstr ":const:`EPOLLPRI`" -#: ../../library/select.rst:290 +#: ../../library/select.rst:291 msgid "Urgent data for read" msgstr "" -#: ../../library/select.rst:292 +#: ../../library/select.rst:293 msgid ":const:`EPOLLERR`" msgstr ":const:`EPOLLERR`" -#: ../../library/select.rst:292 +#: ../../library/select.rst:293 msgid "Error condition happened on the assoc. fd" msgstr "" -#: ../../library/select.rst:294 +#: ../../library/select.rst:295 msgid ":const:`EPOLLHUP`" msgstr ":const:`EPOLLHUP`" -#: ../../library/select.rst:294 +#: ../../library/select.rst:295 msgid "Hang up happened on the assoc. fd" msgstr "" -#: ../../library/select.rst:296 +#: ../../library/select.rst:297 msgid ":const:`EPOLLET`" msgstr ":const:`EPOLLET`" -#: ../../library/select.rst:296 +#: ../../library/select.rst:297 msgid "Set Edge Trigger behavior, the default is Level Trigger behavior" msgstr "" -#: ../../library/select.rst:299 +#: ../../library/select.rst:300 msgid ":const:`EPOLLONESHOT`" msgstr ":const:`EPOLLONESHOT`" -#: ../../library/select.rst:299 +#: ../../library/select.rst:300 msgid "" "Set one-shot behavior. After one event is pulled out, the fd is internally " "disabled" msgstr "" -#: ../../library/select.rst:302 +#: ../../library/select.rst:303 msgid ":const:`EPOLLEXCLUSIVE`" msgstr ":const:`EPOLLEXCLUSIVE`" -#: ../../library/select.rst:302 +#: ../../library/select.rst:303 msgid "" "Wake only one epoll object when the associated fd has an event. The default " "(if this flag is not set) is to wake all epoll objects polling on a fd." msgstr "" -#: ../../library/select.rst:307 +#: ../../library/select.rst:308 msgid ":const:`EPOLLRDHUP`" msgstr ":const:`EPOLLRDHUP`" -#: ../../library/select.rst:307 +#: ../../library/select.rst:308 msgid "" "Stream socket peer closed connection or shut down writing half of connection." msgstr "" -#: ../../library/select.rst:310 +#: ../../library/select.rst:311 msgid ":const:`EPOLLRDNORM`" msgstr ":const:`EPOLLRDNORM`" -#: ../../library/select.rst:310 +#: ../../library/select.rst:311 msgid "Equivalent to :const:`EPOLLIN`" msgstr "等價於 :const:`EPOLLIN`" -#: ../../library/select.rst:312 +#: ../../library/select.rst:313 msgid ":const:`EPOLLRDBAND`" msgstr ":const:`EPOLLRDBAND`" -#: ../../library/select.rst:312 +#: ../../library/select.rst:313 msgid "Priority data band can be read." msgstr "" -#: ../../library/select.rst:314 +#: ../../library/select.rst:315 msgid ":const:`EPOLLWRNORM`" msgstr ":const:`EPOLLWRNORM`" -#: ../../library/select.rst:314 +#: ../../library/select.rst:315 msgid "Equivalent to :const:`EPOLLOUT`" msgstr "等價於 :const:`EPOLLOUT`" -#: ../../library/select.rst:316 +#: ../../library/select.rst:317 msgid ":const:`EPOLLWRBAND`" msgstr ":const:`EPOLLWRBAND`" -#: ../../library/select.rst:316 +#: ../../library/select.rst:317 msgid "Priority data may be written." msgstr "" -#: ../../library/select.rst:318 +#: ../../library/select.rst:319 msgid ":const:`EPOLLMSG`" msgstr ":const:`EPOLLMSG`" -#: ../../library/select.rst:318 +#: ../../library/select.rst:319 msgid "Ignored." msgstr "" -#: ../../library/select.rst:320 +#: ../../library/select.rst:321 msgid ":const:`EPOLLWAKEUP`" msgstr ":const:`EPOLLWAKEUP`" -#: ../../library/select.rst:320 +#: ../../library/select.rst:321 msgid "Prevents sleep during event waiting." msgstr "" -#: ../../library/select.rst:323 +#: ../../library/select.rst:324 msgid "" ":const:`EPOLLEXCLUSIVE` was added. It's only supported by Linux Kernel 4.5 " "or later." msgstr "" -#: ../../library/select.rst:327 +#: ../../library/select.rst:328 msgid "" ":const:`EPOLLWAKEUP` was added. It's only supported by Linux Kernel 3.5 or " "later." msgstr "" -#: ../../library/select.rst:333 +#: ../../library/select.rst:334 msgid "Close the control file descriptor of the epoll object." msgstr "" -#: ../../library/select.rst:338 +#: ../../library/select.rst:339 msgid "``True`` if the epoll object is closed." msgstr "" -#: ../../library/select.rst:343 ../../library/select.rst:485 +#: ../../library/select.rst:344 ../../library/select.rst:486 msgid "Return the file descriptor number of the control fd." msgstr "" -#: ../../library/select.rst:348 +#: ../../library/select.rst:349 msgid "Create an epoll object from a given file descriptor." msgstr "" -#: ../../library/select.rst:353 +#: ../../library/select.rst:354 msgid "Register a fd descriptor with the epoll object." msgstr "" -#: ../../library/select.rst:358 +#: ../../library/select.rst:359 msgid "Modify a registered file descriptor." msgstr "" -#: ../../library/select.rst:363 +#: ../../library/select.rst:364 msgid "Remove a registered file descriptor from the epoll object." msgstr "" -#: ../../library/select.rst:365 +#: ../../library/select.rst:366 msgid "The method no longer ignores the :data:`~errno.EBADF` error." msgstr "" -#: ../../library/select.rst:371 +#: ../../library/select.rst:372 msgid "Wait for events. timeout in seconds (float)" msgstr "" -#: ../../library/select.rst:383 +#: ../../library/select.rst:384 msgid "Polling Objects" msgstr "" -#: ../../library/select.rst:385 +#: ../../library/select.rst:386 msgid "" "The :c:func:`!poll` system call, supported on most Unix systems, provides " "better scalability for network servers that service many, many clients at " @@ -541,150 +536,148 @@ msgid "" "of file descriptors*)." msgstr "" -#: ../../library/select.rst:402 +#: ../../library/select.rst:403 msgid "" "*eventmask* is an optional bitmask describing the type of events you want to " -"check for, and can be a combination of the " -"constants :const:`POLLIN`, :const:`POLLPRI`, and :const:`POLLOUT`, described " -"in the table below. If not specified, the default value used will check for " -"all 3 types of events." +"check for, and can be a combination of the constants :const:`POLLIN`, :const:" +"`POLLPRI`, and :const:`POLLOUT`, described in the table below. If not " +"specified, the default value used will check for all 3 types of events." msgstr "" -#: ../../library/select.rst:410 +#: ../../library/select.rst:411 msgid ":const:`POLLIN`" msgstr ":const:`POLLIN`" -#: ../../library/select.rst:410 +#: ../../library/select.rst:411 msgid "There is data to read" msgstr "" -#: ../../library/select.rst:412 +#: ../../library/select.rst:413 msgid ":const:`POLLPRI`" msgstr ":const:`POLLPRI`" -#: ../../library/select.rst:412 +#: ../../library/select.rst:413 msgid "There is urgent data to read" msgstr "" -#: ../../library/select.rst:414 +#: ../../library/select.rst:415 msgid ":const:`POLLOUT`" msgstr ":const:`POLLOUT`" -#: ../../library/select.rst:414 +#: ../../library/select.rst:415 msgid "Ready for output: writing will not block" msgstr "" -#: ../../library/select.rst:416 +#: ../../library/select.rst:417 msgid ":const:`POLLERR`" msgstr ":const:`POLLERR`" -#: ../../library/select.rst:416 +#: ../../library/select.rst:417 msgid "Error condition of some sort" msgstr "" -#: ../../library/select.rst:418 +#: ../../library/select.rst:419 msgid ":const:`POLLHUP`" msgstr ":const:`POLLHUP`" -#: ../../library/select.rst:418 +#: ../../library/select.rst:419 msgid "Hung up" msgstr "" -#: ../../library/select.rst:420 +#: ../../library/select.rst:421 msgid ":const:`POLLRDHUP`" msgstr ":const:`POLLRDHUP`" -#: ../../library/select.rst:420 +#: ../../library/select.rst:421 msgid "" "Stream socket peer closed connection, or shut down writing half of connection" msgstr "" -#: ../../library/select.rst:423 +#: ../../library/select.rst:424 msgid ":const:`POLLNVAL`" msgstr ":const:`POLLNVAL`" -#: ../../library/select.rst:423 +#: ../../library/select.rst:424 msgid "Invalid request: descriptor not open" msgstr "" -#: ../../library/select.rst:426 +#: ../../library/select.rst:427 msgid "" "Registering a file descriptor that's already registered is not an error, and " "has the same effect as registering the descriptor exactly once." msgstr "" -#: ../../library/select.rst:432 +#: ../../library/select.rst:433 msgid "" "Modifies an already registered fd. This has the same effect as " "``register(fd, eventmask)``. Attempting to modify a file descriptor that " -"was never registered causes an :exc:`OSError` exception with " -"errno :const:`ENOENT` to be raised." +"was never registered causes an :exc:`OSError` exception with errno :const:" +"`ENOENT` to be raised." msgstr "" -#: ../../library/select.rst:444 +#: ../../library/select.rst:445 msgid "" -"Attempting to remove a file descriptor that was never registered causes " -"a :exc:`KeyError` exception to be raised." +"Attempting to remove a file descriptor that was never registered causes a :" +"exc:`KeyError` exception to be raised." msgstr "" -#: ../../library/select.rst:450 +#: ../../library/select.rst:451 msgid "" "Polls the set of registered file descriptors, and returns a possibly empty " "list containing ``(fd, event)`` 2-tuples for the descriptors that have " "events or errors to report. *fd* is the file descriptor, and *event* is a " -"bitmask with bits set for the reported events for that descriptor " -"--- :const:`POLLIN` for waiting input, :const:`POLLOUT` to indicate that the " -"descriptor can be written to, and so forth. An empty list indicates that the " -"call timed out and no file descriptors had any events to report. If " -"*timeout* is given, it specifies the length of time in milliseconds which " -"the system will wait for events before returning. If *timeout* is omitted, " -"negative, or :const:`None`, the call will block until there is an event for " -"this poll object." +"bitmask with bits set for the reported events for that descriptor --- :const:" +"`POLLIN` for waiting input, :const:`POLLOUT` to indicate that the descriptor " +"can be written to, and so forth. An empty list indicates that the call timed " +"out and no file descriptors had any events to report. If *timeout* is given, " +"it specifies the length of time in milliseconds which the system will wait " +"for events before returning. If *timeout* is omitted, negative, or :const:" +"`None`, the call will block until there is an event for this poll object." msgstr "" -#: ../../library/select.rst:471 +#: ../../library/select.rst:472 msgid "Kqueue Objects" msgstr "" -#: ../../library/select.rst:475 +#: ../../library/select.rst:476 msgid "Close the control file descriptor of the kqueue object." msgstr "" -#: ../../library/select.rst:480 +#: ../../library/select.rst:481 msgid "``True`` if the kqueue object is closed." msgstr "" -#: ../../library/select.rst:490 +#: ../../library/select.rst:491 msgid "Create a kqueue object from a given file descriptor." msgstr "" -#: ../../library/select.rst:495 +#: ../../library/select.rst:496 msgid "Low level interface to kevent" msgstr "" -#: ../../library/select.rst:497 +#: ../../library/select.rst:498 msgid "changelist must be an iterable of kevent objects or ``None``" msgstr "" -#: ../../library/select.rst:498 +#: ../../library/select.rst:499 msgid "max_events must be 0 or a positive integer" msgstr "" -#: ../../library/select.rst:499 +#: ../../library/select.rst:500 msgid "" "timeout in seconds (floats possible); the default is ``None``, to wait " "forever" msgstr "" -#: ../../library/select.rst:512 +#: ../../library/select.rst:513 msgid "Kevent Objects" msgstr "" -#: ../../library/select.rst:514 +#: ../../library/select.rst:515 msgid "https://man.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2" msgstr "https://man.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2" -#: ../../library/select.rst:518 +#: ../../library/select.rst:519 msgid "" "Value used to identify the event. The interpretation depends on the filter " "but it's usually the file descriptor. In the constructor ident can either be " @@ -692,340 +685,340 @@ msgid "" "the integer internally." msgstr "" -#: ../../library/select.rst:525 +#: ../../library/select.rst:526 msgid "Name of the kernel filter." msgstr "" -#: ../../library/select.rst:530 +#: ../../library/select.rst:531 msgid ":const:`KQ_FILTER_READ`" msgstr ":const:`KQ_FILTER_READ`" -#: ../../library/select.rst:530 +#: ../../library/select.rst:531 msgid "Takes a descriptor and returns whenever there is data available to read" msgstr "" -#: ../../library/select.rst:533 +#: ../../library/select.rst:534 msgid ":const:`KQ_FILTER_WRITE`" msgstr ":const:`KQ_FILTER_WRITE`" -#: ../../library/select.rst:533 +#: ../../library/select.rst:534 msgid "" "Takes a descriptor and returns whenever there is data available to write" msgstr "" -#: ../../library/select.rst:536 +#: ../../library/select.rst:537 msgid ":const:`KQ_FILTER_AIO`" msgstr ":const:`KQ_FILTER_AIO`" -#: ../../library/select.rst:536 +#: ../../library/select.rst:537 msgid "AIO requests" msgstr "" -#: ../../library/select.rst:538 +#: ../../library/select.rst:539 msgid ":const:`KQ_FILTER_VNODE`" msgstr ":const:`KQ_FILTER_VNODE`" -#: ../../library/select.rst:538 +#: ../../library/select.rst:539 msgid "" "Returns when one or more of the requested events watched in *fflag* occurs" msgstr "" -#: ../../library/select.rst:541 +#: ../../library/select.rst:542 msgid ":const:`KQ_FILTER_PROC`" msgstr ":const:`KQ_FILTER_PROC`" -#: ../../library/select.rst:541 +#: ../../library/select.rst:542 msgid "Watch for events on a process id" msgstr "" -#: ../../library/select.rst:543 +#: ../../library/select.rst:544 msgid ":const:`KQ_FILTER_NETDEV`" msgstr ":const:`KQ_FILTER_NETDEV`" -#: ../../library/select.rst:543 +#: ../../library/select.rst:544 msgid "Watch for events on a network device [not available on macOS]" msgstr "" -#: ../../library/select.rst:546 +#: ../../library/select.rst:547 msgid ":const:`KQ_FILTER_SIGNAL`" msgstr ":const:`KQ_FILTER_SIGNAL`" -#: ../../library/select.rst:546 +#: ../../library/select.rst:547 msgid "Returns whenever the watched signal is delivered to the process" msgstr "" -#: ../../library/select.rst:549 +#: ../../library/select.rst:550 msgid ":const:`KQ_FILTER_TIMER`" msgstr ":const:`KQ_FILTER_TIMER`" -#: ../../library/select.rst:549 +#: ../../library/select.rst:550 msgid "Establishes an arbitrary timer" msgstr "" -#: ../../library/select.rst:554 +#: ../../library/select.rst:555 msgid "Filter action." msgstr "" -#: ../../library/select.rst:559 +#: ../../library/select.rst:560 msgid ":const:`KQ_EV_ADD`" msgstr ":const:`KQ_EV_ADD`" -#: ../../library/select.rst:559 +#: ../../library/select.rst:560 msgid "Adds or modifies an event" msgstr "" -#: ../../library/select.rst:561 +#: ../../library/select.rst:562 msgid ":const:`KQ_EV_DELETE`" msgstr ":const:`KQ_EV_DELETE`" -#: ../../library/select.rst:561 +#: ../../library/select.rst:562 msgid "Removes an event from the queue" msgstr "" -#: ../../library/select.rst:563 +#: ../../library/select.rst:564 msgid ":const:`KQ_EV_ENABLE`" msgstr ":const:`KQ_EV_ENABLE`" -#: ../../library/select.rst:563 +#: ../../library/select.rst:564 msgid "Permitscontrol() to returns the event" msgstr "" -#: ../../library/select.rst:565 +#: ../../library/select.rst:566 msgid ":const:`KQ_EV_DISABLE`" msgstr ":const:`KQ_EV_DISABLE`" -#: ../../library/select.rst:565 +#: ../../library/select.rst:566 msgid "Disablesevent" msgstr "" -#: ../../library/select.rst:567 +#: ../../library/select.rst:568 msgid ":const:`KQ_EV_ONESHOT`" msgstr ":const:`KQ_EV_ONESHOT`" -#: ../../library/select.rst:567 +#: ../../library/select.rst:568 msgid "Removes event after first occurrence" msgstr "" -#: ../../library/select.rst:569 +#: ../../library/select.rst:570 msgid ":const:`KQ_EV_CLEAR`" msgstr ":const:`KQ_EV_CLEAR`" -#: ../../library/select.rst:569 +#: ../../library/select.rst:570 msgid "Reset the state after an event is retrieved" msgstr "" -#: ../../library/select.rst:571 +#: ../../library/select.rst:572 msgid ":const:`KQ_EV_SYSFLAGS`" msgstr ":const:`KQ_EV_SYSFLAGS`" -#: ../../library/select.rst:571 ../../library/select.rst:573 +#: ../../library/select.rst:572 ../../library/select.rst:574 msgid "internal event" msgstr "" -#: ../../library/select.rst:573 +#: ../../library/select.rst:574 msgid ":const:`KQ_EV_FLAG1`" msgstr ":const:`KQ_EV_FLAG1`" -#: ../../library/select.rst:575 +#: ../../library/select.rst:576 msgid ":const:`KQ_EV_EOF`" msgstr ":const:`KQ_EV_EOF`" -#: ../../library/select.rst:575 +#: ../../library/select.rst:576 msgid "Filter specific EOF condition" msgstr "" -#: ../../library/select.rst:577 +#: ../../library/select.rst:578 msgid ":const:`KQ_EV_ERROR`" msgstr ":const:`KQ_EV_ERROR`" -#: ../../library/select.rst:577 +#: ../../library/select.rst:578 msgid "See return values" msgstr "" -#: ../../library/select.rst:583 +#: ../../library/select.rst:584 msgid "Filter specific flags." msgstr "" -#: ../../library/select.rst:585 +#: ../../library/select.rst:586 msgid ":const:`KQ_FILTER_READ` and :const:`KQ_FILTER_WRITE` filter flags:" msgstr ":const:`KQ_FILTER_READ` 和 :const:`KQ_FILTER_WRITE` 篩選旗標:" -#: ../../library/select.rst:590 +#: ../../library/select.rst:591 msgid ":const:`KQ_NOTE_LOWAT`" msgstr ":const:`KQ_NOTE_LOWAT`" -#: ../../library/select.rst:590 +#: ../../library/select.rst:591 msgid "low water mark of a socket buffer" msgstr "" -#: ../../library/select.rst:593 +#: ../../library/select.rst:594 msgid ":const:`KQ_FILTER_VNODE` filter flags:" msgstr ":const:`KQ_FILTER_VNODE` 篩選旗標:" -#: ../../library/select.rst:598 +#: ../../library/select.rst:599 msgid ":const:`KQ_NOTE_DELETE`" msgstr ":const:`KQ_NOTE_DELETE`" -#: ../../library/select.rst:598 +#: ../../library/select.rst:599 msgid "*unlink()* was called" msgstr "" -#: ../../library/select.rst:600 +#: ../../library/select.rst:601 msgid ":const:`KQ_NOTE_WRITE`" msgstr ":const:`KQ_NOTE_WRITE`" -#: ../../library/select.rst:600 +#: ../../library/select.rst:601 msgid "a write occurred" msgstr "" -#: ../../library/select.rst:602 +#: ../../library/select.rst:603 msgid ":const:`KQ_NOTE_EXTEND`" msgstr ":const:`KQ_NOTE_EXTEND`" -#: ../../library/select.rst:602 +#: ../../library/select.rst:603 msgid "the file was extended" msgstr "" -#: ../../library/select.rst:604 +#: ../../library/select.rst:605 msgid ":const:`KQ_NOTE_ATTRIB`" msgstr ":const:`KQ_NOTE_ATTRIB`" -#: ../../library/select.rst:604 +#: ../../library/select.rst:605 msgid "an attribute was changed" msgstr "" -#: ../../library/select.rst:606 +#: ../../library/select.rst:607 msgid ":const:`KQ_NOTE_LINK`" msgstr ":const:`KQ_NOTE_LINK`" -#: ../../library/select.rst:606 +#: ../../library/select.rst:607 msgid "the link count has changed" msgstr "" -#: ../../library/select.rst:608 +#: ../../library/select.rst:609 msgid ":const:`KQ_NOTE_RENAME`" msgstr ":const:`KQ_NOTE_RENAME`" -#: ../../library/select.rst:608 +#: ../../library/select.rst:609 msgid "the file was renamed" msgstr "" -#: ../../library/select.rst:610 +#: ../../library/select.rst:611 msgid ":const:`KQ_NOTE_REVOKE`" msgstr ":const:`KQ_NOTE_REVOKE`" -#: ../../library/select.rst:610 +#: ../../library/select.rst:611 msgid "access to the file was revoked" msgstr "" -#: ../../library/select.rst:613 +#: ../../library/select.rst:614 msgid ":const:`KQ_FILTER_PROC` filter flags:" msgstr ":const:`KQ_FILTER_PROC` 篩選旗標:" -#: ../../library/select.rst:618 +#: ../../library/select.rst:619 msgid ":const:`KQ_NOTE_EXIT`" msgstr ":const:`KQ_NOTE_EXIT`" -#: ../../library/select.rst:618 +#: ../../library/select.rst:619 msgid "the process has exited" msgstr "" -#: ../../library/select.rst:620 +#: ../../library/select.rst:621 msgid ":const:`KQ_NOTE_FORK`" msgstr ":const:`KQ_NOTE_FORK`" -#: ../../library/select.rst:620 +#: ../../library/select.rst:621 msgid "the process has called *fork()*" msgstr "" -#: ../../library/select.rst:622 +#: ../../library/select.rst:623 msgid ":const:`KQ_NOTE_EXEC`" msgstr ":const:`KQ_NOTE_EXEC`" -#: ../../library/select.rst:622 +#: ../../library/select.rst:623 msgid "the process has executed a new process" msgstr "" -#: ../../library/select.rst:624 +#: ../../library/select.rst:625 msgid ":const:`KQ_NOTE_PCTRLMASK`" msgstr ":const:`KQ_NOTE_PCTRLMASK`" -#: ../../library/select.rst:624 ../../library/select.rst:626 +#: ../../library/select.rst:625 ../../library/select.rst:627 msgid "internal filter flag" msgstr "" -#: ../../library/select.rst:626 +#: ../../library/select.rst:627 msgid ":const:`KQ_NOTE_PDATAMASK`" msgstr ":const:`KQ_NOTE_PDATAMASK`" -#: ../../library/select.rst:628 +#: ../../library/select.rst:629 msgid ":const:`KQ_NOTE_TRACK`" msgstr ":const:`KQ_NOTE_TRACK`" -#: ../../library/select.rst:628 +#: ../../library/select.rst:629 msgid "follow a process across *fork()*" msgstr "" -#: ../../library/select.rst:630 +#: ../../library/select.rst:631 msgid ":const:`KQ_NOTE_CHILD`" msgstr ":const:`KQ_NOTE_CHILD`" -#: ../../library/select.rst:630 +#: ../../library/select.rst:631 msgid "returned on the child process for *NOTE_TRACK*" msgstr "" -#: ../../library/select.rst:633 +#: ../../library/select.rst:634 msgid ":const:`KQ_NOTE_TRACKERR`" msgstr ":const:`KQ_NOTE_TRACKERR`" -#: ../../library/select.rst:633 +#: ../../library/select.rst:634 msgid "unable to attach to a child" msgstr "" -#: ../../library/select.rst:636 +#: ../../library/select.rst:637 msgid ":const:`KQ_FILTER_NETDEV` filter flags (not available on macOS):" msgstr ":const:`KQ_FILTER_NETDEV` 篩選旗標(macOS 上不可用):" -#: ../../library/select.rst:641 +#: ../../library/select.rst:642 msgid ":const:`KQ_NOTE_LINKUP`" msgstr ":const:`KQ_NOTE_LINKUP`" -#: ../../library/select.rst:641 +#: ../../library/select.rst:642 msgid "link is up" msgstr "" -#: ../../library/select.rst:643 +#: ../../library/select.rst:644 msgid ":const:`KQ_NOTE_LINKDOWN`" msgstr ":const:`KQ_NOTE_LINKDOWN`" -#: ../../library/select.rst:643 +#: ../../library/select.rst:644 msgid "link is down" msgstr "" -#: ../../library/select.rst:645 +#: ../../library/select.rst:646 msgid ":const:`KQ_NOTE_LINKINV`" msgstr ":const:`KQ_NOTE_LINKINV`" -#: ../../library/select.rst:645 +#: ../../library/select.rst:646 msgid "link state is invalid" msgstr "" -#: ../../library/select.rst:651 +#: ../../library/select.rst:652 msgid "Filter specific data." msgstr "" -#: ../../library/select.rst:656 +#: ../../library/select.rst:657 msgid "User defined value." msgstr "" -#: ../../library/select.rst:141 +#: ../../library/select.rst:142 msgid "socket() (in module socket)" msgstr "socket() (於 socket 模組)" -#: ../../library/select.rst:141 +#: ../../library/select.rst:142 msgid "popen() (in module os)" msgstr "popen() (於 os 模組)" -#: ../../library/select.rst:154 +#: ../../library/select.rst:155 msgid "WinSock" msgstr "WinSock" From 241954fe97dc5dd477fa485895c492bcc2ff39a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 4 Dec 2025 00:16:25 +0000 Subject: [PATCH 12/13] sync with cpython 319c6a2a --- reference/lexical_analysis.po | 899 ++++++++++++++++++---------------- 1 file changed, 487 insertions(+), 412 deletions(-) diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index db26bced2a..ee4bb73580 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-17 00:14+0000\n" +"POT-Creation-Date: 2025-12-04 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -560,140 +560,57 @@ msgid "" msgstr "" #: ../../reference/lexical_analysis.rst:389 -msgid "" -"Within the ASCII range (U+0001..U+007F), the valid characters for names " -"include the uppercase and lowercase letters (``A-Z`` and ``a-z``), the " -"underscore ``_`` and, except for the first character, the digits ``0`` " -"through ``9``." -msgstr "" - -#: ../../reference/lexical_analysis.rst:394 -msgid "" -"Names must contain at least one character, but have no upper length limit. " -"Case is significant." -msgstr "" - -#: ../../reference/lexical_analysis.rst:397 -msgid "" -"Besides ``A-Z``, ``a-z``, ``_`` and ``0-9``, names can also use \"letter-" -"like\" and \"number-like\" characters from outside the ASCII range, as " -"detailed below." -msgstr "" - -#: ../../reference/lexical_analysis.rst:400 -msgid "" -"All identifiers are converted into the `normalization form`_ NFKC while " -"parsing; comparison of identifiers is based on NFKC." -msgstr "" - -#: ../../reference/lexical_analysis.rst:403 -msgid "" -"Formally, the first character of a normalized identifier must belong to the " -"set ``id_start``, which is the union of:" -msgstr "" - -#: ../../reference/lexical_analysis.rst:406 -msgid "Unicode category ```` - uppercase letters (includes ``A`` to ``Z``)" -msgstr "" - -#: ../../reference/lexical_analysis.rst:407 -msgid "Unicode category ```` - lowercase letters (includes ``a`` to ``z``)" -msgstr "" - -#: ../../reference/lexical_analysis.rst:408 -msgid "Unicode category ```` - titlecase letters" -msgstr "" - -#: ../../reference/lexical_analysis.rst:409 -msgid "Unicode category ```` - modifier letters" -msgstr "" - -#: ../../reference/lexical_analysis.rst:410 -msgid "Unicode category ```` - other letters" -msgstr "" - -#: ../../reference/lexical_analysis.rst:411 -msgid "Unicode category ```` - letter numbers" -msgstr "" - -#: ../../reference/lexical_analysis.rst:412 -msgid "{``\"_\"``} - the underscore" -msgstr "{``\"_\"``} - 底線" - -#: ../../reference/lexical_analysis.rst:413 -msgid "" -"```` - an explicit set of characters in `PropList.txt`_ to " -"support backwards compatibility" +msgid "Names are composed of the following characters:" msgstr "" -#: ../../reference/lexical_analysis.rst:416 -msgid "" -"The remaining characters must belong to the set ``id_continue``, which is " -"the union of:" +#: ../../reference/lexical_analysis.rst:391 +msgid "uppercase and lowercase letters (``A-Z`` and ``a-z``)," msgstr "" -#: ../../reference/lexical_analysis.rst:419 -msgid "all characters in ``id_start``" -msgstr "" - -#: ../../reference/lexical_analysis.rst:420 -msgid "Unicode category ```` - decimal numbers (includes ``0`` to ``9``)" -msgstr "" - -#: ../../reference/lexical_analysis.rst:421 -msgid "Unicode category ```` - connector punctuations" -msgstr "" - -#: ../../reference/lexical_analysis.rst:422 -msgid "Unicode category ```` - nonspacing marks" -msgstr "" - -#: ../../reference/lexical_analysis.rst:423 -msgid "Unicode category ```` - spacing combining marks" -msgstr "" +#: ../../reference/lexical_analysis.rst:392 +#, fuzzy +msgid "the underscore (``_``)," +msgstr "底線 (``_``)" -#: ../../reference/lexical_analysis.rst:424 +#: ../../reference/lexical_analysis.rst:393 msgid "" -"```` - another explicit set of characters in `PropList." -"txt`_ to support backwards compatibility" +"digits (``0`` through ``9``), which cannot appear as the first character, and" msgstr "" -#: ../../reference/lexical_analysis.rst:427 +#: ../../reference/lexical_analysis.rst:394 msgid "" -"Unicode categories use the version of the Unicode Character Database as " -"included in the :mod:`unicodedata` module." +"non-ASCII characters. Valid names may only contain \"letter-like\" and " +"\"digit-like\" characters; see :ref:`lexical-names-nonascii` for details." msgstr "" -#: ../../reference/lexical_analysis.rst:430 +#: ../../reference/lexical_analysis.rst:397 msgid "" -"These sets are based on the Unicode standard annex `UAX-31`_. See also :pep:" -"`3131` for further details." +"Names must contain at least one character, but have no upper length limit. " +"Case is significant." msgstr "" -#: ../../reference/lexical_analysis.rst:433 -msgid "" -"Even more formally, names are described by the following lexical definitions:" +#: ../../reference/lexical_analysis.rst:400 +msgid "Formally, names are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:447 +#: ../../reference/lexical_analysis.rst:410 msgid "" -"A non-normative listing of all valid identifier characters as defined by " -"Unicode is available in the `DerivedCoreProperties.txt`_ file in the Unicode " -"Character Database." +"Note that not all names matched by this grammar are valid; see :ref:`lexical-" +"names-nonascii` for details." msgstr "" -#: ../../reference/lexical_analysis.rst:461 +#: ../../reference/lexical_analysis.rst:417 msgid "Keywords" msgstr "關鍵字" -#: ../../reference/lexical_analysis.rst:467 +#: ../../reference/lexical_analysis.rst:423 msgid "" "The following names are used as reserved words, or *keywords* of the " "language, and cannot be used as ordinary identifiers. They must be spelled " "exactly as written here:" msgstr "" -#: ../../reference/lexical_analysis.rst:471 +#: ../../reference/lexical_analysis.rst:427 msgid "" "False await else import pass\n" "None break except in raise\n" @@ -711,101 +628,101 @@ msgstr "" "assert del global not with\n" "async elif if or yield" -#: ../../reference/lexical_analysis.rst:485 +#: ../../reference/lexical_analysis.rst:441 msgid "Soft Keywords" msgstr "軟關鍵字" -#: ../../reference/lexical_analysis.rst:491 +#: ../../reference/lexical_analysis.rst:447 msgid "" "Some names are only reserved under specific contexts. These are known as " "*soft keywords*:" msgstr "" -#: ../../reference/lexical_analysis.rst:494 +#: ../../reference/lexical_analysis.rst:450 msgid "" "``match``, ``case``, and ``_``, when used in the :keyword:`match` statement." msgstr "" -#: ../../reference/lexical_analysis.rst:495 +#: ../../reference/lexical_analysis.rst:451 msgid "``type``, when used in the :keyword:`type` statement." msgstr "" -#: ../../reference/lexical_analysis.rst:497 +#: ../../reference/lexical_analysis.rst:453 msgid "" "These syntactically act as keywords in their specific contexts, but this " "distinction is done at the parser level, not when tokenizing." msgstr "" -#: ../../reference/lexical_analysis.rst:500 +#: ../../reference/lexical_analysis.rst:456 msgid "" "As soft keywords, their use in the grammar is possible while still " "preserving compatibility with existing code that uses these names as " "identifier names." msgstr "" -#: ../../reference/lexical_analysis.rst:504 +#: ../../reference/lexical_analysis.rst:460 msgid "``type`` is now a soft keyword." msgstr "``type`` 現在是軟關鍵字。" -#: ../../reference/lexical_analysis.rst:513 +#: ../../reference/lexical_analysis.rst:469 msgid "Reserved classes of identifiers" msgstr "" -#: ../../reference/lexical_analysis.rst:515 +#: ../../reference/lexical_analysis.rst:471 msgid "" "Certain classes of identifiers (besides keywords) have special meanings. " "These classes are identified by the patterns of leading and trailing " "underscore characters:" msgstr "" -#: ../../reference/lexical_analysis.rst:519 +#: ../../reference/lexical_analysis.rst:475 msgid "``_*``" msgstr "``_*``" -#: ../../reference/lexical_analysis.rst:520 +#: ../../reference/lexical_analysis.rst:476 msgid "Not imported by ``from module import *``." msgstr "" -#: ../../reference/lexical_analysis.rst:522 +#: ../../reference/lexical_analysis.rst:478 msgid "``_``" msgstr "``_``" -#: ../../reference/lexical_analysis.rst:523 +#: ../../reference/lexical_analysis.rst:479 msgid "" "In a ``case`` pattern within a :keyword:`match` statement, ``_`` is a :ref:" "`soft keyword ` that denotes a :ref:`wildcard `." msgstr "" -#: ../../reference/lexical_analysis.rst:527 +#: ../../reference/lexical_analysis.rst:483 msgid "" "Separately, the interactive interpreter makes the result of the last " "evaluation available in the variable ``_``. (It is stored in the :mod:" "`builtins` module, alongside built-in functions like ``print``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:488 msgid "" "Elsewhere, ``_`` is a regular identifier. It is often used to name " "\"special\" items, but it is not special to Python itself." msgstr "" -#: ../../reference/lexical_analysis.rst:537 +#: ../../reference/lexical_analysis.rst:493 msgid "" "The name ``_`` is often used in conjunction with internationalization; refer " "to the documentation for the :mod:`gettext` module for more information on " "this convention." msgstr "" -#: ../../reference/lexical_analysis.rst:541 +#: ../../reference/lexical_analysis.rst:497 msgid "It is also commonly used for unused variables." msgstr "" -#: ../../reference/lexical_analysis.rst:543 +#: ../../reference/lexical_analysis.rst:499 msgid "``__*__``" msgstr "``__*__``" -#: ../../reference/lexical_analysis.rst:544 +#: ../../reference/lexical_analysis.rst:500 msgid "" "System-defined names, informally known as \"dunder\" names. These names are " "defined by the interpreter and its implementation (including the standard " @@ -815,11 +732,11 @@ msgid "" "explicitly documented use, is subject to breakage without warning." msgstr "" -#: ../../reference/lexical_analysis.rst:551 +#: ../../reference/lexical_analysis.rst:507 msgid "``__*``" msgstr "``__*``" -#: ../../reference/lexical_analysis.rst:552 +#: ../../reference/lexical_analysis.rst:508 msgid "" "Class-private names. Names in this category, when used within the context " "of a class definition, are re-written to use a mangled form to help avoid " @@ -827,38 +744,196 @@ msgid "" "section :ref:`atom-identifiers`." msgstr "" +#: ../../reference/lexical_analysis.rst:517 +#, fuzzy +msgid "Non-ASCII characters in names" +msgstr "非 ASCII 字元" + +#: ../../reference/lexical_analysis.rst:519 +msgid "" +"Names that contain non-ASCII characters need additional normalization and " +"validation beyond the rules and grammar explained :ref:`above " +"`. For example, ``ř_1``, ``蛇``, or ``साँप`` are valid names, " +"but ``r〰2``, ``€``, or ``🐍`` are not." +msgstr "" + +#: ../../reference/lexical_analysis.rst:525 +msgid "This section explains the exact rules." +msgstr "" + +#: ../../reference/lexical_analysis.rst:527 +msgid "" +"All names are converted into the `normalization form`_ NFKC while parsing. " +"This means that, for example, some typographic variants of characters are " +"converted to their \"basic\" form. For example, ``fiⁿₐˡᵢᶻₐᵗᵢᵒₙ`` normalizes " +"to ``finalization``, so Python treats them as the same name::" +msgstr "" + +#: ../../reference/lexical_analysis.rst:532 +msgid "" +">>> fiⁿₐˡᵢᶻₐᵗᵢᵒₙ = 3\n" +">>> finalization\n" +"3" +msgstr "" + +#: ../../reference/lexical_analysis.rst:538 +msgid "" +"Normalization is done at the lexical level only. Run-time functions that " +"take names as *strings* generally do not normalize their arguments. For " +"example, the variable defined above is accessible at run time in the :func:" +"`globals` dictionary as ``globals()[\"finalization\"]`` but not ``globals()" +"[\"fiⁿₐˡᵢᶻₐᵗᵢᵒₙ\"]``." +msgstr "" + +#: ../../reference/lexical_analysis.rst:545 +msgid "" +"Similarly to how ASCII-only names must contain only letters, digits and the " +"underscore, and cannot start with a digit, a valid name must start with a " +"character in the \"letter-like\" set ``xid_start``, and the remaining " +"characters must be in the \"letter- and digit-like\" set ``xid_continue``." +msgstr "" + +#: ../../reference/lexical_analysis.rst:551 +msgid "" +"These sets based on the *XID_Start* and *XID_Continue* sets as defined by " +"the Unicode standard annex `UAX-31`_. Python's ``xid_start`` additionally " +"includes the underscore (``_``). Note that Python does not necessarily " +"conform to `UAX-31`_." +msgstr "" + +#: ../../reference/lexical_analysis.rst:556 +msgid "" +"A non-normative listing of characters in the *XID_Start* and *XID_Continue* " +"sets as defined by Unicode is available in the `DerivedCoreProperties.txt`_ " +"file in the Unicode Character Database. For reference, the construction " +"rules for the ``xid_*`` sets are given below." +msgstr "" + #: ../../reference/lexical_analysis.rst:561 -msgid "Literals" +msgid "The set ``id_start`` is defined as the union of:" +msgstr "" + +#: ../../reference/lexical_analysis.rst:563 +msgid "Unicode category ```` - uppercase letters (includes ``A`` to ``Z``)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:564 +msgid "Unicode category ```` - lowercase letters (includes ``a`` to ``z``)" msgstr "" #: ../../reference/lexical_analysis.rst:565 -msgid "Literals are notations for constant values of some built-in types." +msgid "Unicode category ```` - titlecase letters" +msgstr "" + +#: ../../reference/lexical_analysis.rst:566 +msgid "Unicode category ```` - modifier letters" msgstr "" #: ../../reference/lexical_analysis.rst:567 +msgid "Unicode category ```` - other letters" +msgstr "" + +#: ../../reference/lexical_analysis.rst:568 +msgid "Unicode category ```` - letter numbers" +msgstr "" + +#: ../../reference/lexical_analysis.rst:569 +msgid "{``\"_\"``} - the underscore" +msgstr "{``\"_\"``} - 底線" + +#: ../../reference/lexical_analysis.rst:570 +msgid "" +"```` - an explicit set of characters in `PropList.txt`_ to " +"support backwards compatibility" +msgstr "" + +#: ../../reference/lexical_analysis.rst:573 +msgid "" +"The set ``xid_start`` then closes this set under NFKC normalization, by " +"removing all characters whose normalization is not of the form ``id_start " +"id_continue*``." +msgstr "" + +#: ../../reference/lexical_analysis.rst:577 +msgid "The set ``id_continue`` is defined as the union of:" +msgstr "" + +#: ../../reference/lexical_analysis.rst:579 +msgid "``id_start`` (see above)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:580 +msgid "Unicode category ```` - decimal numbers (includes ``0`` to ``9``)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:581 +msgid "Unicode category ```` - connector punctuations" +msgstr "" + +#: ../../reference/lexical_analysis.rst:582 +msgid "Unicode category ```` - nonspacing marks" +msgstr "" + +#: ../../reference/lexical_analysis.rst:583 +msgid "Unicode category ```` - spacing combining marks" +msgstr "" + +#: ../../reference/lexical_analysis.rst:584 +msgid "" +"```` - another explicit set of characters in `PropList." +"txt`_ to support backwards compatibility" +msgstr "" + +#: ../../reference/lexical_analysis.rst:587 +msgid "Again, ``xid_continue`` closes this set under NFKC normalization." +msgstr "" + +#: ../../reference/lexical_analysis.rst:589 +msgid "" +"Unicode categories use the version of the Unicode Character Database as " +"included in the :mod:`unicodedata` module." +msgstr "" + +#: ../../reference/lexical_analysis.rst:599 +msgid ":pep:`3131` -- Supporting Non-ASCII Identifiers" +msgstr "" + +#: ../../reference/lexical_analysis.rst:600 +msgid ":pep:`672` -- Unicode-related Security Considerations for Python" +msgstr "" + +#: ../../reference/lexical_analysis.rst:606 +msgid "Literals" +msgstr "" + +#: ../../reference/lexical_analysis.rst:610 +msgid "Literals are notations for constant values of some built-in types." +msgstr "" + +#: ../../reference/lexical_analysis.rst:612 msgid "" "In terms of lexical analysis, Python has :ref:`string, bytes ` and :" "ref:`numeric ` literals." msgstr "" -#: ../../reference/lexical_analysis.rst:570 +#: ../../reference/lexical_analysis.rst:615 msgid "" "Other \"literals\" are lexically denoted using :ref:`keywords ` " "(``None``, ``True``, ``False``) and the special :ref:`ellipsis token " "` (``...``)." msgstr "" -#: ../../reference/lexical_analysis.rst:581 +#: ../../reference/lexical_analysis.rst:626 msgid "String and Bytes literals" msgstr "" -#: ../../reference/lexical_analysis.rst:583 +#: ../../reference/lexical_analysis.rst:628 msgid "" "String literals are text enclosed in single quotes (``'``) or double quotes " "(``\"``). For example:" msgstr "" -#: ../../reference/lexical_analysis.rst:586 +#: ../../reference/lexical_analysis.rst:631 msgid "" "\"spam\"\n" "'eggs'" @@ -866,14 +941,14 @@ msgstr "" "\"spam\"\n" "'eggs'" -#: ../../reference/lexical_analysis.rst:591 +#: ../../reference/lexical_analysis.rst:636 msgid "" "The quote used to start the literal also terminates it, so a string literal " "can only contain the other quote (except with escape sequences, see below). " "For example:" msgstr "" -#: ../../reference/lexical_analysis.rst:595 +#: ../../reference/lexical_analysis.rst:640 msgid "" "'Say \"Hello\", please.'\n" "\"Don't do that!\"" @@ -881,13 +956,13 @@ msgstr "" "'Say \"Hello\", please.'\n" "\"Don't do that!\"" -#: ../../reference/lexical_analysis.rst:600 +#: ../../reference/lexical_analysis.rst:645 msgid "" "Except for this limitation, the choice of quote character (``'`` or ``\"``) " "does not affect how the literal is parsed." msgstr "" -#: ../../reference/lexical_analysis.rst:603 +#: ../../reference/lexical_analysis.rst:648 msgid "" "Inside a string literal, the backslash (``\\``) character introduces an :dfn:" "`escape sequence`, which has special meaning depending on the character " @@ -895,7 +970,7 @@ msgid "" "character, and does *not* end the string:" msgstr "" -#: ../../reference/lexical_analysis.rst:609 +#: ../../reference/lexical_analysis.rst:654 msgid "" ">>> print(\"Say \\\"Hello\\\" to everyone!\")\n" "Say \"Hello\" to everyone!" @@ -903,58 +978,58 @@ msgstr "" ">>> print(\"Say \\\"Hello\\\" to everyone!\")\n" "Say \"Hello\" to everyone!" -#: ../../reference/lexical_analysis.rst:614 +#: ../../reference/lexical_analysis.rst:659 msgid "" "See :ref:`escape sequences ` below for a full list of such " "sequences, and more details." msgstr "" -#: ../../reference/lexical_analysis.rst:623 +#: ../../reference/lexical_analysis.rst:668 msgid "Triple-quoted strings" msgstr "三引號字串" -#: ../../reference/lexical_analysis.rst:625 +#: ../../reference/lexical_analysis.rst:670 msgid "" "Strings can also be enclosed in matching groups of three single or double " "quotes. These are generally referred to as :dfn:`triple-quoted strings`::" msgstr "" -#: ../../reference/lexical_analysis.rst:629 +#: ../../reference/lexical_analysis.rst:674 msgid "\"\"\"This is a triple-quoted string.\"\"\"" msgstr "\"\"\"這是一個三引號字串。\"\"\"" -#: ../../reference/lexical_analysis.rst:631 +#: ../../reference/lexical_analysis.rst:676 msgid "" "In triple-quoted literals, unescaped quotes are allowed (and are retained), " "except that three unescaped quotes in a row terminate the literal, if they " "are of the same kind (``'`` or ``\"``) used at the start::" msgstr "" -#: ../../reference/lexical_analysis.rst:635 +#: ../../reference/lexical_analysis.rst:680 msgid "\"\"\"This string has \"quotes\" inside.\"\"\"" msgstr "\"\"\"這個字串裡面有 \"引號\"。\"\"\"" -#: ../../reference/lexical_analysis.rst:637 +#: ../../reference/lexical_analysis.rst:682 msgid "Unescaped newlines are also allowed and retained::" msgstr "" -#: ../../reference/lexical_analysis.rst:639 +#: ../../reference/lexical_analysis.rst:684 msgid "" "'''This triple-quoted string\n" "continues on the next line.'''" msgstr "" -#: ../../reference/lexical_analysis.rst:648 +#: ../../reference/lexical_analysis.rst:693 msgid "String prefixes" msgstr "" -#: ../../reference/lexical_analysis.rst:650 +#: ../../reference/lexical_analysis.rst:695 msgid "" "String literals can have an optional :dfn:`prefix` that influences how the " "content of the literal is parsed, for example:" msgstr "" -#: ../../reference/lexical_analysis.rst:653 +#: ../../reference/lexical_analysis.rst:698 msgid "" "b\"data\"\n" "f'{result=}'" @@ -962,35 +1037,35 @@ msgstr "" "b\"data\"\n" "f'{result=}'" -#: ../../reference/lexical_analysis.rst:658 +#: ../../reference/lexical_analysis.rst:703 msgid "The allowed prefixes are:" msgstr "" -#: ../../reference/lexical_analysis.rst:660 +#: ../../reference/lexical_analysis.rst:705 msgid "``b``: :ref:`Bytes literal `" msgstr "" -#: ../../reference/lexical_analysis.rst:661 +#: ../../reference/lexical_analysis.rst:706 msgid "``r``: :ref:`Raw string `" msgstr "" -#: ../../reference/lexical_analysis.rst:662 +#: ../../reference/lexical_analysis.rst:707 msgid "``f``: :ref:`Formatted string literal ` (\"f-string\")" msgstr "" -#: ../../reference/lexical_analysis.rst:663 +#: ../../reference/lexical_analysis.rst:708 msgid "``t``: :ref:`Template string literal ` (\"t-string\")" msgstr "" -#: ../../reference/lexical_analysis.rst:664 +#: ../../reference/lexical_analysis.rst:709 msgid "``u``: No effect (allowed for backwards compatibility)" msgstr "" -#: ../../reference/lexical_analysis.rst:666 +#: ../../reference/lexical_analysis.rst:711 msgid "See the linked sections for details on each type." msgstr "" -#: ../../reference/lexical_analysis.rst:668 +#: ../../reference/lexical_analysis.rst:713 msgid "" "Prefixes are case-insensitive (for example, '``B``' works the same as " "'``b``'). The '``r``' prefix can be combined with '``f``', '``t``' or " @@ -998,220 +1073,220 @@ msgid "" "are also valid prefixes." msgstr "" -#: ../../reference/lexical_analysis.rst:672 +#: ../../reference/lexical_analysis.rst:717 msgid "" "The ``'rb'`` prefix of raw bytes literals has been added as a synonym of " "``'br'``." msgstr "" -#: ../../reference/lexical_analysis.rst:676 +#: ../../reference/lexical_analysis.rst:721 msgid "" "Support for the unicode legacy literal (``u'value'``) was reintroduced to " "simplify the maintenance of dual Python 2.x and 3.x codebases. See :pep:" "`414` for more information." msgstr "" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:727 msgid "Formal grammar" msgstr "" -#: ../../reference/lexical_analysis.rst:684 +#: ../../reference/lexical_analysis.rst:729 msgid "" "String literals, except :ref:`\"f-strings\" ` and :ref:`\"t-" "strings\" `, are described by the following lexical definitions." msgstr "" -#: ../../reference/lexical_analysis.rst:688 +#: ../../reference/lexical_analysis.rst:733 msgid "" "These definitions use :ref:`negative lookaheads ` (``!" "``) to indicate that an ending quote ends the literal." msgstr "" -#: ../../reference/lexical_analysis.rst:706 +#: ../../reference/lexical_analysis.rst:751 msgid "" "Note that as in all lexical definitions, whitespace is significant. In " "particular, the prefix (if any) must be immediately followed by the starting " "quote." msgstr "" -#: ../../reference/lexical_analysis.rst:728 +#: ../../reference/lexical_analysis.rst:773 msgid "Escape sequences" msgstr "跳脫序列" -#: ../../reference/lexical_analysis.rst:730 +#: ../../reference/lexical_analysis.rst:775 msgid "" "Unless an '``r``' or '``R``' prefix is present, escape sequences in string " "and bytes literals are interpreted according to rules similar to those used " "by Standard C. The recognized escape sequences are:" msgstr "" -#: ../../reference/lexical_analysis.rst:738 +#: ../../reference/lexical_analysis.rst:783 msgid "Escape Sequence" msgstr "" -#: ../../reference/lexical_analysis.rst:739 +#: ../../reference/lexical_analysis.rst:784 msgid "Meaning" msgstr "含義" -#: ../../reference/lexical_analysis.rst:740 +#: ../../reference/lexical_analysis.rst:785 msgid "``\\``\\ " msgstr "``\\``\\ " -#: ../../reference/lexical_analysis.rst:741 +#: ../../reference/lexical_analysis.rst:786 msgid ":ref:`string-escape-ignore`" msgstr ":ref:`string-escape-ignore`" -#: ../../reference/lexical_analysis.rst:742 +#: ../../reference/lexical_analysis.rst:787 msgid "``\\\\``" msgstr "``\\\\``" -#: ../../reference/lexical_analysis.rst:743 +#: ../../reference/lexical_analysis.rst:788 msgid ":ref:`Backslash `" msgstr "" -#: ../../reference/lexical_analysis.rst:744 +#: ../../reference/lexical_analysis.rst:789 msgid "``\\'``" msgstr "``\\'``" -#: ../../reference/lexical_analysis.rst:745 +#: ../../reference/lexical_analysis.rst:790 msgid ":ref:`Single quote `" msgstr "" -#: ../../reference/lexical_analysis.rst:746 +#: ../../reference/lexical_analysis.rst:791 msgid "``\\\"``" msgstr "``\\\"``" -#: ../../reference/lexical_analysis.rst:747 +#: ../../reference/lexical_analysis.rst:792 msgid ":ref:`Double quote `" msgstr "" -#: ../../reference/lexical_analysis.rst:748 +#: ../../reference/lexical_analysis.rst:793 msgid "``\\a``" msgstr "``\\a``" -#: ../../reference/lexical_analysis.rst:749 +#: ../../reference/lexical_analysis.rst:794 msgid "ASCII Bell (BEL)" msgstr "" -#: ../../reference/lexical_analysis.rst:750 +#: ../../reference/lexical_analysis.rst:795 msgid "``\\b``" msgstr "``\\b``" -#: ../../reference/lexical_analysis.rst:751 +#: ../../reference/lexical_analysis.rst:796 msgid "ASCII Backspace (BS)" msgstr "" -#: ../../reference/lexical_analysis.rst:752 +#: ../../reference/lexical_analysis.rst:797 msgid "``\\f``" msgstr "``\\f``" -#: ../../reference/lexical_analysis.rst:753 +#: ../../reference/lexical_analysis.rst:798 msgid "ASCII Formfeed (FF)" msgstr "" -#: ../../reference/lexical_analysis.rst:754 +#: ../../reference/lexical_analysis.rst:799 msgid "``\\n``" msgstr "``\\n``" -#: ../../reference/lexical_analysis.rst:755 +#: ../../reference/lexical_analysis.rst:800 msgid "ASCII Linefeed (LF)" msgstr "" -#: ../../reference/lexical_analysis.rst:756 +#: ../../reference/lexical_analysis.rst:801 msgid "``\\r``" msgstr "``\\r``" -#: ../../reference/lexical_analysis.rst:757 +#: ../../reference/lexical_analysis.rst:802 msgid "ASCII Carriage Return (CR)" msgstr "" -#: ../../reference/lexical_analysis.rst:758 +#: ../../reference/lexical_analysis.rst:803 msgid "``\\t``" msgstr "``\\t``" -#: ../../reference/lexical_analysis.rst:759 +#: ../../reference/lexical_analysis.rst:804 msgid "ASCII Horizontal Tab (TAB)" msgstr "" -#: ../../reference/lexical_analysis.rst:760 +#: ../../reference/lexical_analysis.rst:805 msgid "``\\v``" msgstr "``\\v``" -#: ../../reference/lexical_analysis.rst:761 +#: ../../reference/lexical_analysis.rst:806 msgid "ASCII Vertical Tab (VT)" msgstr "" -#: ../../reference/lexical_analysis.rst:762 +#: ../../reference/lexical_analysis.rst:807 msgid ":samp:`\\\\\\\\{ooo}`" msgstr ":samp:`\\\\\\\\{ooo}`" -#: ../../reference/lexical_analysis.rst:763 +#: ../../reference/lexical_analysis.rst:808 msgid ":ref:`string-escape-oct`" msgstr ":ref:`string-escape-oct`" -#: ../../reference/lexical_analysis.rst:764 +#: ../../reference/lexical_analysis.rst:809 msgid ":samp:`\\\\x{hh}`" msgstr ":samp:`\\\\x{hh}`" -#: ../../reference/lexical_analysis.rst:765 +#: ../../reference/lexical_analysis.rst:810 msgid ":ref:`string-escape-hex`" msgstr ":ref:`string-escape-hex`" -#: ../../reference/lexical_analysis.rst:766 +#: ../../reference/lexical_analysis.rst:811 msgid ":samp:`\\\\N\\\\{{name}\\\\}`" msgstr ":samp:`\\\\N\\\\{{name}\\\\}`" -#: ../../reference/lexical_analysis.rst:767 +#: ../../reference/lexical_analysis.rst:812 msgid ":ref:`string-escape-named`" msgstr ":ref:`string-escape-named`" -#: ../../reference/lexical_analysis.rst:768 +#: ../../reference/lexical_analysis.rst:813 msgid ":samp:`\\\\u{xxxx}`" msgstr ":samp:`\\\\u{xxxx}`" -#: ../../reference/lexical_analysis.rst:769 -#: ../../reference/lexical_analysis.rst:771 +#: ../../reference/lexical_analysis.rst:814 +#: ../../reference/lexical_analysis.rst:816 msgid ":ref:`Hexadecimal Unicode character `" msgstr "" -#: ../../reference/lexical_analysis.rst:770 +#: ../../reference/lexical_analysis.rst:815 msgid ":samp:`\\\\U{xxxxxxxx}`" msgstr ":samp:`\\\\U{xxxxxxxx}`" -#: ../../reference/lexical_analysis.rst:776 +#: ../../reference/lexical_analysis.rst:821 msgid "Ignored end of line" msgstr "" -#: ../../reference/lexical_analysis.rst:778 +#: ../../reference/lexical_analysis.rst:823 msgid "A backslash can be added at the end of a line to ignore the newline::" msgstr "" -#: ../../reference/lexical_analysis.rst:780 +#: ../../reference/lexical_analysis.rst:825 msgid "" ">>> 'This string will not include \\\n" "... backslashes or newline characters.'\n" "'This string will not include backslashes or newline characters.'" msgstr "" -#: ../../reference/lexical_analysis.rst:784 +#: ../../reference/lexical_analysis.rst:829 msgid "" "The same result can be achieved using :ref:`triple-quoted strings " "`, or parentheses and :ref:`string literal concatenation `." msgstr "" -#: ../../reference/lexical_analysis.rst:790 +#: ../../reference/lexical_analysis.rst:835 msgid "Escaped characters" msgstr "跳脫字元" -#: ../../reference/lexical_analysis.rst:792 +#: ../../reference/lexical_analysis.rst:837 msgid "" "To include a backslash in a non-:ref:`raw ` Python string " "literal, it must be doubled. The ``\\\\`` escape sequence denotes a single " "backslash character::" msgstr "" -#: ../../reference/lexical_analysis.rst:796 +#: ../../reference/lexical_analysis.rst:841 msgid "" ">>> print('C:\\\\Program Files')\n" "C:\\Program Files" @@ -1219,13 +1294,13 @@ msgstr "" ">>> print('C:\\\\Program Files')\n" "C:\\Program Files" -#: ../../reference/lexical_analysis.rst:799 +#: ../../reference/lexical_analysis.rst:844 msgid "" "Similarly, the ``\\'`` and ``\\\"`` sequences denote the single and double " "quote character, respectively::" msgstr "" -#: ../../reference/lexical_analysis.rst:802 +#: ../../reference/lexical_analysis.rst:847 msgid "" ">>> print('\\' and \\\"')\n" "' and \"" @@ -1233,17 +1308,17 @@ msgstr "" ">>> print('\\' and \\\"')\n" "' and \"" -#: ../../reference/lexical_analysis.rst:808 +#: ../../reference/lexical_analysis.rst:853 msgid "Octal character" msgstr "八進位字元" -#: ../../reference/lexical_analysis.rst:810 +#: ../../reference/lexical_analysis.rst:855 msgid "" "The sequence :samp:`\\\\\\\\{ooo}` denotes a *character* with the octal " "(base 8) value *ooo*::" msgstr "" -#: ../../reference/lexical_analysis.rst:813 +#: ../../reference/lexical_analysis.rst:858 msgid "" ">>> '\\120'\n" "'P'" @@ -1251,41 +1326,41 @@ msgstr "" ">>> '\\120'\n" "'P'" -#: ../../reference/lexical_analysis.rst:816 +#: ../../reference/lexical_analysis.rst:861 msgid "Up to three octal digits (0 through 7) are accepted." msgstr "" -#: ../../reference/lexical_analysis.rst:818 -#: ../../reference/lexical_analysis.rst:843 +#: ../../reference/lexical_analysis.rst:863 +#: ../../reference/lexical_analysis.rst:888 msgid "" "In a bytes literal, *character* means a *byte* with the given value. In a " "string literal, it means a Unicode character with the given value." msgstr "" -#: ../../reference/lexical_analysis.rst:821 +#: ../../reference/lexical_analysis.rst:866 msgid "" "Octal escapes with value larger than ``0o377`` (255) produce a :exc:" "`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:825 +#: ../../reference/lexical_analysis.rst:870 msgid "" "Octal escapes with value larger than ``0o377`` (255) produce a :exc:" "`SyntaxWarning`. In a future Python version they will raise a :exc:" "`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:833 +#: ../../reference/lexical_analysis.rst:878 msgid "Hexadecimal character" msgstr "十六進位字元" -#: ../../reference/lexical_analysis.rst:835 +#: ../../reference/lexical_analysis.rst:880 msgid "" "The sequence :samp:`\\\\x{hh}` denotes a *character* with the hex (base 16) " "value *hh*::" msgstr "" -#: ../../reference/lexical_analysis.rst:838 +#: ../../reference/lexical_analysis.rst:883 msgid "" ">>> '\\x50'\n" "'P'" @@ -1293,21 +1368,21 @@ msgstr "" ">>> '\\x50'\n" "'P'" -#: ../../reference/lexical_analysis.rst:841 +#: ../../reference/lexical_analysis.rst:886 msgid "Unlike in Standard C, exactly two hex digits are required." msgstr "與標準 C 不同,這裡需要剛好兩個十六進位數字。" -#: ../../reference/lexical_analysis.rst:849 +#: ../../reference/lexical_analysis.rst:894 msgid "Named Unicode character" msgstr "" -#: ../../reference/lexical_analysis.rst:851 +#: ../../reference/lexical_analysis.rst:896 msgid "" "The sequence :samp:`\\\\N\\\\{{name}\\\\}` denotes a Unicode character with " "the given *name*::" msgstr "" -#: ../../reference/lexical_analysis.rst:854 +#: ../../reference/lexical_analysis.rst:899 msgid "" ">>> '\\N{LATIN CAPITAL LETTER P}'\n" "'P'\n" @@ -1319,11 +1394,11 @@ msgstr "" ">>> '\\N{SNAKE}'\n" "'🐍'" -#: ../../reference/lexical_analysis.rst:859 +#: ../../reference/lexical_analysis.rst:904 msgid "This sequence cannot appear in :ref:`bytes literals `." msgstr "" -#: ../../reference/lexical_analysis.rst:861 +#: ../../reference/lexical_analysis.rst:906 msgid "" "Support for `name aliases `__ has been added." @@ -1331,11 +1406,11 @@ msgstr "" "已新增對\\ `名稱別名 (name alias) `__\\ 的支援。" -#: ../../reference/lexical_analysis.rst:868 +#: ../../reference/lexical_analysis.rst:913 msgid "Hexadecimal Unicode characters" msgstr "十六進位 Unicode 字元" -#: ../../reference/lexical_analysis.rst:870 +#: ../../reference/lexical_analysis.rst:915 msgid "" "These sequences :samp:`\\\\u{xxxx}` and :samp:`\\\\U{xxxxxxxx}` denote the " "Unicode character with the given hex (base 16) value. Exactly four digits " @@ -1343,7 +1418,7 @@ msgid "" "latter can encode any Unicode character." msgstr "" -#: ../../reference/lexical_analysis.rst:876 +#: ../../reference/lexical_analysis.rst:921 msgid "" ">>> '\\u1234'\n" "'ሴ'\n" @@ -1355,21 +1430,21 @@ msgstr "" ">>> '\\U0001f40d'\n" "'🐍'" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:928 msgid "These sequences cannot appear in :ref:`bytes literals `." msgstr "" -#: ../../reference/lexical_analysis.rst:889 +#: ../../reference/lexical_analysis.rst:934 msgid "Unrecognized escape sequences" msgstr "無法辨識的跳脫序列" -#: ../../reference/lexical_analysis.rst:891 +#: ../../reference/lexical_analysis.rst:936 msgid "" "Unlike in Standard C, all unrecognized escape sequences are left in the " "string unchanged, that is, *the backslash is left in the result*::" msgstr "" -#: ../../reference/lexical_analysis.rst:894 +#: ../../reference/lexical_analysis.rst:939 msgid "" ">>> print('\\q')\n" "\\q\n" @@ -1381,28 +1456,28 @@ msgstr "" ">>> list('\\q')\n" "['\\\\', 'q']" -#: ../../reference/lexical_analysis.rst:899 +#: ../../reference/lexical_analysis.rst:944 msgid "" "Note that for bytes literals, the escape sequences only recognized in string " "literals (``\\N...``, ``\\u...``, ``\\U...``) fall into the category of " "unrecognized escapes." msgstr "" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:948 msgid "Unrecognized escape sequences produce a :exc:`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:906 +#: ../../reference/lexical_analysis.rst:951 msgid "" "Unrecognized escape sequences produce a :exc:`SyntaxWarning`. In a future " "Python version they will raise a :exc:`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:919 +#: ../../reference/lexical_analysis.rst:964 msgid "Bytes literals" msgstr "位元組常數" -#: ../../reference/lexical_analysis.rst:921 +#: ../../reference/lexical_analysis.rst:966 msgid "" ":dfn:`Bytes literals` are always prefixed with '``b``' or '``B``'; they " "produce an instance of the :class:`bytes` type instead of the :class:`str` " @@ -1411,7 +1486,7 @@ msgid "" "`string-escape-hex` or :ref:`string-escape-oct`):" msgstr "" -#: ../../reference/lexical_analysis.rst:927 +#: ../../reference/lexical_analysis.rst:972 msgid "" ">>> b'\\x89PNG\\r\\n\\x1a\\n'\n" "b'\\x89PNG\\r\\n\\x1a\\n'\n" @@ -1423,17 +1498,17 @@ msgstr "" ">>> list(b'\\x89PNG\\r\\n\\x1a\\n')\n" "[137, 80, 78, 71, 13, 10, 26, 10]" -#: ../../reference/lexical_analysis.rst:934 +#: ../../reference/lexical_analysis.rst:979 msgid "" "Similarly, a zero byte must be expressed using an escape sequence (typically " "``\\0`` or ``\\x00``)." msgstr "" -#: ../../reference/lexical_analysis.rst:945 +#: ../../reference/lexical_analysis.rst:990 msgid "Raw string literals" msgstr "原始字串常數" -#: ../../reference/lexical_analysis.rst:947 +#: ../../reference/lexical_analysis.rst:992 msgid "" "Both string and bytes literals may optionally be prefixed with a letter " "'``r``' or '``R``'; such constructs are called :dfn:`raw string literals` " @@ -1442,7 +1517,7 @@ msgid "" "` are not treated specially:" msgstr "" -#: ../../reference/lexical_analysis.rst:954 +#: ../../reference/lexical_analysis.rst:999 msgid "" ">>> r'\\d{4}-\\d{2}-\\d{2}'\n" "'\\\\d{4}-\\\\d{2}-\\\\d{2}'" @@ -1450,7 +1525,7 @@ msgstr "" ">>> r'\\d{4}-\\d{2}-\\d{2}'\n" "'\\\\d{4}-\\\\d{2}-\\\\d{2}'" -#: ../../reference/lexical_analysis.rst:959 +#: ../../reference/lexical_analysis.rst:1004 msgid "" "Even in a raw literal, quotes can be escaped with a backslash, but the " "backslash remains in the result; for example, ``r\"\\\"\"`` is a valid " @@ -1463,11 +1538,11 @@ msgid "" "continuation." msgstr "" -#: ../../reference/lexical_analysis.rst:987 +#: ../../reference/lexical_analysis.rst:1032 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:991 +#: ../../reference/lexical_analysis.rst:1036 msgid "" "A :dfn:`formatted string literal` or :dfn:`f-string` is a string literal " "that is prefixed with '``f``' or '``F``'. These strings may contain " @@ -1476,14 +1551,14 @@ msgid "" "are really expressions evaluated at run time." msgstr "" -#: ../../reference/lexical_analysis.rst:997 +#: ../../reference/lexical_analysis.rst:1042 msgid "" "Escape sequences are decoded like in ordinary string literals (except when a " "literal is also marked as a raw string). After decoding, the grammar for " "the contents of the string is:" msgstr "" -#: ../../reference/lexical_analysis.rst:1011 +#: ../../reference/lexical_analysis.rst:1056 msgid "" "The parts of the string outside curly braces are treated literally, except " "that any doubled curly braces ``'{{'`` or ``'}}'`` are replaced with the " @@ -1496,7 +1571,7 @@ msgid "" "replacement field ends with a closing curly bracket ``'}'``." msgstr "" -#: ../../reference/lexical_analysis.rst:1021 +#: ../../reference/lexical_analysis.rst:1066 msgid "" "Expressions in formatted string literals are treated like regular Python " "expressions surrounded by parentheses, with a few exceptions. An empty " @@ -1510,7 +1585,7 @@ msgid "" "replacement fields must be closed in a different line." msgstr "" -#: ../../reference/lexical_analysis.rst:1032 +#: ../../reference/lexical_analysis.rst:1077 msgid "" ">>> f\"abc{a # This is a comment }\"\n" "... + 3}\"\n" @@ -1520,20 +1595,20 @@ msgstr "" "... + 3}\"\n" "'abc5'" -#: ../../reference/lexical_analysis.rst:1038 +#: ../../reference/lexical_analysis.rst:1083 msgid "" "Prior to Python 3.7, an :keyword:`await` expression and comprehensions " "containing an :keyword:`async for` clause were illegal in the expressions in " "formatted string literals due to a problem with the implementation." msgstr "" -#: ../../reference/lexical_analysis.rst:1043 +#: ../../reference/lexical_analysis.rst:1088 msgid "" "Prior to Python 3.12, comments were not allowed inside f-string replacement " "fields." msgstr "" -#: ../../reference/lexical_analysis.rst:1047 +#: ../../reference/lexical_analysis.rst:1092 msgid "" "When the equal sign ``'='`` is provided, the output will have the expression " "text, the ``'='`` and the evaluated value. Spaces after the opening brace " @@ -1544,18 +1619,18 @@ msgid "" "r'`` is declared." msgstr "" -#: ../../reference/lexical_analysis.rst:1055 +#: ../../reference/lexical_analysis.rst:1100 msgid "The equal sign ``'='``." msgstr "等號 ``'='``。" -#: ../../reference/lexical_analysis.rst:1058 +#: ../../reference/lexical_analysis.rst:1103 msgid "" "If a conversion is specified, the result of evaluating the expression is " "converted before formatting. Conversion ``'!s'`` calls :func:`str` on the " "result, ``'!r'`` calls :func:`repr`, and ``'!a'`` calls :func:`ascii`." msgstr "" -#: ../../reference/lexical_analysis.rst:1062 +#: ../../reference/lexical_analysis.rst:1107 msgid "" "The result is then formatted using the :func:`format` protocol. The format " "specifier is passed to the :meth:`~object.__format__` method of the " @@ -1564,7 +1639,7 @@ msgid "" "value of the whole string." msgstr "" -#: ../../reference/lexical_analysis.rst:1068 +#: ../../reference/lexical_analysis.rst:1113 msgid "" "Top-level format specifiers may include nested replacement fields. These " "nested fields may include their own conversion fields and :ref:`format " @@ -1573,17 +1648,17 @@ msgid "" "as that used by the :meth:`str.format` method." msgstr "" -#: ../../reference/lexical_analysis.rst:1074 +#: ../../reference/lexical_analysis.rst:1119 msgid "" "Formatted string literals may be concatenated, but replacement fields cannot " "be split across literals." msgstr "" -#: ../../reference/lexical_analysis.rst:1077 +#: ../../reference/lexical_analysis.rst:1122 msgid "Some examples of formatted string literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:1079 +#: ../../reference/lexical_analysis.rst:1124 msgid "" ">>> name = \"Fred\"\n" ">>> f\"He said his name is {name!r}.\"\n" @@ -1615,13 +1690,13 @@ msgid "" "'line = \"The mill\\'s closed\" '" msgstr "" -#: ../../reference/lexical_analysis.rst:1109 +#: ../../reference/lexical_analysis.rst:1154 msgid "" "Reusing the outer f-string quoting type inside a replacement field is " "permitted::" msgstr "" -#: ../../reference/lexical_analysis.rst:1112 +#: ../../reference/lexical_analysis.rst:1157 msgid "" ">>> a = dict(x=2)\n" ">>> f\"abc {a[\"x\"]} def\"\n" @@ -1631,19 +1706,19 @@ msgstr "" ">>> f\"abc {a[\"x\"]} def\"\n" "'abc 2 def'" -#: ../../reference/lexical_analysis.rst:1116 +#: ../../reference/lexical_analysis.rst:1161 msgid "" "Prior to Python 3.12, reuse of the same quoting type of the outer f-string " "inside a replacement field was not possible." msgstr "" -#: ../../reference/lexical_analysis.rst:1120 +#: ../../reference/lexical_analysis.rst:1165 msgid "" "Backslashes are also allowed in replacement fields and are evaluated the " "same way as in any other context::" msgstr "" -#: ../../reference/lexical_analysis.rst:1123 +#: ../../reference/lexical_analysis.rst:1168 msgid "" ">>> a = [\"a\", \"b\", \"c\"]\n" ">>> print(f\"List a contains:\\n{\"\\n\".join(a)}\")\n" @@ -1659,19 +1734,19 @@ msgstr "" "b\n" "c" -#: ../../reference/lexical_analysis.rst:1130 +#: ../../reference/lexical_analysis.rst:1175 msgid "" "Prior to Python 3.12, backslashes were not permitted inside an f-string " "replacement field." msgstr "" -#: ../../reference/lexical_analysis.rst:1134 +#: ../../reference/lexical_analysis.rst:1179 msgid "" "Formatted string literals cannot be used as docstrings, even if they do not " "include expressions." msgstr "" -#: ../../reference/lexical_analysis.rst:1139 +#: ../../reference/lexical_analysis.rst:1184 msgid "" ">>> def foo():\n" "... f\"Not a docstring\"\n" @@ -1685,17 +1760,17 @@ msgstr "" ">>> foo.__doc__ is None\n" "True" -#: ../../reference/lexical_analysis.rst:1145 +#: ../../reference/lexical_analysis.rst:1190 msgid "" "See also :pep:`498` for the proposal that added formatted string literals, " "and :meth:`str.format`, which uses a related format string mechanism." msgstr "" -#: ../../reference/lexical_analysis.rst:1153 +#: ../../reference/lexical_analysis.rst:1198 msgid "t-strings" msgstr "t-string(t 字串)" -#: ../../reference/lexical_analysis.rst:1157 +#: ../../reference/lexical_analysis.rst:1202 msgid "" "A :dfn:`template string literal` or :dfn:`t-string` is a string literal that " "is prefixed with '``t``' or '``T``'. These strings follow the same syntax " @@ -1703,13 +1778,13 @@ msgid "" "the following differences:" msgstr "" -#: ../../reference/lexical_analysis.rst:1162 +#: ../../reference/lexical_analysis.rst:1207 msgid "" "Rather than evaluating to a ``str`` object, template string literals " "evaluate to a :class:`string.templatelib.Template` object." msgstr "" -#: ../../reference/lexical_analysis.rst:1165 +#: ../../reference/lexical_analysis.rst:1210 msgid "" "The :func:`format` protocol is not used. Instead, the format specifier and " "conversions (if any) are passed to a new :class:`~string.templatelib." @@ -1718,7 +1793,7 @@ msgid "" "Template` object to decide how to handle format specifiers and conversions." msgstr "" -#: ../../reference/lexical_analysis.rst:1172 +#: ../../reference/lexical_analysis.rst:1217 msgid "" "Format specifiers containing nested replacement fields are evaluated " "eagerly, prior to being passed to the :class:`~string.templatelib." @@ -1728,7 +1803,7 @@ msgid "" "to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" -#: ../../reference/lexical_analysis.rst:1180 +#: ../../reference/lexical_analysis.rst:1225 msgid "" "When the equals sign ``'='`` is provided in an interpolation expression, the " "text of the expression is appended to the literal string that precedes the " @@ -1740,17 +1815,17 @@ msgid "" "behaviour." msgstr "" -#: ../../reference/lexical_analysis.rst:1194 +#: ../../reference/lexical_analysis.rst:1239 msgid "Numeric literals" msgstr "" -#: ../../reference/lexical_analysis.rst:1200 +#: ../../reference/lexical_analysis.rst:1245 msgid "" ":data:`~token.NUMBER` tokens represent numeric literals, of which there are " "three types: integers, floating-point numbers, and imaginary numbers." msgstr "" -#: ../../reference/lexical_analysis.rst:1208 +#: ../../reference/lexical_analysis.rst:1253 msgid "" "The numeric value of a numeric literal is the same as if it were passed as a " "string to the :class:`int`, :class:`float` or :class:`complex` class " @@ -1758,21 +1833,21 @@ msgid "" "constructors are also valid literals." msgstr "" -#: ../../reference/lexical_analysis.rst:1213 +#: ../../reference/lexical_analysis.rst:1258 msgid "" "Numeric literals do not include a sign; a phrase like ``-1`` is actually an " "expression composed of the unary operator '``-``' and the literal ``1``." msgstr "" -#: ../../reference/lexical_analysis.rst:1227 +#: ../../reference/lexical_analysis.rst:1272 msgid "Integer literals" msgstr "" -#: ../../reference/lexical_analysis.rst:1229 +#: ../../reference/lexical_analysis.rst:1274 msgid "Integer literals denote whole numbers. For example::" msgstr "" -#: ../../reference/lexical_analysis.rst:1231 +#: ../../reference/lexical_analysis.rst:1276 msgid "" "7\n" "3\n" @@ -1782,24 +1857,24 @@ msgstr "" "3\n" "2147483647" -#: ../../reference/lexical_analysis.rst:1235 +#: ../../reference/lexical_analysis.rst:1280 msgid "" "There is no limit for the length of integer literals apart from what can be " "stored in available memory::" msgstr "" -#: ../../reference/lexical_analysis.rst:1238 +#: ../../reference/lexical_analysis.rst:1283 msgid "7922816251426433759354395033679228162514264337593543950336" msgstr "7922816251426433759354395033679228162514264337593543950336" -#: ../../reference/lexical_analysis.rst:1240 +#: ../../reference/lexical_analysis.rst:1285 msgid "" "Underscores can be used to group digits for enhanced readability, and are " "ignored for determining the numeric value of the literal. For example, the " "following literals are equivalent::" msgstr "" -#: ../../reference/lexical_analysis.rst:1244 +#: ../../reference/lexical_analysis.rst:1289 msgid "" "100_000_000_000\n" "100000000000\n" @@ -1809,13 +1884,13 @@ msgstr "" "100000000000\n" "1_00_00_00_00_000" -#: ../../reference/lexical_analysis.rst:1248 +#: ../../reference/lexical_analysis.rst:1293 msgid "" "Underscores can only occur between digits. For example, ``_123``, ``321_``, " "and ``123__321`` are *not* valid literals." msgstr "" -#: ../../reference/lexical_analysis.rst:1251 +#: ../../reference/lexical_analysis.rst:1296 msgid "" "Integers can be specified in binary (base 2), octal (base 8), or hexadecimal " "(base 16) using the prefixes ``0b``, ``0o`` and ``0x``, respectively. " @@ -1823,7 +1898,7 @@ msgid "" "case-insensitive. For example::" msgstr "" -#: ../../reference/lexical_analysis.rst:1256 +#: ../../reference/lexical_analysis.rst:1301 msgid "" "0b100110111\n" "0b_1110_0101\n" @@ -1839,47 +1914,47 @@ msgstr "" "0xdeadbeef\n" "0xDead_Beef" -#: ../../reference/lexical_analysis.rst:1263 +#: ../../reference/lexical_analysis.rst:1308 msgid "" "An underscore can follow the base specifier. For example, ``0x_1f`` is a " "valid literal, but ``0_x1f`` and ``0x__1f`` are not." msgstr "" -#: ../../reference/lexical_analysis.rst:1267 +#: ../../reference/lexical_analysis.rst:1312 msgid "" "Leading zeros in a non-zero decimal number are not allowed. For example, " "``0123`` is not a valid literal. This is for disambiguation with C-style " "octal literals, which Python used before version 3.0." msgstr "" -#: ../../reference/lexical_analysis.rst:1272 +#: ../../reference/lexical_analysis.rst:1317 msgid "" "Formally, integer literals are described by the following lexical " "definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:1289 -#: ../../reference/lexical_analysis.rst:1353 +#: ../../reference/lexical_analysis.rst:1334 +#: ../../reference/lexical_analysis.rst:1398 msgid "Underscores are now allowed for grouping purposes in literals." msgstr "" -#: ../../reference/lexical_analysis.rst:1300 +#: ../../reference/lexical_analysis.rst:1345 msgid "Floating-point literals" msgstr "浮點數常數 (Floating-point literals)" -#: ../../reference/lexical_analysis.rst:1302 +#: ../../reference/lexical_analysis.rst:1347 msgid "" "Floating-point (float) literals, such as ``3.14`` or ``1.5``, denote :ref:" "`approximations of real numbers `." msgstr "" -#: ../../reference/lexical_analysis.rst:1305 +#: ../../reference/lexical_analysis.rst:1350 msgid "" "They consist of *integer* and *fraction* parts, each composed of decimal " "digits. The parts are separated by a decimal point, ``.``::" msgstr "" -#: ../../reference/lexical_analysis.rst:1308 +#: ../../reference/lexical_analysis.rst:1353 msgid "" "2.71828\n" "4.0" @@ -1887,19 +1962,19 @@ msgstr "" "2.71828\n" "4.0" -#: ../../reference/lexical_analysis.rst:1311 +#: ../../reference/lexical_analysis.rst:1356 msgid "" "Unlike in integer literals, leading zeros are allowed. For example, " "``077.010`` is legal, and denotes the same number as ``77.01``." msgstr "" -#: ../../reference/lexical_analysis.rst:1314 +#: ../../reference/lexical_analysis.rst:1359 msgid "" "As in integer literals, single underscores may occur between digits to help " "readability::" msgstr "" -#: ../../reference/lexical_analysis.rst:1317 +#: ../../reference/lexical_analysis.rst:1362 msgid "" "96_485.332_123\n" "3.14_15_93" @@ -1907,11 +1982,11 @@ msgstr "" "96_485.332_123\n" "3.14_15_93" -#: ../../reference/lexical_analysis.rst:1320 +#: ../../reference/lexical_analysis.rst:1365 msgid "Either of these parts, but not both, can be empty. For example::" msgstr "" -#: ../../reference/lexical_analysis.rst:1322 +#: ../../reference/lexical_analysis.rst:1367 msgid "" "10. # (equivalent to 10.0)\n" ".001 # (equivalent to 0.001)" @@ -1919,7 +1994,7 @@ msgstr "" "10. # (相當於 10.0)\n" ".001 # (相當於 0.001)" -#: ../../reference/lexical_analysis.rst:1325 +#: ../../reference/lexical_analysis.rst:1370 msgid "" "Optionally, the integer and fraction may be followed by an *exponent*: the " "letter ``e`` or ``E``, followed by an optional sign, ``+`` or ``-``, and a " @@ -1927,20 +2002,20 @@ msgid "" "``E`` represents \"times ten raised to the power of\"::" msgstr "" -#: ../../reference/lexical_analysis.rst:1330 +#: ../../reference/lexical_analysis.rst:1375 msgid "" "1.0e3 # (represents 1.0×10³, or 1000.0)\n" "1.166e-5 # (represents 1.166×10⁻⁵, or 0.00001166)\n" "6.02214076e+23 # (represents 6.02214076×10²³, or 602214076000000000000000.)" msgstr "" -#: ../../reference/lexical_analysis.rst:1334 +#: ../../reference/lexical_analysis.rst:1379 msgid "" "In floats with only integer and exponent parts, the decimal point may be " "omitted::" msgstr "" -#: ../../reference/lexical_analysis.rst:1337 +#: ../../reference/lexical_analysis.rst:1382 msgid "" "1e3 # (equivalent to 1.e3 and 1.0e3)\n" "0e0 # (equivalent to 0.)" @@ -1948,35 +2023,35 @@ msgstr "" "1e3 # (相當於 1.e3 和 1.0e3)\n" "0e0 # (相當於 0.)" -#: ../../reference/lexical_analysis.rst:1340 +#: ../../reference/lexical_analysis.rst:1385 msgid "" "Formally, floating-point literals are described by the following lexical " "definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:1362 +#: ../../reference/lexical_analysis.rst:1407 msgid "Imaginary literals" msgstr "" -#: ../../reference/lexical_analysis.rst:1364 +#: ../../reference/lexical_analysis.rst:1409 msgid "" "Python has :ref:`complex number ` objects, but no complex " "literals. Instead, *imaginary literals* denote complex numbers with a zero " "real part." msgstr "" -#: ../../reference/lexical_analysis.rst:1369 +#: ../../reference/lexical_analysis.rst:1414 msgid "" "For example, in math, the complex number 3+4.2\\ *i* is written as the real " "number 3 added to the imaginary number 4.2\\ *i*. Python uses a similar " "syntax, except the imaginary unit is written as ``j`` rather than *i*::" msgstr "" -#: ../../reference/lexical_analysis.rst:1374 +#: ../../reference/lexical_analysis.rst:1419 msgid "3+4.2j" msgstr "3+4.2j" -#: ../../reference/lexical_analysis.rst:1376 +#: ../../reference/lexical_analysis.rst:1421 msgid "" "This is an expression composed of the :ref:`integer literal ` " "``3``, the :ref:`operator ` '``+``', and the :ref:`imaginary " @@ -1984,23 +2059,23 @@ msgid "" "whitespace is allowed between them::" msgstr "" -#: ../../reference/lexical_analysis.rst:1382 +#: ../../reference/lexical_analysis.rst:1427 msgid "3 + 4.2j" msgstr "3 + 4.2j" -#: ../../reference/lexical_analysis.rst:1384 +#: ../../reference/lexical_analysis.rst:1429 msgid "" "No whitespace is allowed *within* each token. In particular, the ``j`` " "suffix, may not be separated from the number before it." msgstr "" -#: ../../reference/lexical_analysis.rst:1388 +#: ../../reference/lexical_analysis.rst:1433 msgid "" "The number before the ``j`` has the same syntax as a floating-point literal. " "Thus, the following are valid imaginary literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:1391 +#: ../../reference/lexical_analysis.rst:1436 msgid "" "4.2j\n" "3.14j\n" @@ -2018,14 +2093,14 @@ msgstr "" "3.14e-10j\n" "3.14_15_93j" -#: ../../reference/lexical_analysis.rst:1399 +#: ../../reference/lexical_analysis.rst:1444 msgid "" "Unlike in a floating-point literal the decimal point can be omitted if the " "imaginary number only has an integer part. The number is still evaluated as " "a floating-point number, not an integer::" msgstr "" -#: ../../reference/lexical_analysis.rst:1403 +#: ../../reference/lexical_analysis.rst:1448 msgid "" "10j\n" "0j\n" @@ -2035,26 +2110,26 @@ msgstr "" "0j\n" "1000000000000000000000000j # 相當於 1e+24j" -#: ../../reference/lexical_analysis.rst:1407 +#: ../../reference/lexical_analysis.rst:1452 msgid "" "The ``j`` suffix is case-insensitive. That means you can use ``J`` instead::" msgstr "" -#: ../../reference/lexical_analysis.rst:1410 +#: ../../reference/lexical_analysis.rst:1455 msgid "3.14J # equivalent to 3.14j" msgstr "" -#: ../../reference/lexical_analysis.rst:1412 +#: ../../reference/lexical_analysis.rst:1457 msgid "" "Formally, imaginary literals are described by the following lexical " "definition:" msgstr "" -#: ../../reference/lexical_analysis.rst:1425 +#: ../../reference/lexical_analysis.rst:1470 msgid "Operators and delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:1431 +#: ../../reference/lexical_analysis.rst:1476 msgid "" "The following grammar defines :dfn:`operator` and :dfn:`delimiter` tokens, " "that is, the generic :data:`~token.OP` token type. A :ref:`list of these " @@ -2062,14 +2137,14 @@ msgid "" "the :mod:`!token` module documentation." msgstr "" -#: ../../reference/lexical_analysis.rst:1460 +#: ../../reference/lexical_analysis.rst:1505 msgid "" "Generally, *operators* are used to combine :ref:`expressions `, " "while *delimiters* serve other purposes. However, there is no clear, formal " "distinction between the two categories." msgstr "" -#: ../../reference/lexical_analysis.rst:1464 +#: ../../reference/lexical_analysis.rst:1509 msgid "" "Some tokens can serve as either operators or delimiters, depending on usage. " "For example, ``*`` is both the multiplication operator and a delimiter used " @@ -2077,20 +2152,20 @@ msgid "" "delimiter that introduces decorators." msgstr "" -#: ../../reference/lexical_analysis.rst:1469 +#: ../../reference/lexical_analysis.rst:1514 msgid "" "For some tokens, the distinction is unclear. For example, some people " "consider ``.``, ``(``, and ``)`` to be delimiters, while others see the :py:" "func:`getattr` operator and the function call operator(s)." msgstr "" -#: ../../reference/lexical_analysis.rst:1473 +#: ../../reference/lexical_analysis.rst:1518 msgid "" "Some of Python's operators, like ``and``, ``or``, and ``not in``, use :ref:" "`keyword ` tokens rather than \"symbols\" (operator tokens)." msgstr "" -#: ../../reference/lexical_analysis.rst:1476 +#: ../../reference/lexical_analysis.rst:1521 msgid "" "A sequence of three consecutive periods (``...``) has a special meaning as " "an :py:data:`Ellipsis` literal." @@ -2118,7 +2193,7 @@ msgstr "logical line(邏輯列)" #: ../../reference/lexical_analysis.rst:100 #: ../../reference/lexical_analysis.rst:205 -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "physical line" msgstr "physical line(物理列)" @@ -2200,306 +2275,306 @@ msgstr "identifier(識別器)" msgid "name" msgstr "name(名稱)" -#: ../../reference/lexical_analysis.rst:463 -#: ../../reference/lexical_analysis.rst:487 +#: ../../reference/lexical_analysis.rst:419 +#: ../../reference/lexical_analysis.rst:443 msgid "keyword" msgstr "keyword(關鍵字)" -#: ../../reference/lexical_analysis.rst:463 +#: ../../reference/lexical_analysis.rst:419 msgid "reserved word" msgstr "reserved word(保留字)" -#: ../../reference/lexical_analysis.rst:487 +#: ../../reference/lexical_analysis.rst:443 msgid "soft keyword" msgstr "soft keyword(軟關鍵字)" -#: ../../reference/lexical_analysis.rst:507 +#: ../../reference/lexical_analysis.rst:463 msgid "_, identifiers" msgstr "_, identifiers(識別器)" -#: ../../reference/lexical_analysis.rst:507 +#: ../../reference/lexical_analysis.rst:463 msgid "__, identifiers" msgstr "__, identifiers(識別器)" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:608 msgid "literal" msgstr "literal(常數)" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:608 msgid "constant" msgstr "constant(常數)" -#: ../../reference/lexical_analysis.rst:575 -#: ../../reference/lexical_analysis.rst:618 -#: ../../reference/lexical_analysis.rst:643 +#: ../../reference/lexical_analysis.rst:620 +#: ../../reference/lexical_analysis.rst:663 +#: ../../reference/lexical_analysis.rst:688 msgid "string literal" msgstr "string literal(字串常數)" -#: ../../reference/lexical_analysis.rst:575 -#: ../../reference/lexical_analysis.rst:911 +#: ../../reference/lexical_analysis.rst:620 +#: ../../reference/lexical_analysis.rst:956 msgid "bytes literal" msgstr "bytes literal(位元組常數)" -#: ../../reference/lexical_analysis.rst:575 +#: ../../reference/lexical_analysis.rst:620 msgid "ASCII" msgstr "ASCII" -#: ../../reference/lexical_analysis.rst:575 +#: ../../reference/lexical_analysis.rst:620 msgid "' (single quote)" msgstr "' (單引號)" -#: ../../reference/lexical_analysis.rst:575 +#: ../../reference/lexical_analysis.rst:620 msgid "\" (double quote)" msgstr "\" (雙引號)" -#: ../../reference/lexical_analysis.rst:618 +#: ../../reference/lexical_analysis.rst:663 msgid "triple-quoted string" msgstr "triple-quoted string(三引號字串)" -#: ../../reference/lexical_analysis.rst:618 +#: ../../reference/lexical_analysis.rst:663 msgid "\"\"\"" msgstr "\"\"\"" -#: ../../reference/lexical_analysis.rst:618 +#: ../../reference/lexical_analysis.rst:663 msgid "'''" msgstr "'''" -#: ../../reference/lexical_analysis.rst:643 +#: ../../reference/lexical_analysis.rst:688 msgid "u'" msgstr "u'" -#: ../../reference/lexical_analysis.rst:643 +#: ../../reference/lexical_analysis.rst:688 msgid "u\"" msgstr "u\"" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "Standard C" msgstr "Standard C(標準 C)" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "C" msgstr "C" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\\\" msgstr "\\\\" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\a" msgstr "\\a" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\b" msgstr "\\b" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\f" msgstr "\\f" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\n" msgstr "\\n" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\r" msgstr "\\r" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\t" msgstr "\\t" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\v" msgstr "\\v" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\x" msgstr "\\x" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\N" msgstr "\\N" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\u" msgstr "\\u" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:755 msgid "\\U" msgstr "\\U" -#: ../../reference/lexical_analysis.rst:886 +#: ../../reference/lexical_analysis.rst:931 msgid "unrecognized escape sequence" msgstr "unrecognized escape sequence(無法辨識的跳脫序列)" -#: ../../reference/lexical_analysis.rst:911 +#: ../../reference/lexical_analysis.rst:956 msgid "b'" msgstr "b'" -#: ../../reference/lexical_analysis.rst:911 +#: ../../reference/lexical_analysis.rst:956 msgid "b\"" msgstr "b\"" -#: ../../reference/lexical_analysis.rst:938 +#: ../../reference/lexical_analysis.rst:983 msgid "r'" msgstr "r'" -#: ../../reference/lexical_analysis.rst:938 +#: ../../reference/lexical_analysis.rst:983 msgid "raw string literal" msgstr "raw string literal(原始字串常數)" -#: ../../reference/lexical_analysis.rst:938 +#: ../../reference/lexical_analysis.rst:983 msgid "r\"" msgstr "r\"" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "formatted string literal" msgstr "formatted string literal(格式化字串常數)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "string" msgstr "string(字串)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "f'" msgstr "f'" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "f\"" msgstr "f\"" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "! (exclamation)" msgstr "! (驚嘆號)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid ": (colon)" msgstr ": (冒號)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "= (equals)" msgstr "= (等號)" -#: ../../reference/lexical_analysis.rst:969 +#: ../../reference/lexical_analysis.rst:1014 msgid "for help in debugging using string literals" msgstr "for help in debugging using string literals(使用字串常數進行除錯)" -#: ../../reference/lexical_analysis.rst:1196 +#: ../../reference/lexical_analysis.rst:1241 msgid "number" msgstr "number(數字)" -#: ../../reference/lexical_analysis.rst:1196 +#: ../../reference/lexical_analysis.rst:1241 msgid "numeric literal" msgstr "numeric literal(數值常數)" -#: ../../reference/lexical_analysis.rst:1196 -#: ../../reference/lexical_analysis.rst:1218 +#: ../../reference/lexical_analysis.rst:1241 +#: ../../reference/lexical_analysis.rst:1263 msgid "integer literal" msgstr "integer literal(整數常數)" -#: ../../reference/lexical_analysis.rst:1196 +#: ../../reference/lexical_analysis.rst:1241 msgid "floating-point literal" msgstr "floating-point literal(浮點數常數)" -#: ../../reference/lexical_analysis.rst:1196 +#: ../../reference/lexical_analysis.rst:1241 msgid "hexadecimal literal" msgstr "hexadecimal literal(十六進位常數)" -#: ../../reference/lexical_analysis.rst:1196 +#: ../../reference/lexical_analysis.rst:1241 msgid "octal literal" msgstr "octal literal(八進位常數)" -#: ../../reference/lexical_analysis.rst:1196 +#: ../../reference/lexical_analysis.rst:1241 msgid "binary literal" msgstr "binary literal(二進位常數)" -#: ../../reference/lexical_analysis.rst:1196 +#: ../../reference/lexical_analysis.rst:1241 msgid "decimal literal" msgstr "decimal literal(十進位常數)" -#: ../../reference/lexical_analysis.rst:1196 +#: ../../reference/lexical_analysis.rst:1241 msgid "imaginary literal" msgstr "imaginary literal(虛數常數)" -#: ../../reference/lexical_analysis.rst:1196 +#: ../../reference/lexical_analysis.rst:1241 msgid "complex literal" msgstr "complex literal(複數常數)" -#: ../../reference/lexical_analysis.rst:1218 +#: ../../reference/lexical_analysis.rst:1263 msgid "0b" msgstr "0b" -#: ../../reference/lexical_analysis.rst:1218 +#: ../../reference/lexical_analysis.rst:1263 msgid "0o" msgstr "0o" -#: ../../reference/lexical_analysis.rst:1218 +#: ../../reference/lexical_analysis.rst:1263 msgid "0x" msgstr "0x" -#: ../../reference/lexical_analysis.rst:1218 -#: ../../reference/lexical_analysis.rst:1293 +#: ../../reference/lexical_analysis.rst:1263 +#: ../../reference/lexical_analysis.rst:1338 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../reference/lexical_analysis.rst:1218 -#: ../../reference/lexical_analysis.rst:1293 -#: ../../reference/lexical_analysis.rst:1357 +#: ../../reference/lexical_analysis.rst:1263 +#: ../../reference/lexical_analysis.rst:1338 +#: ../../reference/lexical_analysis.rst:1402 msgid "in numeric literal" msgstr "於數值常數中" -#: ../../reference/lexical_analysis.rst:1293 +#: ../../reference/lexical_analysis.rst:1338 msgid ". (dot)" msgstr ". (點)" -#: ../../reference/lexical_analysis.rst:1293 +#: ../../reference/lexical_analysis.rst:1338 msgid "e" msgstr "e" -#: ../../reference/lexical_analysis.rst:1357 +#: ../../reference/lexical_analysis.rst:1402 msgid "j" msgstr "j" -#: ../../reference/lexical_analysis.rst:1427 +#: ../../reference/lexical_analysis.rst:1472 msgid "operators" msgstr "operators(運算子)" -#: ../../reference/lexical_analysis.rst:1427 +#: ../../reference/lexical_analysis.rst:1472 msgid "delimiters" msgstr "delimiters(分隔符號)" From 27209ce04c87a863cd1ed6e4e67b22e8bd23125f Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Thu, 4 Dec 2025 15:45:00 +0800 Subject: [PATCH 13/13] fix: resolve fuzzy entries --- c-api/conversion.po | 14 +++----------- c-api/import.po | 6 +++--- c-api/init.po | 13 ++++--------- howto/free-threading-python.po | 16 ---------------- library/unittest.po | 3 +-- library/zipfile.po | 12 ++---------- reference/lexical_analysis.po | 6 ++---- 7 files changed, 15 insertions(+), 55 deletions(-) diff --git a/c-api/conversion.po b/c-api/conversion.po index 6d62c65920..7cd313de67 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -292,14 +292,13 @@ msgstr "" "``NULL``。呼叫者負責透過呼叫 :c:func:`PyMem_Free` 來釋放回傳的字串。" #: ../../c-api/conversion.rst:168 -#, fuzzy msgid "" "Case insensitive comparison of strings. These functions work almost " "identically to :c:func:`!strcmp` and :c:func:`!strncmp` (respectively), " "except that they ignore the case of ASCII characters." msgstr "" -"不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strncmp` 相同,只是它" -"忽略大小寫。" +"不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strcmp` 和 :c:func:`!strncmp` " +"相同,只是它們忽略大小寫。" #: ../../c-api/conversion.rst:172 msgid "" @@ -320,7 +319,7 @@ msgstr "" #: ../../c-api/conversion.rst:185 msgid "Case insensitive comparison of strings." -msgstr "" +msgstr "不區分大小寫的字串比較。" #: ../../c-api/conversion.rst:187 msgid "" @@ -387,10 +386,3 @@ msgstr "" #: ../../c-api/conversion.rst:246 msgid "Return the uppercase equivalent of the character *c*." msgstr "" - -#~ msgid "" -#~ "Case insensitive comparison of strings. The function works almost " -#~ "identically to :c:func:`!strcmp` except that it ignores the case." -#~ msgstr "" -#~ "不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strcmp` 相同,只是" -#~ "它忽略大小寫。" diff --git a/c-api/import.po b/c-api/import.po index bea64933b6..fa6dd95b73 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -489,14 +489,14 @@ msgstr "" "`PyImport_ExtendInittab` 必須在每次 Python 初始化之前被呼叫。" #: ../../c-api/import.rst:332 -#, fuzzy msgid "" "The table of built-in modules used by Python initialization. Do not use this " "directly; use :c:func:`PyImport_AppendInittab` and :c:func:" "`PyImport_ExtendInittab` instead." msgstr "" -"如果 Python 被多次初始化,:c:func:`PyImport_AppendInittab` 或 :c:func:" -"`PyImport_ExtendInittab` 必須在每次 Python 初始化之前被呼叫。" +"Python 初始化所使用的內建模組表格。請勿直接使用它," +"請改用 :c:func:`PyImport_AppendInittab` 與 :c:func:" +"`PyImport_ExtendInittab`。" #: ../../c-api/import.rst:339 msgid "Import the module *mod_name* and get its attribute *attr_name*." diff --git a/c-api/init.po b/c-api/init.po index 986d54f8a4..2932196ad1 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -3367,9 +3367,8 @@ msgstr "" #: ../../c-api/init.rst:2786 ../../c-api/init.rst:2804 #: ../../c-api/init.rst:2812 ../../c-api/init.rst:2835 #: ../../c-api/init.rst:2919 ../../c-api/init.rst:2927 -#, fuzzy msgid "The caller does not need to hold an :term:`attached thread state`." -msgstr "呼叫者必須擁有一個 :term:`attached thread state`。" +msgstr "呼叫者不需擁有一個 :term:`attached thread state`。" #: ../../c-api/init.rst:2756 msgid "" @@ -3471,16 +3470,14 @@ msgid "Return the identifier of the current thread, which will never be zero." msgstr "" #: ../../c-api/init.rst:2842 ../../c-api/init.rst:2874 -#, fuzzy msgid "" "This function cannot fail, and the caller does not need to hold an :term:" "`attached thread state`." -msgstr "呼叫者必須擁有一個 :term:`attached thread state`。" +msgstr "" #: ../../c-api/init.rst:2846 -#, fuzzy msgid ":py:func:`threading.get_ident`" -msgstr ":c:func:`PyThreadState_Get`" +msgstr ":py:func:`threading.get_ident`" #: ../../c-api/init.rst:2851 msgid "" @@ -3496,7 +3493,6 @@ msgid "" msgstr "" #: ../../c-api/init.rst:2858 -#, fuzzy msgid "The caller must hold an :term:`attached thread state`." msgstr "呼叫者必須擁有一個 :term:`attached thread state`。" @@ -3517,9 +3513,8 @@ msgid "" msgstr "" #: ../../c-api/init.rst:2878 -#, fuzzy msgid ":py:func:`threading.get_native_id`" -msgstr ":c:func:`PyThreadState_Get`" +msgstr ":py:func:`threading.get_native_id`" #: ../../c-api/init.rst:2883 msgid "" diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index 74260cfd88..8ecf25ae55 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -259,19 +259,3 @@ msgid "" "catch_warnings` modifies the global filters list, which is not thread-safe. " "See the :mod:`warnings` module for more details." msgstr "" - -#~ msgid "" -#~ ":ref:`function ` objects declared at the module level" -#~ msgstr "在模組層級宣告的\\ :ref:`函式 `\\ 物件" - -#~ msgid ":ref:`method ` descriptors" -#~ msgstr ":ref:`方法 `\\ 描述器" - -#~ msgid ":ref:`code ` objects" -#~ msgstr ":ref:`程式碼 `\\ 物件" - -#~ msgid ":term:`module` objects and their dictionaries" -#~ msgstr ":term:`模組 `\\ 物件及其字典" - -#~ msgid ":ref:`classes ` (type objects)" -#~ msgstr ":ref:`類別 `\\ (型別物件)" diff --git a/library/unittest.po b/library/unittest.po index c9ff803736..2038b1ddf6 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -1755,9 +1755,8 @@ msgid "Added the ability to use :meth:`assertRaises` as a context manager." msgstr "新增 :meth:`assertRaises` 可作為情境管理器使用的能力。" #: ../../library/unittest.rst:1038 -#, fuzzy msgid "Added the :attr:`!exception` attribute." -msgstr "新增 :attr:`exception` 屬性。" +msgstr "新增 :attr:`!exception` 屬性。" #: ../../library/unittest.rst:1041 ../../library/unittest.rst:1067 #: ../../library/unittest.rst:1108 ../../library/unittest.rst:1131 diff --git a/library/zipfile.po b/library/zipfile.po index 5894863653..7012fa7d32 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -39,7 +39,6 @@ msgstr "" "Application Note`_ 中定義的格式有所理解。" #: ../../library/zipfile.rst:19 -#, fuzzy msgid "" "This module does not handle multipart ZIP files. It can handle ZIP files " "that use the ZIP64 extensions (that is ZIP files that are more than 4 GiB in " @@ -47,7 +46,7 @@ msgid "" "cannot create an encrypted file. Decryption is extremely slow as it is " "implemented in native Python rather than C." msgstr "" -"本模組目前不處理多磁碟 ZIP 檔案。它可以處理使用 ZIP64 擴充(即大於 4 GiB 的 " +"本模組不處理多組件 (multipart) ZIP 檔案。它可以處理使用 ZIP64 擴充(即大於 4 GiB 的 " "ZIP 檔案)的 ZIP 檔案。它支援解密 ZIP 封存檔案中的加密檔案,但目前無法建立加" "密檔案。解密速度極慢,因為它是在原生 Python 中實作,而不是 C。" @@ -221,7 +220,6 @@ msgid "" msgstr "關於 Info-ZIP 專案的 ZIP 封存程式和開發函式庫的資訊。" #: ../../library/zipfile.rst:179 -#, fuzzy msgid "ZipFile objects" msgstr "ZipFile 物件" @@ -356,12 +354,11 @@ msgstr "" " myzip.write('eggs.txt')" #: ../../library/zipfile.rst:250 -#, fuzzy msgid "" "*metadata_encoding* is an instance-wide setting for the ZipFile. It is not " "possible to set this on a per-member basis." msgstr "" -"*metadata_encoding* 是 ZipFile 的一個實例範圍設定。目前無法以每個成員為基礎來" +"*metadata_encoding* 是 ZipFile 的一個實例範圍設定。無法以每個成員為基礎來" "設定此項。" #: ../../library/zipfile.rst:253 @@ -861,7 +858,6 @@ msgstr "" "65535 位元組。超過此長度的註解將被截斷。" #: ../../library/zipfile.rst:575 -#, fuzzy msgid "Path objects" msgstr "Path 物件" @@ -1037,7 +1033,6 @@ msgstr "" "用 ``zipp.Path`` 來取代 ``zipfile.Path`` 以提早使用變更。" #: ../../library/zipfile.rst:711 -#, fuzzy msgid "PyZipFile objects" msgstr "PyZipFile 物件" @@ -1168,7 +1163,6 @@ msgid "Recursion sorts directory entries." msgstr "遞迴會對目錄條目進行排序。" #: ../../library/zipfile.rst:788 -#, fuzzy msgid "ZipInfo objects" msgstr "ZipInfo 物件" @@ -1384,7 +1378,6 @@ msgid "Size of the uncompressed file." msgstr "未壓縮檔案的大小。" #: ../../library/zipfile.rst:958 -#, fuzzy msgid "Command-line interface" msgstr "命令列介面" @@ -1483,7 +1476,6 @@ msgstr "" "失敗。" #: ../../library/zipfile.rst:1033 -#, fuzzy msgid "File system limitations" msgstr "檔案系統限制" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index ee4bb73580..25fe4cdb65 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -568,9 +568,8 @@ msgid "uppercase and lowercase letters (``A-Z`` and ``a-z``)," msgstr "" #: ../../reference/lexical_analysis.rst:392 -#, fuzzy msgid "the underscore (``_``)," -msgstr "底線 (``_``)" +msgstr "底線 (``_``)," #: ../../reference/lexical_analysis.rst:393 msgid "" @@ -745,9 +744,8 @@ msgid "" msgstr "" #: ../../reference/lexical_analysis.rst:517 -#, fuzzy msgid "Non-ASCII characters in names" -msgstr "非 ASCII 字元" +msgstr "名稱中的非 ASCII 字元" #: ../../reference/lexical_analysis.rst:519 msgid ""