From 0a191911a312416bb5b93cec70d9d26742f71a22 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 6 Apr 2023 06:22:17 +0000 Subject: [PATCH 01/14] sync with cpython 58e330ac --- howto/enum.po | 156 +++++++++++++++++++++++++------------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/howto/enum.po b/howto/enum.po index e35d5f1dee..712c8e0051 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-04 00:15+0000\n" +"POT-Creation-Date: 2023-04-06 06:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -855,27 +855,27 @@ msgstr "" #: ../../howto/enum.rst:962 msgid "" "Enum members are instances of their enum class, and are normally accessed as " -"``EnumClass.member``. In Python versions ``3.5`` to ``3.10`` you could " -"access members from other members -- this practice was discouraged, and in " -"``3.11`` :class:`Enum` returns to not allowing it::" +"``EnumClass.member``. In certain situations, such as writing custom enum " +"behavior, being able to access one member directly from another is useful, " +"and is supported." msgstr "" -#: ../../howto/enum.rst:983 +#: ../../howto/enum.rst:971 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:985 +#: ../../howto/enum.rst:973 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:997 +#: ../../howto/enum.rst:985 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:999 +#: ../../howto/enum.rst:987 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -884,137 +884,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1008 +#: ../../howto/enum.rst:996 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1012 +#: ../../howto/enum.rst:1000 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1014 +#: ../../howto/enum.rst:1002 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1025 +#: ../../howto/enum.rst:1013 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1027 +#: ../../howto/enum.rst:1015 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1045 +#: ../../howto/enum.rst:1033 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1047 +#: ../../howto/enum.rst:1035 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1058 +#: ../../howto/enum.rst:1046 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1060 +#: ../../howto/enum.rst:1048 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1061 +#: ../../howto/enum.rst:1049 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1062 +#: ../../howto/enum.rst:1050 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1067 +#: ../../howto/enum.rst:1055 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1076 +#: ../../howto/enum.rst:1064 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1081 +#: ../../howto/enum.rst:1069 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1092 +#: ../../howto/enum.rst:1080 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1098 +#: ../../howto/enum.rst:1086 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1107 +#: ../../howto/enum.rst:1095 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1110 +#: ../../howto/enum.rst:1098 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1099 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1112 +#: ../../howto/enum.rst:1100 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1104 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1114 +#: ../../howto/enum.rst:1102 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1115 +#: ../../howto/enum.rst:1103 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1104 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1118 +#: ../../howto/enum.rst:1106 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1126 +#: ../../howto/enum.rst:1114 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1128 +#: ../../howto/enum.rst:1116 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1133 +#: ../../howto/enum.rst:1121 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1135 +#: ../../howto/enum.rst:1123 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1025,11 +1025,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1144 +#: ../../howto/enum.rst:1132 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1146 +#: ../../howto/enum.rst:1134 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1038,11 +1038,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1152 +#: ../../howto/enum.rst:1140 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1154 +#: ../../howto/enum.rst:1142 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1051,37 +1051,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1160 +#: ../../howto/enum.rst:1148 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1162 +#: ../../howto/enum.rst:1150 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1168 +#: ../../howto/enum.rst:1156 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1170 +#: ../../howto/enum.rst:1158 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1176 +#: ../../howto/enum.rst:1164 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1186 +#: ../../howto/enum.rst:1174 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1189 +#: ../../howto/enum.rst:1177 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1089,149 +1089,149 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1196 +#: ../../howto/enum.rst:1184 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1198 +#: ../../howto/enum.rst:1186 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1201 +#: ../../howto/enum.rst:1189 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1202 +#: ../../howto/enum.rst:1190 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1203 +#: ../../howto/enum.rst:1191 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1204 +#: ../../howto/enum.rst:1192 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1207 +#: ../../howto/enum.rst:1195 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1213 +#: ../../howto/enum.rst:1201 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1215 +#: ../../howto/enum.rst:1203 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1227 +#: ../../howto/enum.rst:1215 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1229 +#: ../../howto/enum.rst:1217 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1239 +#: ../../howto/enum.rst:1227 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1255 +#: ../../howto/enum.rst:1243 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1257 +#: ../../howto/enum.rst:1245 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1269 +#: ../../howto/enum.rst:1257 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1271 +#: ../../howto/enum.rst:1259 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1288 +#: ../../howto/enum.rst:1276 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1298 +#: ../../howto/enum.rst:1286 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1317 +#: ../../howto/enum.rst:1305 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1323 +#: ../../howto/enum.rst:1311 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1325 +#: ../../howto/enum.rst:1313 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1359 +#: ../../howto/enum.rst:1347 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1361 +#: ../../howto/enum.rst:1349 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1386 +#: ../../howto/enum.rst:1374 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1392 +#: ../../howto/enum.rst:1380 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1394 +#: ../../howto/enum.rst:1382 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1423 +#: ../../howto/enum.rst:1411 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1425 +#: ../../howto/enum.rst:1413 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1444 +#: ../../howto/enum.rst:1432 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1446 +#: ../../howto/enum.rst:1434 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " From 460aeade7cd661d8f6e1b2041a1c7974ec826e7d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 9 Apr 2023 00:19:27 +0000 Subject: [PATCH 02/14] sync with cpython 4fa5fda1 --- library/datetime.po | 820 +++++++++++++++++++++-------------------- reference/datamodel.po | 320 ++++++++-------- 2 files changed, 574 insertions(+), 566 deletions(-) diff --git a/library/datetime.po b/library/datetime.po index 36e9ea31f9..365b04193e 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-04-09 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -356,8 +356,8 @@ msgid "" msgstr "" #: ../../library/datetime.rst:256 ../../library/datetime.rst:552 -#: ../../library/datetime.rst:1059 ../../library/datetime.rst:1677 -#: ../../library/datetime.rst:2281 +#: ../../library/datetime.rst:1057 ../../library/datetime.rst:1676 +#: ../../library/datetime.rst:2278 msgid "Class attributes:" msgstr "" @@ -384,7 +384,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:277 ../../library/datetime.rst:570 -#: ../../library/datetime.rst:1079 ../../library/datetime.rst:1697 +#: ../../library/datetime.rst:1077 ../../library/datetime.rst:1696 msgid "Instance attributes (read-only):" msgstr "" @@ -421,17 +421,17 @@ msgid "Between 0 and 999999 inclusive" msgstr "" #: ../../library/datetime.rst:289 ../../library/datetime.rst:587 -#: ../../library/datetime.rst:1132 +#: ../../library/datetime.rst:1130 msgid "Supported operations:" msgstr "" #: ../../library/datetime.rst:294 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1135 +#: ../../library/datetime.rst:1133 msgid "Operation" msgstr "" #: ../../library/datetime.rst:294 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1135 +#: ../../library/datetime.rst:1133 msgid "Result" msgstr "" @@ -576,7 +576,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:355 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:2494 +#: ../../library/datetime.rst:2499 msgid "Notes:" msgstr "註解:" @@ -650,7 +650,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:422 ../../library/datetime.rst:633 -#: ../../library/datetime.rst:1206 ../../library/datetime.rst:1805 +#: ../../library/datetime.rst:1204 ../../library/datetime.rst:1804 msgid "Instance methods:" msgstr "" @@ -714,12 +714,12 @@ msgstr "``1 <= month <= 12``" msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:487 ../../library/datetime.rst:849 +#: ../../library/datetime.rst:487 ../../library/datetime.rst:847 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:490 ../../library/datetime.rst:854 +#: ../../library/datetime.rst:490 ../../library/datetime.rst:852 msgid "Other constructors, all class methods:" msgstr "" @@ -798,15 +798,15 @@ msgid "" "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:574 ../../library/datetime.rst:1083 +#: ../../library/datetime.rst:574 ../../library/datetime.rst:1081 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:579 ../../library/datetime.rst:1088 +#: ../../library/datetime.rst:579 ../../library/datetime.rst:1086 msgid "Between 1 and 12 inclusive." msgstr "" -#: ../../library/datetime.rst:584 ../../library/datetime.rst:1093 +#: ../../library/datetime.rst:584 ../../library/datetime.rst:1091 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" @@ -830,7 +830,7 @@ msgstr "" msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:598 ../../library/datetime.rst:1141 +#: ../../library/datetime.rst:598 ../../library/datetime.rst:1139 msgid "\\(3)" msgstr "\\(3)" @@ -887,14 +887,14 @@ msgid "" "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:640 ../../library/datetime.rst:1848 +#: ../../library/datetime.rst:640 ../../library/datetime.rst:1847 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:650 ../../library/datetime.rst:1319 +#: ../../library/datetime.rst:650 ../../library/datetime.rst:1317 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." @@ -904,7 +904,7 @@ msgstr "" msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:654 ../../library/datetime.rst:1321 +#: ../../library/datetime.rst:654 ../../library/datetime.rst:1319 msgid "``d.timetuple()`` is equivalent to::" msgstr "" "``d.timetuple()`` 等價於:\n" @@ -981,7 +981,7 @@ msgstr "" msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:728 ../../library/datetime.rst:1505 +#: ../../library/datetime.rst:728 ../../library/datetime.rst:1503 msgid "``d.ctime()`` is equivalent to::" msgstr "" @@ -996,41 +996,41 @@ msgstr "" 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. For a complete list of formatting directives, see :ref:`strftime-" -"strptime-behavior`." +"values. See also :ref:`strftime-strptime-behavior` and :meth:`date." +"isoformat`." msgstr "" -#: ../../library/datetime.rst:747 +#: ../../library/datetime.rst:746 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals ` and when using :meth:`str.format`. For a complete list of " -"formatting directives, see :ref:`strftime-strptime-behavior`." +"strings>` and when using :meth:`str.format`. See also :ref:`strftime-" +"strptime-behavior` and :meth:`date.isoformat`." msgstr "" -#: ../../library/datetime.rst:754 +#: ../../library/datetime.rst:752 msgid "Examples of Usage: :class:`date`" msgstr "用法範例:\\ :class:`date`" -#: ../../library/datetime.rst:756 +#: ../../library/datetime.rst:754 msgid "Example of counting days to an event::" msgstr "" -#: ../../library/datetime.rst:774 +#: ../../library/datetime.rst:772 msgid "More examples of working with :class:`date`:" msgstr "" -#: ../../library/datetime.rst:823 +#: ../../library/datetime.rst:821 msgid ":class:`.datetime` Objects" msgstr ":class:`.datetime` 物件" -#: ../../library/datetime.rst:825 +#: ../../library/datetime.rst:823 msgid "" "A :class:`.datetime` object is a single object containing all the " "information from a :class:`date` object and a :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:828 +#: ../../library/datetime.rst:826 msgid "" "Like a :class:`date` object, :class:`.datetime` assumes the current " "Gregorian calendar extended in both directions; like a :class:`.time` " @@ -1038,80 +1038,80 @@ msgid "" "every day." msgstr "" -#: ../../library/datetime.rst:832 +#: ../../library/datetime.rst:830 msgid "Constructor:" msgstr "" -#: ../../library/datetime.rst:836 +#: ../../library/datetime.rst:834 msgid "" "The *year*, *month* and *day* arguments are required. *tzinfo* may be " "``None``, or an instance of a :class:`tzinfo` subclass. The remaining " "arguments must be integers in the following ranges:" msgstr "" -#: ../../library/datetime.rst:840 +#: ../../library/datetime.rst:838 msgid "``MINYEAR <= year <= MAXYEAR``," msgstr "" -#: ../../library/datetime.rst:841 +#: ../../library/datetime.rst:839 msgid "``1 <= month <= 12``," msgstr "" -#: ../../library/datetime.rst:842 +#: ../../library/datetime.rst:840 msgid "``1 <= day <= number of days in the given month and year``," msgstr "" -#: ../../library/datetime.rst:843 ../../library/datetime.rst:1668 +#: ../../library/datetime.rst:841 ../../library/datetime.rst:1667 msgid "``0 <= hour < 24``," msgstr "" -#: ../../library/datetime.rst:844 ../../library/datetime.rst:1669 +#: ../../library/datetime.rst:842 ../../library/datetime.rst:1668 msgid "``0 <= minute < 60``," msgstr "" -#: ../../library/datetime.rst:845 ../../library/datetime.rst:1670 +#: ../../library/datetime.rst:843 ../../library/datetime.rst:1669 msgid "``0 <= second < 60``," msgstr "" -#: ../../library/datetime.rst:846 ../../library/datetime.rst:1671 +#: ../../library/datetime.rst:844 ../../library/datetime.rst:1670 msgid "``0 <= microsecond < 1000000``," msgstr "" -#: ../../library/datetime.rst:847 ../../library/datetime.rst:1672 +#: ../../library/datetime.rst:845 ../../library/datetime.rst:1671 msgid "``fold in [0, 1]``." msgstr "" -#: ../../library/datetime.rst:851 ../../library/datetime.rst:1240 -#: ../../library/datetime.rst:1815 +#: ../../library/datetime.rst:849 ../../library/datetime.rst:1238 +#: ../../library/datetime.rst:1814 msgid "Added the ``fold`` argument." msgstr "新增 ``fold`` 引數。" -#: ../../library/datetime.rst:858 +#: ../../library/datetime.rst:856 msgid "Return the current local datetime, with :attr:`.tzinfo` ``None``." msgstr "" -#: ../../library/datetime.rst:860 +#: ../../library/datetime.rst:858 msgid "Equivalent to::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/datetime.rst:864 +#: ../../library/datetime.rst:862 msgid "See also :meth:`now`, :meth:`fromtimestamp`." msgstr "也請見 :meth:`now`\\ 、\\ :meth:`fromtimestamp`\\ 。" -#: ../../library/datetime.rst:866 +#: ../../library/datetime.rst:864 msgid "" "This method is functionally equivalent to :meth:`now`, but without a ``tz`` " "parameter." msgstr "" -#: ../../library/datetime.rst:871 +#: ../../library/datetime.rst:869 msgid "Return the current local date and time." msgstr "" -#: ../../library/datetime.rst:873 +#: ../../library/datetime.rst:871 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 " @@ -1119,28 +1119,28 @@ msgid "" "possible on platforms supplying the C :c:func:`gettimeofday` function)." msgstr "" -#: ../../library/datetime.rst:879 +#: ../../library/datetime.rst:877 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the current date and time are converted to *tz*’s time zone." msgstr "" -#: ../../library/datetime.rst:882 +#: ../../library/datetime.rst:880 msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." msgstr "" -#: ../../library/datetime.rst:887 +#: ../../library/datetime.rst:885 msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." msgstr "" -#: ../../library/datetime.rst:889 +#: ../../library/datetime.rst:887 msgid "" "This is like :meth:`now`, but returns the current UTC date and time, as a " "naive :class:`.datetime` object. An aware current UTC datetime can be " "obtained by calling ``datetime.now(timezone.utc)``. See also :meth:`now`." msgstr "" -#: ../../library/datetime.rst:895 +#: ../../library/datetime.rst:893 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 " @@ -1148,7 +1148,7 @@ msgid "" "current time in UTC is by calling ``datetime.now(timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:903 +#: ../../library/datetime.rst:901 msgid "" "Return the local date and time corresponding to the POSIX timestamp, such as " "is returned by :func:`time.time`. If optional argument *tz* is ``None`` or " @@ -1156,13 +1156,13 @@ msgid "" "time, and the returned :class:`.datetime` object is naive." msgstr "" -#: ../../library/datetime.rst:908 +#: ../../library/datetime.rst:906 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the timestamp is converted to *tz*’s time zone." msgstr "" -#: ../../library/datetime.rst:911 +#: ../../library/datetime.rst:909 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` " @@ -1175,7 +1175,7 @@ msgid "" "preferred over :meth:`utcfromtimestamp`." msgstr "" -#: ../../library/datetime.rst:922 +#: ../../library/datetime.rst:920 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` " @@ -1183,17 +1183,17 @@ msgid "" "`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:929 +#: ../../library/datetime.rst:927 msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" -#: ../../library/datetime.rst:934 +#: ../../library/datetime.rst:932 msgid "" "Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " "with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" msgstr "" -#: ../../library/datetime.rst:937 +#: ../../library/datetime.rst:935 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:" @@ -1201,23 +1201,23 @@ msgid "" "to years in 1970 through 2038." msgstr "" -#: ../../library/datetime.rst:942 +#: ../../library/datetime.rst:940 msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" msgstr "" -#: ../../library/datetime.rst:946 +#: ../../library/datetime.rst:944 msgid "" "On the POSIX compliant platforms, it is equivalent to the following " "expression::" msgstr "" -#: ../../library/datetime.rst:951 +#: ../../library/datetime.rst:949 msgid "" "except the latter formula always supports the full years range: between :" "const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:956 +#: ../../library/datetime.rst:954 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 " @@ -1226,7 +1226,7 @@ msgid "" "tz=timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:962 +#: ../../library/datetime.rst:960 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` " @@ -1234,7 +1234,7 @@ msgid "" "`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:971 +#: ../../library/datetime.rst:969 msgid "" "Return the :class:`.datetime` corresponding to the proleptic Gregorian " "ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " @@ -1243,7 +1243,7 @@ msgid "" "is ``None``." msgstr "" -#: ../../library/datetime.rst:979 +#: ../../library/datetime.rst:977 msgid "" "Return a new :class:`.datetime` object whose date components are equal to " "the given :class:`date` object's, and whose time components are equal to the " @@ -1252,54 +1252,54 @@ msgid "" "the :attr:`~.time.tzinfo` attribute of the *time* argument is used." msgstr "" -#: ../../library/datetime.rst:986 +#: ../../library/datetime.rst:984 msgid "" "For any :class:`.datetime` object *d*, ``d == datetime.combine(d.date(), d." "time(), d.tzinfo)``. If date is a :class:`.datetime` object, its time " "components and :attr:`.tzinfo` attributes are ignored." msgstr "" -#: ../../library/datetime.rst:991 +#: ../../library/datetime.rst:989 msgid "Added the *tzinfo* argument." msgstr "新增 *tzinfo* 引數。" -#: ../../library/datetime.rst:997 +#: ../../library/datetime.rst:995 msgid "" "Return a :class:`.datetime` corresponding to a *date_string* in any valid " "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1000 ../../library/datetime.rst:1771 +#: ../../library/datetime.rst:998 ../../library/datetime.rst:1770 msgid "Time zone offsets may have fractional seconds." msgstr "" -#: ../../library/datetime.rst:1001 +#: ../../library/datetime.rst:999 msgid "The ``T`` separator may be replaced by any single unicode character." msgstr "" -#: ../../library/datetime.rst:1002 +#: ../../library/datetime.rst:1000 msgid "Ordinal dates are not currently supported." msgstr "" -#: ../../library/datetime.rst:1003 ../../library/datetime.rst:1776 +#: ../../library/datetime.rst:1001 ../../library/datetime.rst:1775 msgid "Fractional hours and minutes are not supported." msgstr "" -#: ../../library/datetime.rst:1005 ../../library/datetime.rst:1434 -#: ../../library/datetime.rst:1778 +#: ../../library/datetime.rst:1003 ../../library/datetime.rst:1432 +#: ../../library/datetime.rst:1777 msgid "Examples::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:1029 +#: ../../library/datetime.rst:1027 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`date.isoformat()` or :meth:`datetime.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1036 +#: ../../library/datetime.rst:1034 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 " @@ -1307,65 +1307,65 @@ msgid "" "`datetime.isocalendar`." msgstr "" -#: ../../library/datetime.rst:1045 +#: ../../library/datetime.rst:1043 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." msgstr "" -#: ../../library/datetime.rst:1048 +#: ../../library/datetime.rst:1046 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/datetime.rst:1052 +#: ../../library/datetime.rst:1050 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. " -"For a complete list of formatting directives, see :ref:`strftime-strptime-" -"behavior`." +"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`." msgstr "" -#: ../../library/datetime.rst:1063 +#: ../../library/datetime.rst:1061 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1069 +#: ../../library/datetime.rst:1067 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1075 +#: ../../library/datetime.rst:1073 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:1098 ../../library/datetime.rst:1701 +#: ../../library/datetime.rst:1096 ../../library/datetime.rst:1700 msgid "In ``range(24)``." msgstr "" -#: ../../library/datetime.rst:1103 ../../library/datetime.rst:1108 -#: ../../library/datetime.rst:1706 ../../library/datetime.rst:1711 +#: ../../library/datetime.rst:1101 ../../library/datetime.rst:1106 +#: ../../library/datetime.rst:1705 ../../library/datetime.rst:1710 msgid "In ``range(60)``." msgstr "" -#: ../../library/datetime.rst:1113 ../../library/datetime.rst:1716 +#: ../../library/datetime.rst:1111 ../../library/datetime.rst:1715 msgid "In ``range(1000000)``." msgstr "" -#: ../../library/datetime.rst:1118 +#: ../../library/datetime.rst:1116 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1124 ../../library/datetime.rst:1727 +#: ../../library/datetime.rst:1122 ../../library/datetime.rst:1726 msgid "" "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " "(A repeated interval occurs when clocks are rolled back at the end of " @@ -1374,38 +1374,38 @@ msgid "" "(later) of the two moments with the same wall time representation." msgstr "" -#: ../../library/datetime.rst:1137 +#: ../../library/datetime.rst:1135 msgid "``datetime2 = datetime1 + timedelta``" msgstr "``datetime2 = datetime1 + timedelta``" -#: ../../library/datetime.rst:1137 ../../library/datetime.rst:2329 -#: ../../library/datetime.rst:2334 ../../library/datetime.rst:2346 -#: ../../library/datetime.rst:2351 ../../library/datetime.rst:2411 -#: ../../library/datetime.rst:2416 ../../library/datetime.rst:2420 +#: ../../library/datetime.rst:1135 ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2339 ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:2356 ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2425 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/datetime.rst:1139 +#: ../../library/datetime.rst:1137 msgid "``datetime2 = datetime1 - timedelta``" msgstr "``datetime2 = datetime1 - timedelta``" -#: ../../library/datetime.rst:1139 ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:1137 ../../library/datetime.rst:2367 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/datetime.rst:1141 +#: ../../library/datetime.rst:1139 msgid "``timedelta = datetime1 - datetime2``" msgstr "``timedelta = datetime1 - datetime2``" -#: ../../library/datetime.rst:1143 +#: ../../library/datetime.rst:1141 msgid "``datetime1 < datetime2``" msgstr "``datetime1 < datetime2``" -#: ../../library/datetime.rst:1143 +#: ../../library/datetime.rst:1141 msgid "Compares :class:`.datetime` to :class:`.datetime`. (4)" msgstr "" -#: ../../library/datetime.rst:1148 +#: ../../library/datetime.rst:1146 msgid "" "datetime2 is a duration of timedelta removed from datetime1, moving forward " "in time if ``timedelta.days`` > 0, or backward if ``timedelta.days`` < 0. " @@ -1416,7 +1416,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1157 +#: ../../library/datetime.rst:1155 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1424,14 +1424,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1162 +#: ../../library/datetime.rst:1160 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1166 +#: ../../library/datetime.rst:1164 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 " @@ -1439,7 +1439,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1171 +#: ../../library/datetime.rst:1169 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 " @@ -1448,20 +1448,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1177 +#: ../../library/datetime.rst:1175 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1180 +#: ../../library/datetime.rst:1178 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1184 +#: ../../library/datetime.rst:1182 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1471,13 +1471,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1190 +#: ../../library/datetime.rst:1188 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1196 +#: ../../library/datetime.rst:1194 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1490,27 +1490,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1210 +#: ../../library/datetime.rst:1208 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1215 +#: ../../library/datetime.rst:1213 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1218 ../../library/datetime.rst:1227 +#: ../../library/datetime.rst:1216 ../../library/datetime.rst:1225 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1224 +#: ../../library/datetime.rst:1222 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1235 +#: ../../library/datetime.rst:1233 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1518,21 +1518,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1246 +#: ../../library/datetime.rst:1244 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1250 +#: ../../library/datetime.rst:1248 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system timezone." msgstr "" -#: ../../library/datetime.rst:1254 +#: ../../library/datetime.rst:1252 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1540,7 +1540,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1259 +#: ../../library/datetime.rst:1257 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1549,7 +1549,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1265 +#: ../../library/datetime.rst:1263 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1557,56 +1557,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1270 +#: ../../library/datetime.rst:1268 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::" msgstr "" -#: ../../library/datetime.rst:1282 +#: ../../library/datetime.rst:1280 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1285 +#: ../../library/datetime.rst:1283 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1292 +#: ../../library/datetime.rst:1290 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." msgstr "" -#: ../../library/datetime.rst:1296 ../../library/datetime.rst:1890 -#: ../../library/datetime.rst:1996 ../../library/datetime.rst:2241 -#: ../../library/datetime.rst:2253 ../../library/datetime.rst:2550 +#: ../../library/datetime.rst:1294 ../../library/datetime.rst:1887 +#: ../../library/datetime.rst:1993 ../../library/datetime.rst:2238 +#: ../../library/datetime.rst:2250 ../../library/datetime.rst:2555 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1302 +#: ../../library/datetime.rst:1300 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." msgstr "" -#: ../../library/datetime.rst:1306 ../../library/datetime.rst:1900 -#: ../../library/datetime.rst:2050 +#: ../../library/datetime.rst:1304 ../../library/datetime.rst:1897 +#: ../../library/datetime.rst:2047 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1312 +#: ../../library/datetime.rst:1310 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," msgstr "" -#: ../../library/datetime.rst:1327 +#: ../../library/datetime.rst:1325 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 :" @@ -1616,14 +1616,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1338 +#: ../../library/datetime.rst:1336 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`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:1342 +#: ../../library/datetime.rst:1340 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 " @@ -1632,7 +1632,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1351 +#: ../../library/datetime.rst:1349 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 " @@ -1642,20 +1642,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1360 +#: ../../library/datetime.rst:1358 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1365 +#: ../../library/datetime.rst:1363 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`." msgstr "" -#: ../../library/datetime.rst:1369 +#: ../../library/datetime.rst:1367 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 " @@ -1664,18 +1664,18 @@ msgid "" "`OverflowError` for times far in the past or far in the future." msgstr "" -#: ../../library/datetime.rst:1376 +#: ../../library/datetime.rst:1374 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1383 +#: ../../library/datetime.rst:1381 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1389 +#: ../../library/datetime.rst:1387 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1683,216 +1683,216 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1397 +#: ../../library/datetime.rst:1395 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1403 +#: ../../library/datetime.rst:1401 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1409 +#: ../../library/datetime.rst:1407 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`." msgstr "" -#: ../../library/datetime.rst:1416 +#: ../../library/datetime.rst:1414 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1422 +#: ../../library/datetime.rst:1420 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1424 +#: ../../library/datetime.rst:1422 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1425 +#: ../../library/datetime.rst:1423 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1427 +#: ../../library/datetime.rst:1425 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" -#: ../../library/datetime.rst:1430 +#: ../../library/datetime.rst:1428 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" msgstr "" -#: ../../library/datetime.rst:1432 +#: ../../library/datetime.rst:1430 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1442 +#: ../../library/datetime.rst:1440 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1456 ../../library/datetime.rst:1828 +#: ../../library/datetime.rst:1454 ../../library/datetime.rst:1827 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1460 ../../library/datetime.rst:1832 +#: ../../library/datetime.rst:1458 ../../library/datetime.rst:1831 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1462 ../../library/datetime.rst:1834 +#: ../../library/datetime.rst:1460 ../../library/datetime.rst:1833 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1463 ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1461 ../../library/datetime.rst:1834 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1464 ../../library/datetime.rst:1836 +#: ../../library/datetime.rst:1462 ../../library/datetime.rst:1835 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1838 +#: ../../library/datetime.rst:1464 ../../library/datetime.rst:1837 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1468 ../../library/datetime.rst:1840 +#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1839 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1844 +#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1474 +#: ../../library/datetime.rst:1472 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1484 ../../library/datetime.rst:1859 +#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1858 msgid "Added the *timespec* argument." msgstr "新增 *timespec* 引數。" -#: ../../library/datetime.rst:1490 +#: ../../library/datetime.rst:1488 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1496 +#: ../../library/datetime.rst:1494 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1502 +#: ../../library/datetime.rst:1500 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1509 +#: ../../library/datetime.rst:1507 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." msgstr "" -#: ../../library/datetime.rst:1515 +#: ../../library/datetime.rst:1514 msgid "" "Return a string representing the date and time, controlled by an explicit " -"format string. For a complete list of formatting directives, see :ref:" -"`strftime-strptime-behavior`." +"format string. See also :ref:`strftime-strptime-behavior` and :meth:" +"`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1522 +#: ../../library/datetime.rst:1521 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`. For a complete list " -"of formatting directives, see :ref:`strftime-strptime-behavior`." +"literals ` and when using :meth:`str.format`. See also :ref:" +"`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1529 +#: ../../library/datetime.rst:1528 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1531 +#: ../../library/datetime.rst:1530 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1584 +#: ../../library/datetime.rst:1583 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1631 +#: ../../library/datetime.rst:1630 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1657 +#: ../../library/datetime.rst:1656 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1659 +#: ../../library/datetime.rst:1658 msgid "" "A :class:`time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1664 +#: ../../library/datetime.rst:1663 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 " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1674 +#: ../../library/datetime.rst:1673 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1682 +#: ../../library/datetime.rst:1681 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1687 +#: ../../library/datetime.rst:1686 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1692 +#: ../../library/datetime.rst:1691 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." msgstr "" -#: ../../library/datetime.rst:1721 +#: ../../library/datetime.rst:1720 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1735 +#: ../../library/datetime.rst:1734 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1901,7 +1901,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1741 +#: ../../library/datetime.rst:1740 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1915,18 +1915,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1751 +#: ../../library/datetime.rst:1750 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1755 +#: ../../library/datetime.rst:1754 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1757 +#: ../../library/datetime.rst:1756 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -1934,35 +1934,35 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1764 +#: ../../library/datetime.rst:1763 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1768 +#: ../../library/datetime.rst:1767 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1772 +#: ../../library/datetime.rst:1771 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: ../../library/datetime.rst:1774 +#: ../../library/datetime.rst:1773 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1800 +#: ../../library/datetime.rst:1799 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1810 +#: ../../library/datetime.rst:1809 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1970,94 +1970,94 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1821 +#: ../../library/datetime.rst:1820 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1823 +#: ../../library/datetime.rst:1822 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1824 +#: ../../library/datetime.rst:1823 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1825 +#: ../../library/datetime.rst:1824 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1826 +#: ../../library/datetime.rst:1825 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1846 +#: ../../library/datetime.rst:1845 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1865 +#: ../../library/datetime.rst:1864 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1870 +#: ../../library/datetime.rst:1869 msgid "" "Return a string representing the time, controlled by an explicit format " -"string. For a complete list of formatting directives, see :ref:`strftime-" -"strptime-behavior`." +"string. See also :ref:`strftime-strptime-behavior` and :meth:`time." +"isoformat`." msgstr "" -#: ../../library/datetime.rst:1877 +#: ../../library/datetime.rst:1875 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` and when using :meth:`str.format`. For a complete list of " -"formatting directives, see :ref:`strftime-strptime-behavior`." +"strings>` and when using :meth:`str.format`. See also :ref:`strftime-" +"strptime-behavior` and :meth:`time.isoformat`." msgstr "" -#: ../../library/datetime.rst:1886 +#: ../../library/datetime.rst:1883 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." msgstr "" -#: ../../library/datetime.rst:1896 +#: ../../library/datetime.rst:1893 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." msgstr "" -#: ../../library/datetime.rst:1905 +#: ../../library/datetime.rst:1902 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." msgstr "" -#: ../../library/datetime.rst:1910 +#: ../../library/datetime.rst:1907 msgid "Examples of Usage: :class:`.time`" msgstr "" -#: ../../library/datetime.rst:1912 +#: ../../library/datetime.rst:1909 msgid "Examples of working with a :class:`.time` object::" msgstr "" -#: ../../library/datetime.rst:1943 +#: ../../library/datetime.rst:1940 msgid ":class:`tzinfo` Objects" msgstr ":class:`tzinfo` 物件" -#: ../../library/datetime.rst:1947 +#: ../../library/datetime.rst:1944 msgid "" "This is an abstract base class, meaning that this class should not be " "instantiated directly. Define a subclass of :class:`tzinfo` to capture " "information about a particular time zone." msgstr "" -#: ../../library/datetime.rst:1951 +#: ../../library/datetime.rst:1948 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 " @@ -2067,7 +2067,7 @@ msgid "" "object passed to them." msgstr "" -#: ../../library/datetime.rst:1957 +#: ../../library/datetime.rst:1954 msgid "" "You need to derive a concrete subclass, and (at least) supply " "implementations of the standard :class:`tzinfo` methods needed by the :class:" @@ -2077,7 +2077,7 @@ msgid "" "American EST and EDT." msgstr "" -#: ../../library/datetime.rst:1964 +#: ../../library/datetime.rst:1961 msgid "" "Special requirement for pickling: A :class:`tzinfo` subclass must have an :" "meth:`__init__` method that can be called with no arguments, otherwise it " @@ -2085,20 +2085,20 @@ msgid "" "requirement that may be relaxed in the future." msgstr "" -#: ../../library/datetime.rst:1969 +#: ../../library/datetime.rst:1966 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." msgstr "" -#: ../../library/datetime.rst:1976 +#: ../../library/datetime.rst:1973 msgid "" "Return offset of local time from UTC, as a :class:`timedelta` object that is " "positive east of UTC. If local time is west of UTC, this should be negative." msgstr "" -#: ../../library/datetime.rst:1979 +#: ../../library/datetime.rst:1976 msgid "" "This represents the *total* offset from UTC; for example, if a :class:" "`tzinfo` object represents both time zone and DST adjustments, :meth:" @@ -2109,25 +2109,25 @@ msgid "" "meth:`utcoffset` will probably look like one of these two::" msgstr "" -#: ../../library/datetime.rst:1990 +#: ../../library/datetime.rst:1987 msgid "" "If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return " "``None`` either." msgstr "" -#: ../../library/datetime.rst:1993 +#: ../../library/datetime.rst:1990 msgid "" "The default implementation of :meth:`utcoffset` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2002 +#: ../../library/datetime.rst:1999 msgid "" "Return the daylight saving time (DST) adjustment, as a :class:`timedelta` " "object or ``None`` if DST information isn't known." msgstr "" -#: ../../library/datetime.rst:2006 +#: ../../library/datetime.rst:2003 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 " @@ -2140,17 +2140,17 @@ msgid "" "DST changes when crossing time zones." msgstr "" -#: ../../library/datetime.rst:2016 +#: ../../library/datetime.rst:2013 msgid "" "An instance *tz* of a :class:`tzinfo` subclass that models both standard and " "daylight times must be consistent in this sense:" msgstr "" -#: ../../library/datetime.rst:2019 +#: ../../library/datetime.rst:2016 msgid "``tz.utcoffset(dt) - tz.dst(dt)``" msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" -#: ../../library/datetime.rst:2021 +#: ../../library/datetime.rst:2018 msgid "" "must return the same result for every :class:`.datetime` *dt* with ``dt." "tzinfo == tz`` For sane :class:`tzinfo` subclasses, this expression yields " @@ -2163,25 +2163,25 @@ msgid "" "regardless." msgstr "" -#: ../../library/datetime.rst:2030 +#: ../../library/datetime.rst:2027 msgid "" "Most implementations of :meth:`dst` will probably look like one of these " "two::" msgstr "" -#: ../../library/datetime.rst:2036 +#: ../../library/datetime.rst:2033 msgid "or::" msgstr "" "或是:\n" "\n" "::" -#: ../../library/datetime.rst:2048 +#: ../../library/datetime.rst:2045 msgid "" "The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2056 +#: ../../library/datetime.rst:2053 msgid "" "Return the time zone name corresponding to the :class:`.datetime` object " "*dt*, as a string. Nothing about string names is defined by the :mod:" @@ -2194,13 +2194,13 @@ msgid "" "if the :class:`tzinfo` class is accounting for daylight time." msgstr "" -#: ../../library/datetime.rst:2066 +#: ../../library/datetime.rst:2063 msgid "" "The default implementation of :meth:`tzname` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2069 +#: ../../library/datetime.rst:2066 msgid "" "These methods are called by a :class:`.datetime` or :class:`.time` object, " "in response to their methods of the same names. A :class:`.datetime` object " @@ -2210,7 +2210,7 @@ msgid "" "datetime`." msgstr "" -#: ../../library/datetime.rst:2075 +#: ../../library/datetime.rst:2072 msgid "" "When ``None`` is passed, it's up to the class designer to decide the best " "response. For example, returning ``None`` is appropriate if the class wishes " @@ -2219,7 +2219,7 @@ msgid "" "offset, as there is no other convention for discovering the standard offset." msgstr "" -#: ../../library/datetime.rst:2081 +#: ../../library/datetime.rst:2078 msgid "" "When a :class:`.datetime` object is passed in response to a :class:`." "datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" @@ -2229,13 +2229,13 @@ msgid "" "timezones." msgstr "" -#: ../../library/datetime.rst:2087 +#: ../../library/datetime.rst:2084 msgid "" "There is one more :class:`tzinfo` method that a subclass may wish to " "override:" msgstr "" -#: ../../library/datetime.rst:2092 +#: ../../library/datetime.rst:2089 msgid "" "This is called from the default :class:`datetime.astimezone()` " "implementation. When called from that, ``dt.tzinfo`` is *self*, and *dt*'s " @@ -2244,7 +2244,7 @@ msgid "" "equivalent datetime in *self*'s local time." msgstr "" -#: ../../library/datetime.rst:2098 +#: ../../library/datetime.rst:2095 msgid "" "Most :class:`tzinfo` subclasses should be able to inherit the default :meth:" "`fromutc` implementation without problems. It's strong enough to handle " @@ -2258,19 +2258,19 @@ msgid "" "result is one of the hours straddling the moment the standard offset changes." msgstr "" -#: ../../library/datetime.rst:2109 +#: ../../library/datetime.rst:2106 msgid "" "Skipping code for error cases, the default :meth:`fromutc` implementation " "acts like::" msgstr "" -#: ../../library/datetime.rst:2127 +#: ../../library/datetime.rst:2124 msgid "" "In the following :download:`tzinfo_examples.py <../includes/tzinfo_examples." "py>` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2133 +#: ../../library/datetime.rst:2130 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 " @@ -2279,7 +2279,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2147 +#: ../../library/datetime.rst:2144 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2288,7 +2288,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2166 +#: ../../library/datetime.rst:2163 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2303,13 +2303,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2188 +#: ../../library/datetime.rst:2185 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2191 +#: ../../library/datetime.rst:2188 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2319,28 +2319,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2205 +#: ../../library/datetime.rst:2202 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2200 +#: ../../library/datetime.rst:2197 msgid "" "The :mod:`datetime` module has a basic :class:`timezone` class (for handling " "arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " "UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2204 +#: ../../library/datetime.rst:2201 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2211 +#: ../../library/datetime.rst:2208 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2208 +#: ../../library/datetime.rst:2205 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2349,24 +2349,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2218 +#: ../../library/datetime.rst:2215 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2220 +#: ../../library/datetime.rst:2217 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2224 +#: ../../library/datetime.rst:2221 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2231 +#: ../../library/datetime.rst:2228 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2374,25 +2374,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2236 +#: ../../library/datetime.rst:2233 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2247 ../../library/datetime.rst:2258 +#: ../../library/datetime.rst:2244 ../../library/datetime.rst:2255 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2250 +#: ../../library/datetime.rst:2247 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2261 +#: ../../library/datetime.rst:2258 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2401,138 +2401,144 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2267 +#: ../../library/datetime.rst:2264 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2274 +#: ../../library/datetime.rst:2271 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2278 +#: ../../library/datetime.rst:2275 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2285 +#: ../../library/datetime.rst:2282 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2294 +#: ../../library/datetime.rst:2291 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr ":meth:`strftime` 與 :meth:`strptime` 的行為" -#: ../../library/datetime.rst:2296 +#: ../../library/datetime.rst:2293 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2300 +#: ../../library/datetime.rst:2297 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2304 +#: ../../library/datetime.rst:2301 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2305 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2305 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2310 +#: ../../library/datetime.rst:2307 msgid "Usage" msgstr "" -#: ../../library/datetime.rst:2310 +#: ../../library/datetime.rst:2307 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2310 +#: ../../library/datetime.rst:2307 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2312 +#: ../../library/datetime.rst:2309 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2312 +#: ../../library/datetime.rst:2309 msgid "Instance method" msgstr "" -#: ../../library/datetime.rst:2312 +#: ../../library/datetime.rst:2309 msgid "Class method" msgstr "" -#: ../../library/datetime.rst:2314 +#: ../../library/datetime.rst:2311 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2314 +#: ../../library/datetime.rst:2311 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2314 +#: ../../library/datetime.rst:2311 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2316 +#: ../../library/datetime.rst:2313 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2316 +#: ../../library/datetime.rst:2313 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2316 +#: ../../library/datetime.rst:2313 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2318 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2320 +msgid "" +"These methods accept format codes that can be used to parse and format " +"dates::" +msgstr "" + +#: ../../library/datetime.rst:2328 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2327 ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2327 ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2327 ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2327 ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2334 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2334 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2544,11 +2550,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2339 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2339 msgid "Weekday as locale's full name." msgstr "" @@ -2560,42 +2566,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2339 +#: ../../library/datetime.rst:2344 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2339 +#: ../../library/datetime.rst:2344 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2339 +#: ../../library/datetime.rst:2344 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2343 +#: ../../library/datetime.rst:2348 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2343 +#: ../../library/datetime.rst:2348 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2343 +#: ../../library/datetime.rst:2348 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2343 ../../library/datetime.rst:2356 -#: ../../library/datetime.rst:2359 ../../library/datetime.rst:2365 -#: ../../library/datetime.rst:2368 ../../library/datetime.rst:2374 -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2348 ../../library/datetime.rst:2361 +#: ../../library/datetime.rst:2364 ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2373 ../../library/datetime.rst:2379 +#: ../../library/datetime.rst:2397 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2346 +#: ../../library/datetime.rst:2351 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2346 +#: ../../library/datetime.rst:2351 msgid "Month as locale's abbreviated name." msgstr "" @@ -2607,11 +2613,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:2356 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:2356 msgid "Month as locale's full name." msgstr "" @@ -2623,67 +2629,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2361 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2361 msgid "Month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2356 ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2361 ../../library/datetime.rst:2373 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2364 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2364 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2364 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2367 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2367 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2362 ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2367 ../../library/datetime.rst:2437 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2370 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2370 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2370 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2373 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2373 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2376 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2376 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2695,127 +2701,127 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2376 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2374 +#: ../../library/datetime.rst:2379 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2374 +#: ../../library/datetime.rst:2379 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2374 ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2379 ../../library/datetime.rst:2382 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2382 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2382 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2382 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2385 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2385 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2385 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2385 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2384 ../../library/datetime.rst:2548 +#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2553 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2389 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2389 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2384 ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2394 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:2394 ../../library/datetime.rst:2577 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2394 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2394 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2397 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2397 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2397 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2400 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2400 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2395 ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2400 ../../library/datetime.rst:2408 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2395 ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2400 ../../library/datetime.rst:2408 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2408 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2408 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2416 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2416 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2827,11 +2833,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2421 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2421 msgid "Locale's appropriate date representation." msgstr "" @@ -2847,11 +2853,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2420 +#: ../../library/datetime.rst:2425 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2420 +#: ../../library/datetime.rst:2425 msgid "Locale's appropriate time representation." msgstr "" @@ -2863,69 +2869,69 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2428 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2428 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2428 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2426 +#: ../../library/datetime.rst:2431 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2437 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2437 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2437 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2442 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2442 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2442 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2445 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2445 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2445 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2445 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2447 +#: ../../library/datetime.rst:2452 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -2934,7 +2940,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2452 +#: ../../library/datetime.rst:2457 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -2944,40 +2950,40 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2458 +#: ../../library/datetime.rst:2463 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2467 msgid "Technical Detail" msgstr "" -#: ../../library/datetime.rst:2464 +#: ../../library/datetime.rst:2469 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:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2468 +#: ../../library/datetime.rst:2473 msgid "" "For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2472 +#: ../../library/datetime.rst:2477 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2476 +#: ../../library/datetime.rst:2481 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2480 +#: ../../library/datetime.rst:2485 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`time` objects have no such values. If they're used " @@ -2985,14 +2991,14 @@ msgid "" "day." msgstr "" -#: ../../library/datetime.rst:2484 +#: ../../library/datetime.rst:2489 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " "values. If they're used anyway, ``0`` is substituted for them." msgstr "" -#: ../../library/datetime.rst:2488 +#: ../../library/datetime.rst:2493 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 " @@ -3001,7 +3007,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2502 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -3012,37 +3018,37 @@ msgid "" "to determine the current locale's encoding)." msgstr "" -#: ../../library/datetime.rst:2506 +#: ../../library/datetime.rst:2511 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:2514 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2513 +#: ../../library/datetime.rst:2518 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2518 +#: ../../library/datetime.rst:2523 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2522 +#: ../../library/datetime.rst:2527 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2531 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3050,17 +3056,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2533 +#: ../../library/datetime.rst:2538 msgid "" "For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty " "strings." msgstr "" -#: ../../library/datetime.rst:2536 +#: ../../library/datetime.rst:2541 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2539 +#: ../../library/datetime.rst:2544 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3074,7 +3080,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2553 +#: ../../library/datetime.rst:2558 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3082,47 +3088,47 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2561 +#: ../../library/datetime.rst:2566 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2565 +#: ../../library/datetime.rst:2570 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2567 +#: ../../library/datetime.rst:2572 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2568 +#: ../../library/datetime.rst:2573 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2570 +#: ../../library/datetime.rst:2575 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2574 +#: ../../library/datetime.rst:2579 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2580 +#: ../../library/datetime.rst:2585 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2585 +#: ../../library/datetime.rst:2590 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:" @@ -3130,22 +3136,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2591 +#: ../../library/datetime.rst:2596 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2596 +#: ../../library/datetime.rst:2601 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2597 +#: ../../library/datetime.rst:2602 msgid "If, that is, we ignore the effects of Relativity" msgstr "" -#: ../../library/datetime.rst:2599 +#: ../../library/datetime.rst:2604 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3154,14 +3160,14 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2605 +#: ../../library/datetime.rst:2610 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2609 +#: ../../library/datetime.rst:2614 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." diff --git a/reference/datamodel.po b/reference/datamodel.po index b141841567..efd986b833 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-15 00:17+0000\n" +"POT-Creation-Date: 2023-04-09 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-" @@ -2477,46 +2477,48 @@ msgstr "" msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2088 +#: ../../reference/datamodel.rst:2090 msgid "" -"If a base that appears in class definition is not an instance of :class:" -"`type`, then an ``__mro_entries__`` method is searched on it. If found, it " -"is called with the original bases tuple. This method must return a tuple of " -"classes that will be used instead of this base. The tuple may be empty, in " -"such case the original base is ignored." +"If a base that appears in a class definition is not an instance of :class:" +"`type`, then an ``__mro_entries__`` method is searched on the base. If an " +"``__mro_entries__`` method is found, the base is substituted with the result " +"of a call to ``__mro_entries__`` when creating the class. The method is " +"called with the original bases tuple, and must return a tuple of classes " +"that will be used instead of the base. The returned tuple may be empty: in " +"these cases, the original base is ignored." msgstr "" -#: ../../reference/datamodel.rst:2096 +#: ../../reference/datamodel.rst:2100 msgid ":pep:`560` - Core support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2100 +#: ../../reference/datamodel.rst:2104 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2104 +#: ../../reference/datamodel.rst:2108 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2106 +#: ../../reference/datamodel.rst:2110 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2107 +#: ../../reference/datamodel.rst:2111 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2109 +#: ../../reference/datamodel.rst:2113 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2112 +#: ../../reference/datamodel.rst:2116 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2525,11 +2527,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2122 +#: ../../reference/datamodel.rst:2126 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2127 +#: ../../reference/datamodel.rst:2131 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2541,25 +2543,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2136 +#: ../../reference/datamodel.rst:2140 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2141 +#: ../../reference/datamodel.rst:2145 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2142 +#: ../../reference/datamodel.rst:2146 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2146 +#: ../../reference/datamodel.rst:2150 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2151 +#: ../../reference/datamodel.rst:2155 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2568,7 +2570,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2157 +#: ../../reference/datamodel.rst:2161 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2577,11 +2579,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2170 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2173 +#: ../../reference/datamodel.rst:2177 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2589,7 +2591,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2178 +#: ../../reference/datamodel.rst:2182 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2600,7 +2602,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2188 +#: ../../reference/datamodel.rst:2192 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2609,39 +2611,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2198 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2198 +#: ../../reference/datamodel.rst:2202 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2200 +#: ../../reference/datamodel.rst:2204 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2202 +#: ../../reference/datamodel.rst:2206 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2205 +#: ../../reference/datamodel.rst:2209 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2213 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2649,19 +2651,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2216 +#: ../../reference/datamodel.rst:2220 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2217 +#: ../../reference/datamodel.rst:2221 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2221 +#: ../../reference/datamodel.rst:2225 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2223 +#: ../../reference/datamodel.rst:2227 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2669,17 +2671,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2230 +#: ../../reference/datamodel.rst:2234 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2232 +#: ../../reference/datamodel.rst:2236 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2239 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2687,21 +2689,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2242 +#: ../../reference/datamodel.rst:2246 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2249 +#: ../../reference/datamodel.rst:2253 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2254 +#: ../../reference/datamodel.rst:2258 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2709,11 +2711,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2265 +#: ../../reference/datamodel.rst:2269 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2262 +#: ../../reference/datamodel.rst:2266 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2722,11 +2724,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2270 +#: ../../reference/datamodel.rst:2274 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2272 +#: ../../reference/datamodel.rst:2276 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2734,65 +2736,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2284 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2284 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2283 +#: ../../reference/datamodel.rst:2287 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2283 +#: ../../reference/datamodel.rst:2287 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2286 +#: ../../reference/datamodel.rst:2290 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2286 +#: ../../reference/datamodel.rst:2290 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2289 +#: ../../reference/datamodel.rst:2293 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2294 +#: ../../reference/datamodel.rst:2298 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2301 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2303 +#: ../../reference/datamodel.rst:2307 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2305 +#: ../../reference/datamodel.rst:2309 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2313 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2801,7 +2803,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2315 +#: ../../reference/datamodel.rst:2319 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2809,11 +2811,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2325 +#: ../../reference/datamodel.rst:2329 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2327 +#: ../../reference/datamodel.rst:2331 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2823,14 +2825,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2334 +#: ../../reference/datamodel.rst:2338 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2362 +#: ../../reference/datamodel.rst:2366 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2840,40 +2842,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2381 +#: ../../reference/datamodel.rst:2385 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2406 +#: ../../reference/datamodel.rst:2410 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2405 +#: ../../reference/datamodel.rst:2409 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2413 +#: ../../reference/datamodel.rst:2417 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2420 +#: ../../reference/datamodel.rst:2424 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2427 +#: ../../reference/datamodel.rst:2431 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2429 +#: ../../reference/datamodel.rst:2433 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2909,7 +2911,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2469 +#: ../../reference/datamodel.rst:2473 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2917,7 +2919,7 @@ msgid "" "zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2476 +#: ../../reference/datamodel.rst:2480 msgid "" "In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " "length is larger than :attr:`!sys.maxsize` some features (such as :func:" @@ -2926,7 +2928,7 @@ msgid "" "`__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2485 +#: ../../reference/datamodel.rst:2489 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2936,20 +2938,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2499 +#: ../../reference/datamodel.rst:2503 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2503 +#: ../../reference/datamodel.rst:2507 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2507 +#: ../../reference/datamodel.rst:2511 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2512 +#: ../../reference/datamodel.rst:2516 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -2962,20 +2964,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2524 +#: ../../reference/datamodel.rst:2528 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2529 +#: ../../reference/datamodel.rst:2533 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2537 +#: ../../reference/datamodel.rst:2541 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2984,7 +2986,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2546 +#: ../../reference/datamodel.rst:2550 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2993,13 +2995,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2555 +#: ../../reference/datamodel.rst:2559 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2561 +#: ../../reference/datamodel.rst:2565 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3007,14 +3009,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2569 +#: ../../reference/datamodel.rst:2573 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2573 +#: ../../reference/datamodel.rst:2577 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3023,7 +3025,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2580 +#: ../../reference/datamodel.rst:2584 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3031,14 +3033,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2587 +#: ../../reference/datamodel.rst:2591 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2591 +#: ../../reference/datamodel.rst:2595 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3046,11 +3048,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2600 +#: ../../reference/datamodel.rst:2604 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2602 +#: ../../reference/datamodel.rst:2606 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3058,7 +3060,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2628 +#: ../../reference/datamodel.rst:2632 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3072,13 +3074,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2639 +#: ../../reference/datamodel.rst:2643 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2662 +#: ../../reference/datamodel.rst:2666 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3091,13 +3093,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2674 +#: ../../reference/datamodel.rst:2678 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2679 +#: ../../reference/datamodel.rst:2683 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3106,7 +3108,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2700 +#: ../../reference/datamodel.rst:2704 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3122,19 +3124,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2721 +#: ../../reference/datamodel.rst:2725 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2734 +#: ../../reference/datamodel.rst:2738 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2741 +#: ../../reference/datamodel.rst:2745 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3143,14 +3145,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2747 +#: ../../reference/datamodel.rst:2751 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2759 +#: ../../reference/datamodel.rst:2763 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3159,21 +3161,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2765 +#: ../../reference/datamodel.rst:2769 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2768 +#: ../../reference/datamodel.rst:2772 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2775 +#: ../../reference/datamodel.rst:2779 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2777 +#: ../../reference/datamodel.rst:2781 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3183,32 +3185,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2788 +#: ../../reference/datamodel.rst:2792 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2791 +#: ../../reference/datamodel.rst:2795 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2796 +#: ../../reference/datamodel.rst:2800 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2807 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2807 +#: ../../reference/datamodel.rst:2811 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3216,27 +3218,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2811 +#: ../../reference/datamodel.rst:2815 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2818 +#: ../../reference/datamodel.rst:2822 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2818 +#: ../../reference/datamodel.rst:2822 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2825 +#: ../../reference/datamodel.rst:2829 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2827 +#: ../../reference/datamodel.rst:2831 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3244,7 +3246,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2834 +#: ../../reference/datamodel.rst:2838 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3253,7 +3255,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2840 +#: ../../reference/datamodel.rst:2844 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3263,19 +3265,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2850 +#: ../../reference/datamodel.rst:2854 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2851 +#: ../../reference/datamodel.rst:2855 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2857 +#: ../../reference/datamodel.rst:2861 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2859 +#: ../../reference/datamodel.rst:2863 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3283,7 +3285,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2874 +#: ../../reference/datamodel.rst:2878 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3292,21 +3294,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2888 +#: ../../reference/datamodel.rst:2892 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:2901 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:2923 +#: ../../reference/datamodel.rst:2927 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3315,36 +3317,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:2934 +#: ../../reference/datamodel.rst:2938 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:2938 +#: ../../reference/datamodel.rst:2942 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:2940 +#: ../../reference/datamodel.rst:2944 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:2946 +#: ../../reference/datamodel.rst:2950 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:2952 +#: ../../reference/datamodel.rst:2956 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:2958 +#: ../../reference/datamodel.rst:2962 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3352,15 +3354,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:2966 +#: ../../reference/datamodel.rst:2970 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:2972 +#: ../../reference/datamodel.rst:2976 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:2974 +#: ../../reference/datamodel.rst:2978 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3371,18 +3373,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:2982 +#: ../../reference/datamodel.rst:2986 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:2990 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:2992 +#: ../../reference/datamodel.rst:2996 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3393,7 +3395,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3003 +#: ../../reference/datamodel.rst:3007 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3404,7 +3406,7 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3014 +#: ../../reference/datamodel.rst:3018 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3414,99 +3416,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3022 +#: ../../reference/datamodel.rst:3026 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3028 +#: ../../reference/datamodel.rst:3032 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3030 +#: ../../reference/datamodel.rst:3034 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3033 +#: ../../reference/datamodel.rst:3037 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3037 +#: ../../reference/datamodel.rst:3041 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3041 +#: ../../reference/datamodel.rst:3045 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3044 +#: ../../reference/datamodel.rst:3048 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3061 +#: ../../reference/datamodel.rst:3065 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3066 +#: ../../reference/datamodel.rst:3070 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3074 +#: ../../reference/datamodel.rst:3078 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3076 +#: ../../reference/datamodel.rst:3080 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3079 +#: ../../reference/datamodel.rst:3083 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3083 +#: ../../reference/datamodel.rst:3087 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3088 +#: ../../reference/datamodel.rst:3092 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3091 +#: ../../reference/datamodel.rst:3095 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3108 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3105 +#: ../../reference/datamodel.rst:3109 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3109 +#: ../../reference/datamodel.rst:3113 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3514,7 +3516,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3115 +#: ../../reference/datamodel.rst:3119 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3522,7 +3524,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3121 +#: ../../reference/datamodel.rst:3125 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " From 86c5c67383ba2edfc03e730a9948d69535d8f4f9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 11 Apr 2023 00:17:14 +0000 Subject: [PATCH 03/14] sync with cpython b80e4c89 --- library/gc.po | 93 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 37 deletions(-) diff --git a/library/gc.po b/library/gc.po index d3f17958e7..3f835bf836 100644 --- a/library/gc.po +++ b/library/gc.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-11 00:15+0000\n" "PO-Revision-Date: 2022-10-01 14:57+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -288,36 +288,39 @@ msgstr "" #: ../../library/gc.rst:209 msgid "" -"Freeze all the objects tracked by gc - move them to a permanent generation " -"and ignore all the future collections. This can be used before a POSIX " -"fork() call to make the gc copy-on-write friendly or to speed up collection. " -"Also collection before a POSIX fork() call may free pages for future " -"allocation which can cause copy-on-write too so it's advised to disable gc " -"in parent process and freeze before fork and enable gc in child process." +"Freeze all the objects tracked by the garbage collector; move them to a " +"permanent generation and ignore them in all the future collections." msgstr "" -"凍結 (freeze) 垃圾回收器所追蹤的所有物件 —— 將它們移至永久代並忽略所有未來的" -"收集動作。這可以在呼叫 POSIX fork() 之前使用以便寫入時複製 (copy-on-write) 或" -"加速回收。且在 POSIX fork() 呼叫之前的回收也可以釋放分頁 (page) ,以供未來可" -"能導致寫入時複製的記憶體分配來使用,因此建議在父行程 (parent process) 中停用" -"垃圾回收器並在 fork 之前凍結,在子行程中則建議啟用垃圾回收器。" -#: ../../library/gc.rst:221 +#: ../../library/gc.rst:212 +msgid "" +"If a process will ``fork()`` without ``exec()``, avoiding unnecessary copy-" +"on-write in child processes will maximize memory sharing and reduce overall " +"memory usage. This requires both avoiding creation of freed \"holes\" in " +"memory pages in the parent process and ensuring that GC collections in child " +"processes won't touch the ``gc_refs`` counter of long-lived objects " +"originating in the parent process. To accomplish both, call ``gc.disable()`` " +"early in the parent process, ``gc.freeze()`` right before ``fork()``, and " +"``gc.enable()`` early in child processes." +msgstr "" + +#: ../../library/gc.rst:226 msgid "" "Unfreeze the objects in the permanent generation, put them back into the " "oldest generation." msgstr "解凍 (unfreeze) 永久代中的物件,並將它們放回到最年老代中。" -#: ../../library/gc.rst:229 +#: ../../library/gc.rst:234 msgid "Return the number of objects in the permanent generation." msgstr "回傳永久代中的物件數量。" -#: ../../library/gc.rst:234 +#: ../../library/gc.rst:239 msgid "" "The following variables are provided for read-only access (you can mutate " "the values but should not rebind them):" msgstr "以下變數僅供唯讀存取(你可以修改其值但不應該重新繫結 (rebind) 它們):" -#: ../../library/gc.rst:239 +#: ../../library/gc.rst:244 msgid "" "A list of objects which the collector found to be unreachable but could not " "be freed (uncollectable objects). Starting with Python 3.4, this list " @@ -328,7 +331,7 @@ msgstr "" "開始,該 list 在大多數時候都應該是空的,除非使用了有非 ``NULL`` ``tp_del`` 槽" "位的 C 擴充套件型別的實例。" -#: ../../library/gc.rst:244 +#: ../../library/gc.rst:249 msgid "" "If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added " "to this list rather than freed." @@ -336,7 +339,7 @@ msgstr "" "如果設定了 :const:`DEBUG_SAVEALL`,則所有不可達物件將被加進該 list 而不會被釋" "放。" -#: ../../library/gc.rst:247 +#: ../../library/gc.rst:252 msgid "" "If this list is non-empty at :term:`interpreter shutdown`, a :exc:" "`ResourceWarning` is emitted, which is silent by default. If :const:" @@ -347,7 +350,7 @@ msgstr "" "`ResourceWarning`,在預設情況下此警告不會被提醒。如果設定了 :const:" "`DEBUG_UNCOLLECTABLE`,所有無法被回收的物件會被印出。" -#: ../../library/gc.rst:253 +#: ../../library/gc.rst:258 msgid "" "Following :pep:`442`, objects with a :meth:`__del__` method don't end up in :" "attr:`gc.garbage` anymore." @@ -355,7 +358,7 @@ msgstr "" "根據 :pep:`442`,帶有 :meth:`__del__` method 的物件最終不會在 :attr:`gc." "garbage` 內。" -#: ../../library/gc.rst:259 +#: ../../library/gc.rst:264 msgid "" "A list of callbacks that will be invoked by the garbage collector before and " "after collection. The callbacks will be called with two arguments, *phase* " @@ -364,29 +367,29 @@ msgstr "" "會被垃圾回收器在回收開始前和完成後呼叫的一系列回呼函式 (callback) 。這些回呼" "函式在被呼叫時附帶兩個引數:*phase* 和 *info*。" -#: ../../library/gc.rst:263 +#: ../../library/gc.rst:268 msgid "*phase* can be one of two values:" msgstr "*phase* 可為以下兩者之一:" -#: ../../library/gc.rst:265 +#: ../../library/gc.rst:270 msgid "\"start\": The garbage collection is about to start." msgstr "\"start\":垃圾回收即將開始。" -#: ../../library/gc.rst:267 +#: ../../library/gc.rst:272 msgid "\"stop\": The garbage collection has finished." msgstr "\"stop\":垃圾回收已結束。" -#: ../../library/gc.rst:269 +#: ../../library/gc.rst:274 msgid "" "*info* is a dict providing more information for the callback. The following " "keys are currently defined:" msgstr "*info* 是一個字典,提供回呼函式更多資訊。已有定義的鍵有:" -#: ../../library/gc.rst:272 +#: ../../library/gc.rst:277 msgid "\"generation\": The oldest generation being collected." msgstr "\"generation\"(代):正在被回收的最年老的一代。" -#: ../../library/gc.rst:274 +#: ../../library/gc.rst:279 msgid "" "\"collected\": When *phase* is \"stop\", the number of objects successfully " "collected." @@ -394,7 +397,7 @@ msgstr "" "\"collected\"(已回收的):當 *phase* 為 \"stop\" 時,被成功回收的物件的數" "目。" -#: ../../library/gc.rst:277 +#: ../../library/gc.rst:282 msgid "" "\"uncollectable\": When *phase* is \"stop\", the number of objects that " "could not be collected and were put in :data:`garbage`." @@ -402,40 +405,40 @@ msgstr "" "\"uncollectable\"(不可回收的):當 *phase* 為 \"stop\" 時,不能被回收並被放" "入 :data:`garbage` 的物件的數目。" -#: ../../library/gc.rst:280 +#: ../../library/gc.rst:285 msgid "" "Applications can add their own callbacks to this list. The primary use " "cases are:" msgstr "應用程式可以把他們自己的回呼函式加入此 list。主要的使用場景有:" -#: ../../library/gc.rst:283 +#: ../../library/gc.rst:288 msgid "" "Gathering statistics about garbage collection, such as how often various " "generations are collected, and how long the collection takes." msgstr "收集垃圾回收的統計資料,如:不同代的回收頻率、回收任務所花費的時間。" -#: ../../library/gc.rst:287 +#: ../../library/gc.rst:292 msgid "" "Allowing applications to identify and clear their own uncollectable types " "when they appear in :data:`garbage`." msgstr "" "讓應用程式可以識別和清理他們自己在 :data:`garbage` 中的不可回收型別物件。" -#: ../../library/gc.rst:293 +#: ../../library/gc.rst:298 msgid "The following constants are provided for use with :func:`set_debug`:" msgstr "以下常數是為了和 :func:`set_debug` 一起使用所提供:" -#: ../../library/gc.rst:298 +#: ../../library/gc.rst:303 msgid "" "Print statistics during collection. This information can be useful when " "tuning the collection frequency." msgstr "在回收完成後印出統計資訊。當調校回收頻率設定時,這些資訊會很有用。" -#: ../../library/gc.rst:304 +#: ../../library/gc.rst:309 msgid "Print information on collectable objects found." msgstr "當發現可回收物件時印出資訊。" -#: ../../library/gc.rst:309 +#: ../../library/gc.rst:314 msgid "" "Print information of uncollectable objects found (objects which are not " "reachable but cannot be freed by the collector). These objects will be " @@ -444,7 +447,7 @@ msgstr "" "印出找到的不可回收物件的資訊(指不能被回收器回收的不可達物件)。這些物件會被" "新增到 ``garbage`` list 中。" -#: ../../library/gc.rst:313 +#: ../../library/gc.rst:318 msgid "" "Also print the contents of the :data:`garbage` list at :term:`interpreter " "shutdown`, if it isn't empty." @@ -452,7 +455,7 @@ msgstr "" "當 :term:`interpreter shutdown`\\ (直譯器關閉)時,若 :data:`garbage` list " "不是空的,那這些內容也會被印出。" -#: ../../library/gc.rst:319 +#: ../../library/gc.rst:324 msgid "" "When set, all unreachable objects found will be appended to *garbage* rather " "than being freed. This can be useful for debugging a leaking program." @@ -460,7 +463,7 @@ msgstr "" "設定後,所有回收器找到的不可達物件會被加進 *garbage* 而不是直接被釋放。這在為" "一個記憶體流失的程式除錯時會很有用。" -#: ../../library/gc.rst:325 +#: ../../library/gc.rst:330 msgid "" "The debugging flags necessary for the collector to print information about a " "leaking program (equal to ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | " @@ -468,3 +471,19 @@ msgid "" msgstr "" "要印出記憶體流失程式之相關資訊時,回收器所需的除錯旗標。(等同於 " "``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | DEBUG_SAVEALL``)。" + +#~ msgid "" +#~ "Freeze all the objects tracked by gc - move them to a permanent " +#~ "generation and ignore all the future collections. This can be used before " +#~ "a POSIX fork() call to make the gc copy-on-write friendly or to speed up " +#~ "collection. Also collection before a POSIX fork() call may free pages for " +#~ "future allocation which can cause copy-on-write too so it's advised to " +#~ "disable gc in parent process and freeze before fork and enable gc in " +#~ "child process." +#~ msgstr "" +#~ "凍結 (freeze) 垃圾回收器所追蹤的所有物件 —— 將它們移至永久代並忽略所有未來" +#~ "的收集動作。這可以在呼叫 POSIX fork() 之前使用以便寫入時複製 (copy-on-" +#~ "write) 或加速回收。且在 POSIX fork() 呼叫之前的回收也可以釋放分頁 " +#~ "(page) ,以供未來可能導致寫入時複製的記憶體分配來使用,因此建議在父行程 " +#~ "(parent process) 中停用垃圾回收器並在 fork 之前凍結,在子行程中則建議啟用" +#~ "垃圾回收器。" From e06bd22cb8c901f77d6aa15510314356feb6238f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 12 Apr 2023 00:17:12 +0000 Subject: [PATCH 04/14] sync with cpython e715da6d --- library/multiprocessing.po | 964 ++++++++++++++++++------------------- library/types.po | 12 +- reference/datamodel.po | 331 +++++++------ 3 files changed, 660 insertions(+), 647 deletions(-) diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 1136f8d4a4..3ecef97fa9 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-12 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-" @@ -165,7 +165,7 @@ msgid "" "pipes." msgstr "" -#: ../../library/multiprocessing.rst:142 ../../library/multiprocessing.rst:1070 +#: ../../library/multiprocessing.rst:142 ../../library/multiprocessing.rst:1072 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " @@ -399,38 +399,38 @@ msgid "" "importable by the children. This is covered in :ref:`multiprocessing-" "programming` however it is worth pointing out here. This means that some " "examples, such as the :class:`multiprocessing.pool.Pool` examples will not " -"work in the interactive interpreter. For example::" +"work in the interactive interpreter. For example:" msgstr "" -#: ../../library/multiprocessing.rst:467 +#: ../../library/multiprocessing.rst:469 msgid "" "(If you try this it will actually output three full tracebacks interleaved " "in a semi-random fashion, and then you may have to stop the parent process " "somehow.)" msgstr "" -#: ../../library/multiprocessing.rst:473 +#: ../../library/multiprocessing.rst:475 msgid "Reference" msgstr "" -#: ../../library/multiprocessing.rst:475 +#: ../../library/multiprocessing.rst:477 msgid "" "The :mod:`multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:480 +#: ../../library/multiprocessing.rst:482 msgid ":class:`Process` and exceptions" msgstr ":class:`Process` 與例外" -#: ../../library/multiprocessing.rst:485 +#: ../../library/multiprocessing.rst:487 msgid "" "Process objects represent activity that is run in a separate process. The :" "class:`Process` class has equivalents of all the methods of :class:" "`threading.Thread`." msgstr "" -#: ../../library/multiprocessing.rst:489 +#: ../../library/multiprocessing.rst:491 msgid "" "The constructor should always be called with keyword arguments. *group* " "should always be ``None``; it exists solely for compatibility with :class:" @@ -444,29 +444,29 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:500 +#: ../../library/multiprocessing.rst:502 msgid "" "By default, no arguments are passed to *target*. The *args* argument, which " "defaults to ``()``, can be used to specify a list or tuple of the arguments " "to pass to *target*." msgstr "" -#: ../../library/multiprocessing.rst:504 +#: ../../library/multiprocessing.rst:506 msgid "" "If a subclass overrides the constructor, it must make sure it invokes the " "base class constructor (:meth:`Process.__init__`) before doing anything else " "to the process." msgstr "" -#: ../../library/multiprocessing.rst:508 +#: ../../library/multiprocessing.rst:510 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/multiprocessing.rst:513 +#: ../../library/multiprocessing.rst:515 msgid "Method representing the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:515 +#: ../../library/multiprocessing.rst:517 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " @@ -474,30 +474,30 @@ msgid "" "*args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/multiprocessing.rst:520 +#: ../../library/multiprocessing.rst:522 msgid "" "Using a list or tuple as the *args* argument passed to :class:`Process` " "achieves the same effect." msgstr "" -#: ../../library/multiprocessing.rst:523 +#: ../../library/multiprocessing.rst:525 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/multiprocessing.rst:535 +#: ../../library/multiprocessing.rst:537 msgid "Start the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:537 +#: ../../library/multiprocessing.rst:539 msgid "" "This must be called at most once per process object. It arranges for the " "object's :meth:`run` method to be invoked in a separate process." msgstr "" -#: ../../library/multiprocessing.rst:542 +#: ../../library/multiprocessing.rst:544 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -507,23 +507,23 @@ msgid "" "terminated." msgstr "" -#: ../../library/multiprocessing.rst:549 +#: ../../library/multiprocessing.rst:551 msgid "A process can be joined many times." msgstr "" -#: ../../library/multiprocessing.rst:551 +#: ../../library/multiprocessing.rst:553 msgid "" "A process cannot join itself because this would cause a deadlock. It is an " "error to attempt to join a process before it has been started." msgstr "" -#: ../../library/multiprocessing.rst:556 +#: ../../library/multiprocessing.rst:558 msgid "" "The process's name. The name is a string used for identification purposes " "only. It has no semantics. Multiple processes may be given the same name." msgstr "" -#: ../../library/multiprocessing.rst:560 +#: ../../library/multiprocessing.rst:562 msgid "" "The initial name is set by the constructor. If no explicit name is provided " "to the constructor, a name of the form 'Process-N\\ :sub:`1`:N\\ :sub:" @@ -531,33 +531,33 @@ msgid "" "child of its parent." msgstr "" -#: ../../library/multiprocessing.rst:567 +#: ../../library/multiprocessing.rst:569 msgid "Return whether the process is alive." msgstr "" -#: ../../library/multiprocessing.rst:569 +#: ../../library/multiprocessing.rst:571 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -#: ../../library/multiprocessing.rst:574 +#: ../../library/multiprocessing.rst:576 msgid "" "The process's daemon flag, a Boolean value. This must be set before :meth:" "`start` is called." msgstr "" -#: ../../library/multiprocessing.rst:577 +#: ../../library/multiprocessing.rst:579 msgid "The initial value is inherited from the creating process." msgstr "" -#: ../../library/multiprocessing.rst:579 +#: ../../library/multiprocessing.rst:581 msgid "" "When a process exits, it attempts to terminate all of its daemonic child " "processes." msgstr "" -#: ../../library/multiprocessing.rst:582 +#: ../../library/multiprocessing.rst:584 msgid "" "Note that a daemonic process is not allowed to create child processes. " "Otherwise a daemonic process would leave its children orphaned if it gets " @@ -566,92 +566,92 @@ msgid "" "(and not joined) if non-daemonic processes have exited." msgstr "" -#: ../../library/multiprocessing.rst:588 +#: ../../library/multiprocessing.rst:590 msgid "" "In addition to the :class:`threading.Thread` API, :class:`Process` objects " "also support the following attributes and methods:" msgstr "" -#: ../../library/multiprocessing.rst:593 +#: ../../library/multiprocessing.rst:595 msgid "" "Return the process ID. Before the process is spawned, this will be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:598 +#: ../../library/multiprocessing.rst:600 msgid "" "The child's exit code. This will be ``None`` if the process has not yet " "terminated." msgstr "" -#: ../../library/multiprocessing.rst:601 +#: ../../library/multiprocessing.rst:603 msgid "" "If the child's :meth:`run` method returned normally, the exit code will be " "0. If it terminated via :func:`sys.exit` with an integer argument *N*, the " "exit code will be *N*." msgstr "" -#: ../../library/multiprocessing.rst:605 +#: ../../library/multiprocessing.rst:607 msgid "" "If the child terminated due to an exception not caught within :meth:`run`, " "the exit code will be 1. If it was terminated by signal *N*, the exit code " "will be the negative value *-N*." msgstr "" -#: ../../library/multiprocessing.rst:611 +#: ../../library/multiprocessing.rst:613 msgid "The process's authentication key (a byte string)." msgstr "" -#: ../../library/multiprocessing.rst:613 +#: ../../library/multiprocessing.rst:615 msgid "" "When :mod:`multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" -#: ../../library/multiprocessing.rst:616 +#: ../../library/multiprocessing.rst:618 msgid "" "When a :class:`Process` object is created, it will inherit the " "authentication key of its parent process, although this may be changed by " "setting :attr:`authkey` to another byte string." msgstr "" -#: ../../library/multiprocessing.rst:620 +#: ../../library/multiprocessing.rst:622 msgid "See :ref:`multiprocessing-auth-keys`." msgstr "參閱 :ref:`multiprocessing-auth-keys`\\ 。" -#: ../../library/multiprocessing.rst:624 +#: ../../library/multiprocessing.rst:626 msgid "" "A numeric handle of a system object which will become \"ready\" when the " "process ends." msgstr "" -#: ../../library/multiprocessing.rst:627 +#: ../../library/multiprocessing.rst:629 msgid "" "You can use this value if you want to wait on several events at once using :" "func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join()` is " "simpler." msgstr "" -#: ../../library/multiprocessing.rst:631 +#: ../../library/multiprocessing.rst:633 msgid "" "On Windows, this is an OS handle usable with the ``WaitForSingleObject`` and " "``WaitForMultipleObjects`` family of API calls. On Unix, this is a file " "descriptor usable with primitives from the :mod:`select` module." msgstr "" -#: ../../library/multiprocessing.rst:639 +#: ../../library/multiprocessing.rst:641 msgid "" "Terminate the process. On Unix this is done using the ``SIGTERM`` signal; " "on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " "finally clauses, etc., will not be executed." msgstr "" -#: ../../library/multiprocessing.rst:643 +#: ../../library/multiprocessing.rst:645 msgid "" "Note that descendant processes of the process will *not* be terminated -- " "they will simply become orphaned." msgstr "" -#: ../../library/multiprocessing.rst:648 +#: ../../library/multiprocessing.rst:650 msgid "" "If this method is used when the associated process is using a pipe or queue " "then the pipe or queue is liable to become corrupted and may become unusable " @@ -660,11 +660,11 @@ msgid "" "deadlock." msgstr "" -#: ../../library/multiprocessing.rst:656 +#: ../../library/multiprocessing.rst:658 msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on Unix." msgstr "" -#: ../../library/multiprocessing.rst:662 +#: ../../library/multiprocessing.rst:664 msgid "" "Close the :class:`Process` object, releasing all resources associated with " "it. :exc:`ValueError` is raised if the underlying process is still " @@ -672,59 +672,59 @@ msgid "" "attributes of the :class:`Process` object will raise :exc:`ValueError`." msgstr "" -#: ../../library/multiprocessing.rst:670 +#: ../../library/multiprocessing.rst:672 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -#: ../../library/multiprocessing.rst:674 +#: ../../library/multiprocessing.rst:676 msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:694 +#: ../../library/multiprocessing.rst:696 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:698 +#: ../../library/multiprocessing.rst:700 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:701 +#: ../../library/multiprocessing.rst:703 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:706 +#: ../../library/multiprocessing.rst:708 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:710 +#: ../../library/multiprocessing.rst:712 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:713 +#: ../../library/multiprocessing.rst:715 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:715 +#: ../../library/multiprocessing.rst:717 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:719 +#: ../../library/multiprocessing.rst:721 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:722 +#: ../../library/multiprocessing.rst:724 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -734,7 +734,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:729 +#: ../../library/multiprocessing.rst:731 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -742,20 +742,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:734 +#: ../../library/multiprocessing.rst:736 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:739 +#: ../../library/multiprocessing.rst:741 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:746 +#: ../../library/multiprocessing.rst:748 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -764,14 +764,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:753 +#: ../../library/multiprocessing.rst:755 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:758 +#: ../../library/multiprocessing.rst:760 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -779,7 +779,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:765 +#: ../../library/multiprocessing.rst:767 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -787,7 +787,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:772 +#: ../../library/multiprocessing.rst:774 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1131 +#: ../../library/multiprocessing.rst:1133 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1134 +#: ../../library/multiprocessing.rst:1136 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1139 +#: ../../library/multiprocessing.rst:1141 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1146 +#: ../../library/multiprocessing.rst:1148 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1150 +#: ../../library/multiprocessing.rst:1152 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1152 +#: ../../library/multiprocessing.rst:1154 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1156 +#: ../../library/multiprocessing.rst:1158 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1158 +#: ../../library/multiprocessing.rst:1160 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1162 +#: ../../library/multiprocessing.rst:1164 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1167 +#: ../../library/multiprocessing.rst:1169 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1169 +#: ../../library/multiprocessing.rst:1171 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1273,7 +1273,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1176 +#: ../../library/multiprocessing.rst:1178 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1281,19 +1281,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1181 +#: ../../library/multiprocessing.rst:1183 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1185 +#: ../../library/multiprocessing.rst:1187 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1192 +#: ../../library/multiprocessing.rst:1194 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1301,45 +1301,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1198 +#: ../../library/multiprocessing.rst:1200 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1203 +#: ../../library/multiprocessing.rst:1205 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1207 +#: ../../library/multiprocessing.rst:1209 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1211 +#: ../../library/multiprocessing.rst:1213 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1216 +#: ../../library/multiprocessing.rst:1218 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1241 +#: ../../library/multiprocessing.rst:1243 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1245 +#: ../../library/multiprocessing.rst:1247 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1347,73 +1347,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1252 +#: ../../library/multiprocessing.rst:1254 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1258 +#: ../../library/multiprocessing.rst:1260 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1262 +#: ../../library/multiprocessing.rst:1264 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1266 +#: ../../library/multiprocessing.rst:1268 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1271 +#: ../../library/multiprocessing.rst:1273 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1277 +#: ../../library/multiprocessing.rst:1279 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1280 -#: ../../library/multiprocessing.rst:1418 +#: ../../library/multiprocessing.rst:1282 +#: ../../library/multiprocessing.rst:1420 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:1284 +#: ../../library/multiprocessing.rst:1286 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1289 +#: ../../library/multiprocessing.rst:1291 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1291 +#: ../../library/multiprocessing.rst:1293 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1294 -#: ../../library/multiprocessing.rst:1843 +#: ../../library/multiprocessing.rst:1296 +#: ../../library/multiprocessing.rst:1845 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1299 +#: ../../library/multiprocessing.rst:1301 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1304 +#: ../../library/multiprocessing.rst:1306 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 " @@ -1424,25 +1424,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1312 +#: ../../library/multiprocessing.rst:1314 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:1316 +#: ../../library/multiprocessing.rst:1318 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1321 -#: ../../library/multiprocessing.rst:1372 +#: ../../library/multiprocessing.rst:1323 +#: ../../library/multiprocessing.rst:1374 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1323 +#: ../../library/multiprocessing.rst:1325 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 " @@ -1450,14 +1450,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1328 +#: ../../library/multiprocessing.rst:1330 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:1332 +#: ../../library/multiprocessing.rst:1334 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 " @@ -1471,19 +1471,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1347 +#: ../../library/multiprocessing.rst:1349 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:1350 +#: ../../library/multiprocessing.rst:1352 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:1356 +#: ../../library/multiprocessing.rst:1358 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. " @@ -1492,20 +1492,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1362 +#: ../../library/multiprocessing.rst:1364 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:1366 +#: ../../library/multiprocessing.rst:1368 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1374 +#: ../../library/multiprocessing.rst:1376 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 " @@ -1518,7 +1518,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1384 +#: ../../library/multiprocessing.rst:1386 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 " @@ -1529,14 +1529,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1392 +#: ../../library/multiprocessing.rst:1394 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:1399 +#: ../../library/multiprocessing.rst:1401 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 " @@ -1546,7 +1546,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1407 +#: ../../library/multiprocessing.rst:1409 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 " @@ -1555,17 +1555,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1416 +#: ../../library/multiprocessing.rst:1418 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1423 +#: ../../library/multiprocessing.rst:1425 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:1428 +#: ../../library/multiprocessing.rst:1430 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1574,13 +1574,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1434 +#: ../../library/multiprocessing.rst:1436 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1439 +#: ../../library/multiprocessing.rst:1441 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1589,32 +1589,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1447 +#: ../../library/multiprocessing.rst:1449 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1449 +#: ../../library/multiprocessing.rst:1451 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1454 +#: ../../library/multiprocessing.rst:1456 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:1458 -#: ../../library/multiprocessing.rst:1545 +#: ../../library/multiprocessing.rst:1460 +#: ../../library/multiprocessing.rst:1547 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:1462 +#: ../../library/multiprocessing.rst:1464 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` " @@ -1624,32 +1624,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1469 +#: ../../library/multiprocessing.rst:1471 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:1475 +#: ../../library/multiprocessing.rst:1477 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1481 -#: ../../library/multiprocessing.rst:1571 -#: ../../library/multiprocessing.rst:1586 +#: ../../library/multiprocessing.rst:1483 +#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1588 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1485 +#: ../../library/multiprocessing.rst:1487 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:1488 +#: ../../library/multiprocessing.rst:1490 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 " @@ -1659,7 +1659,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1495 +#: ../../library/multiprocessing.rst:1497 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:" @@ -1669,28 +1669,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1502 +#: ../../library/multiprocessing.rst:1504 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1504 +#: ../../library/multiprocessing.rst:1506 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:1509 +#: ../../library/multiprocessing.rst:1511 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1514 +#: ../../library/multiprocessing.rst:1516 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:1520 +#: ../../library/multiprocessing.rst:1522 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. " @@ -1699,11 +1699,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1528 +#: ../../library/multiprocessing.rst:1530 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1530 +#: ../../library/multiprocessing.rst:1532 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 " @@ -1713,40 +1713,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1537 +#: ../../library/multiprocessing.rst:1539 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:1543 +#: ../../library/multiprocessing.rst:1545 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1549 +#: ../../library/multiprocessing.rst:1551 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:1553 +#: ../../library/multiprocessing.rst:1555 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:1559 +#: ../../library/multiprocessing.rst:1561 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:1563 -#: ../../library/multiprocessing.rst:1579 +#: ../../library/multiprocessing.rst:1565 +#: ../../library/multiprocessing.rst:1581 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." @@ -1756,121 +1756,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1575 +#: ../../library/multiprocessing.rst:1577 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:1590 +#: ../../library/multiprocessing.rst:1592 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1595 +#: ../../library/multiprocessing.rst:1597 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:1599 +#: ../../library/multiprocessing.rst:1601 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:1603 +#: ../../library/multiprocessing.rst:1605 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:1606 +#: ../../library/multiprocessing.rst:1608 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1610 +#: ../../library/multiprocessing.rst:1612 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:1615 +#: ../../library/multiprocessing.rst:1617 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1617 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1617 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1619 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1619 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1619 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1618 +#: ../../library/multiprocessing.rst:1620 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1618 +#: ../../library/multiprocessing.rst:1620 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1621 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1621 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1621 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1622 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1622 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1622 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1624 +#: ../../library/multiprocessing.rst:1626 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1662 +#: ../../library/multiprocessing.rst:1664 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1675 +#: ../../library/multiprocessing.rst:1677 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1677 +#: ../../library/multiprocessing.rst:1679 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1879,7 +1879,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1686 +#: ../../library/multiprocessing.rst:1688 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1887,31 +1887,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1694 +#: ../../library/multiprocessing.rst:1696 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:1700 +#: ../../library/multiprocessing.rst:1702 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1702 +#: ../../library/multiprocessing.rst:1704 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:1705 +#: ../../library/multiprocessing.rst:1707 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:1708 +#: ../../library/multiprocessing.rst:1710 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`` " @@ -1919,19 +1919,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1713 +#: ../../library/multiprocessing.rst:1715 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1716 +#: ../../library/multiprocessing.rst:1718 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1719 +#: ../../library/multiprocessing.rst:1721 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 " @@ -1939,54 +1939,54 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1724 +#: ../../library/multiprocessing.rst:1726 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1729 +#: ../../library/multiprocessing.rst:1731 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:1734 +#: ../../library/multiprocessing.rst:1736 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:1743 +#: ../../library/multiprocessing.rst:1745 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1747 +#: ../../library/multiprocessing.rst:1749 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1755 +#: ../../library/multiprocessing.rst:1757 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:1758 +#: ../../library/multiprocessing.rst:1760 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1762 +#: ../../library/multiprocessing.rst:1764 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1765 +#: ../../library/multiprocessing.rst:1767 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:1768 +#: ../../library/multiprocessing.rst:1770 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -1994,14 +1994,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1774 +#: ../../library/multiprocessing.rst:1776 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:1778 +#: ../../library/multiprocessing.rst:1780 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2012,7 +2012,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1787 +#: ../../library/multiprocessing.rst:1789 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 " @@ -2022,22 +2022,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1794 +#: ../../library/multiprocessing.rst:1796 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:1798 +#: ../../library/multiprocessing.rst:1800 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1802 +#: ../../library/multiprocessing.rst:1804 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1804 +#: ../../library/multiprocessing.rst:1806 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2045,173 +2045,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1810 +#: ../../library/multiprocessing.rst:1812 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:1815 +#: ../../library/multiprocessing.rst:1817 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:1819 +#: ../../library/multiprocessing.rst:1821 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:1825 +#: ../../library/multiprocessing.rst:1827 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1832 +#: ../../library/multiprocessing.rst:1834 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1837 +#: ../../library/multiprocessing.rst:1839 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1840 +#: ../../library/multiprocessing.rst:1842 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:1848 +#: ../../library/multiprocessing.rst:1850 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1852 +#: ../../library/multiprocessing.rst:1854 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1856 +#: ../../library/multiprocessing.rst:1858 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1860 +#: ../../library/multiprocessing.rst:1862 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1864 +#: ../../library/multiprocessing.rst:1866 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1868 +#: ../../library/multiprocessing.rst:1870 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1873 +#: ../../library/multiprocessing.rst:1875 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1877 +#: ../../library/multiprocessing.rst:1879 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1884 +#: ../../library/multiprocessing.rst:1886 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1889 +#: ../../library/multiprocessing.rst:1891 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1891 +#: ../../library/multiprocessing.rst:1893 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:1898 +#: ../../library/multiprocessing.rst:1900 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1900 +#: ../../library/multiprocessing.rst:1902 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:1903 +#: ../../library/multiprocessing.rst:1905 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:1919 +#: ../../library/multiprocessing.rst:1921 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1921 +#: ../../library/multiprocessing.rst:1923 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:1946 +#: ../../library/multiprocessing.rst:1948 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1948 +#: ../../library/multiprocessing.rst:1950 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:1951 +#: ../../library/multiprocessing.rst:1953 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1963 +#: ../../library/multiprocessing.rst:1965 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1973 +#: ../../library/multiprocessing.rst:1975 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1984 +#: ../../library/multiprocessing.rst:1986 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2009 +#: ../../library/multiprocessing.rst:2011 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2011 +#: ../../library/multiprocessing.rst:2013 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:2015 +#: ../../library/multiprocessing.rst:2017 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2219,14 +2219,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2033 +#: ../../library/multiprocessing.rst:2035 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:2037 +#: ../../library/multiprocessing.rst:2039 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:" @@ -2234,11 +2234,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2053 +#: ../../library/multiprocessing.rst:2055 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2066 +#: ../../library/multiprocessing.rst:2068 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 " @@ -2249,53 +2249,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2085 +#: ../../library/multiprocessing.rst:2087 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:2091 +#: ../../library/multiprocessing.rst:2093 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2099 +#: ../../library/multiprocessing.rst:2101 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2103 +#: ../../library/multiprocessing.rst:2105 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2107 +#: ../../library/multiprocessing.rst:2109 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2109 +#: ../../library/multiprocessing.rst:2111 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2113 +#: ../../library/multiprocessing.rst:2115 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2117 +#: ../../library/multiprocessing.rst:2119 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2119 +#: ../../library/multiprocessing.rst:2121 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:2123 +#: ../../library/multiprocessing.rst:2125 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 " @@ -2303,79 +2303,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2128 +#: ../../library/multiprocessing.rst:2130 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2131 +#: ../../library/multiprocessing.rst:2133 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2147 +#: ../../library/multiprocessing.rst:2149 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2151 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2153 +#: ../../library/multiprocessing.rst:2155 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2157 +#: ../../library/multiprocessing.rst:2159 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2161 +#: ../../library/multiprocessing.rst:2163 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2163 +#: ../../library/multiprocessing.rst:2165 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:2166 +#: ../../library/multiprocessing.rst:2168 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2171 +#: ../../library/multiprocessing.rst:2173 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2176 +#: ../../library/multiprocessing.rst:2178 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:2181 +#: ../../library/multiprocessing.rst:2183 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:2185 +#: ../../library/multiprocessing.rst:2187 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2188 -#: ../../library/multiprocessing.rst:2749 +#: ../../library/multiprocessing.rst:2190 +#: ../../library/multiprocessing.rst:2751 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2191 +#: ../../library/multiprocessing.rst:2193 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 " @@ -2383,7 +2383,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2196 +#: ../../library/multiprocessing.rst:2198 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2391,13 +2391,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2202 +#: ../../library/multiprocessing.rst:2204 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2206 +#: ../../library/multiprocessing.rst:2208 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 " @@ -2405,22 +2405,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2211 +#: ../../library/multiprocessing.rst:2213 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:2215 +#: ../../library/multiprocessing.rst:2217 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2218 +#: ../../library/multiprocessing.rst:2220 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2223 +#: ../../library/multiprocessing.rst:2225 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 " @@ -2431,7 +2431,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2233 +#: ../../library/multiprocessing.rst:2235 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 " @@ -2439,14 +2439,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2240 +#: ../../library/multiprocessing.rst:2242 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2243 -#: ../../library/multiprocessing.rst:2274 +#: ../../library/multiprocessing.rst:2245 +#: ../../library/multiprocessing.rst:2276 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, " @@ -2454,60 +2454,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2248 -#: ../../library/multiprocessing.rst:2279 +#: ../../library/multiprocessing.rst:2250 +#: ../../library/multiprocessing.rst:2281 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:2252 -#: ../../library/multiprocessing.rst:2283 +#: ../../library/multiprocessing.rst:2254 +#: ../../library/multiprocessing.rst:2285 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2257 +#: ../../library/multiprocessing.rst:2259 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:2261 +#: ../../library/multiprocessing.rst:2263 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:2265 +#: ../../library/multiprocessing.rst:2267 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:2271 +#: ../../library/multiprocessing.rst:2273 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2288 +#: ../../library/multiprocessing.rst:2290 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2290 +#: ../../library/multiprocessing.rst:2292 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:2295 +#: ../../library/multiprocessing.rst:2297 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: " @@ -2515,65 +2515,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2302 +#: ../../library/multiprocessing.rst:2304 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:2308 +#: ../../library/multiprocessing.rst:2310 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:2312 +#: ../../library/multiprocessing.rst:2314 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2319 +#: ../../library/multiprocessing.rst:2321 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:2327 +#: ../../library/multiprocessing.rst:2329 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:2332 +#: ../../library/multiprocessing.rst:2334 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:2338 +#: ../../library/multiprocessing.rst:2340 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2341 +#: ../../library/multiprocessing.rst:2343 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:2349 +#: ../../library/multiprocessing.rst:2351 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2354 +#: ../../library/multiprocessing.rst:2356 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2581,41 +2581,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2361 +#: ../../library/multiprocessing.rst:2363 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2365 +#: ../../library/multiprocessing.rst:2367 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2369 +#: ../../library/multiprocessing.rst:2371 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2372 +#: ../../library/multiprocessing.rst:2374 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2376 +#: ../../library/multiprocessing.rst:2378 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2403 +#: ../../library/multiprocessing.rst:2405 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2408 +#: ../../library/multiprocessing.rst:2410 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:2412 +#: ../../library/multiprocessing.rst:2414 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2624,46 +2624,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2421 +#: ../../library/multiprocessing.rst:2423 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2424 +#: ../../library/multiprocessing.rst:2426 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:2430 +#: ../../library/multiprocessing.rst:2432 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:2433 +#: ../../library/multiprocessing.rst:2435 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2438 +#: ../../library/multiprocessing.rst:2440 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2441 +#: ../../library/multiprocessing.rst:2443 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:2445 -#: ../../library/multiprocessing.rst:2480 +#: ../../library/multiprocessing.rst:2447 +#: ../../library/multiprocessing.rst:2482 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 " @@ -2672,26 +2672,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2453 +#: ../../library/multiprocessing.rst:2455 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2456 +#: ../../library/multiprocessing.rst:2458 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2461 +#: ../../library/multiprocessing.rst:2463 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:2465 +#: ../../library/multiprocessing.rst:2467 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 " @@ -2705,49 +2705,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2476 +#: ../../library/multiprocessing.rst:2478 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:2488 +#: ../../library/multiprocessing.rst:2490 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:2495 +#: ../../library/multiprocessing.rst:2497 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:2499 +#: ../../library/multiprocessing.rst:2501 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2503 +#: ../../library/multiprocessing.rst:2505 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2507 +#: ../../library/multiprocessing.rst:2509 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2510 +#: ../../library/multiprocessing.rst:2512 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:2517 +#: ../../library/multiprocessing.rst:2519 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 " @@ -2756,32 +2756,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2523 +#: ../../library/multiprocessing.rst:2525 msgid "" "For both Unix and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2526 +#: ../../library/multiprocessing.rst:2528 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2527 +#: ../../library/multiprocessing.rst:2529 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2528 +#: ../../library/multiprocessing.rst:2530 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2531 +#: ../../library/multiprocessing.rst:2533 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:2534 +#: ../../library/multiprocessing.rst:2536 msgid "" "**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2789,7 +2789,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2540 +#: ../../library/multiprocessing.rst:2542 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 " @@ -2798,46 +2798,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2550 +#: ../../library/multiprocessing.rst:2552 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2552 +#: ../../library/multiprocessing.rst:2554 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:2571 +#: ../../library/multiprocessing.rst:2573 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2588 +#: ../../library/multiprocessing.rst:2590 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2627 +#: ../../library/multiprocessing.rst:2629 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2629 +#: ../../library/multiprocessing.rst:2631 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:2632 +#: ../../library/multiprocessing.rst:2634 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2635 +#: ../../library/multiprocessing.rst:2637 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -2846,17 +2846,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2640 +#: ../../library/multiprocessing.rst:2642 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:2647 +#: ../../library/multiprocessing.rst:2649 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2649 +#: ../../library/multiprocessing.rst:2651 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2864,7 +2864,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2655 +#: ../../library/multiprocessing.rst:2657 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 " @@ -2872,7 +2872,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2661 +#: ../../library/multiprocessing.rst:2663 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2883,17 +2883,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2669 +#: ../../library/multiprocessing.rst:2671 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2673 +#: ../../library/multiprocessing.rst:2675 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2675 +#: ../../library/multiprocessing.rst:2677 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2901,27 +2901,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2682 +#: ../../library/multiprocessing.rst:2684 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2685 +#: ../../library/multiprocessing.rst:2687 msgid "" "When first created the logger has level :data:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2689 +#: ../../library/multiprocessing.rst:2691 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:2696 +#: ../../library/multiprocessing.rst:2698 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 " @@ -2930,25 +2930,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2702 +#: ../../library/multiprocessing.rst:2704 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2717 +#: ../../library/multiprocessing.rst:2719 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2721 +#: ../../library/multiprocessing.rst:2723 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2726 +#: ../../library/multiprocessing.rst:2728 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:2731 +#: ../../library/multiprocessing.rst:2733 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2956,7 +2956,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2739 +#: ../../library/multiprocessing.rst:2741 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2966,18 +2966,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2746 +#: ../../library/multiprocessing.rst:2748 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2752 +#: ../../library/multiprocessing.rst:2754 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2756 +#: ../../library/multiprocessing.rst:2758 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 :" @@ -2987,7 +2987,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2763 +#: ../../library/multiprocessing.rst:2765 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2996,69 +2996,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2773 +#: ../../library/multiprocessing.rst:2775 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2775 +#: ../../library/multiprocessing.rst:2777 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2780 +#: ../../library/multiprocessing.rst:2782 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2782 +#: ../../library/multiprocessing.rst:2784 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2784 +#: ../../library/multiprocessing.rst:2786 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2786 +#: ../../library/multiprocessing.rst:2788 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2789 +#: ../../library/multiprocessing.rst:2791 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:2793 +#: ../../library/multiprocessing.rst:2795 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2795 +#: ../../library/multiprocessing.rst:2797 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2797 +#: ../../library/multiprocessing.rst:2799 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2799 +#: ../../library/multiprocessing.rst:2801 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2802 +#: ../../library/multiprocessing.rst:2804 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2804 +#: ../../library/multiprocessing.rst:2806 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2806 +#: ../../library/multiprocessing.rst:2808 msgid "" "On Unix 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 starts (or :" @@ -3069,11 +3069,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2814 +#: ../../library/multiprocessing.rst:2816 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2816 +#: ../../library/multiprocessing.rst:2818 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3083,11 +3083,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2826 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2826 +#: ../../library/multiprocessing.rst:2828 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3095,18 +3095,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2832 +#: ../../library/multiprocessing.rst:2834 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:2836 +#: ../../library/multiprocessing.rst:2838 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2838 +#: ../../library/multiprocessing.rst:2840 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 " @@ -3115,7 +3115,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2844 +#: ../../library/multiprocessing.rst:2846 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 " @@ -3124,21 +3124,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2850 +#: ../../library/multiprocessing.rst:2852 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2864 +#: ../../library/multiprocessing.rst:2866 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2867 +#: ../../library/multiprocessing.rst:2869 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2869 +#: ../../library/multiprocessing.rst:2871 msgid "" "On Unix using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3146,7 +3146,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2874 +#: ../../library/multiprocessing.rst:2876 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 " @@ -3155,29 +3155,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2881 +#: ../../library/multiprocessing.rst:2883 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2893 +#: ../../library/multiprocessing.rst:2895 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2905 +#: ../../library/multiprocessing.rst:2907 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2907 +#: ../../library/multiprocessing.rst:2909 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2911 +#: ../../library/multiprocessing.rst:2913 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:2917 +#: ../../library/multiprocessing.rst:2919 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3187,33 +3187,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2924 +#: ../../library/multiprocessing.rst:2926 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:2936 +#: ../../library/multiprocessing.rst:2938 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2939 +#: ../../library/multiprocessing.rst:2941 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2941 +#: ../../library/multiprocessing.rst:2943 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2944 +#: ../../library/multiprocessing.rst:2946 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2946 +#: ../../library/multiprocessing.rst:2948 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3221,11 +3221,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2951 +#: ../../library/multiprocessing.rst:2953 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2953 +#: ../../library/multiprocessing.rst:2955 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 " @@ -3233,66 +3233,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2958 +#: ../../library/multiprocessing.rst:2960 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2963 +#: ../../library/multiprocessing.rst:2965 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2965 +#: ../../library/multiprocessing.rst:2967 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such a starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:2969 +#: ../../library/multiprocessing.rst:2971 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2981 +#: ../../library/multiprocessing.rst:2983 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2995 +#: ../../library/multiprocessing.rst:2997 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:2998 +#: ../../library/multiprocessing.rst:3000 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:3001 +#: ../../library/multiprocessing.rst:3003 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3008 +#: ../../library/multiprocessing.rst:3010 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3010 +#: ../../library/multiprocessing.rst:3012 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3016 +#: ../../library/multiprocessing.rst:3018 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:3022 +#: ../../library/multiprocessing.rst:3024 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" diff --git a/library/types.po b/library/types.po index 76b6a97fb9..6ff6b17469 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-28 00:17+0000\n" +"POT-Creation-Date: 2023-04-12 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -122,11 +122,11 @@ msgstr "" #: ../../library/types.rst:76 msgid "" "This function looks for items in *bases* that are not instances of :class:" -"`type`, and returns a tuple where each such object that has an " -"``__mro_entries__`` method is replaced with an unpacked result of calling " -"this method. If a *bases* item is an instance of :class:`type`, or it " -"doesn't have an ``__mro_entries__`` method, then it is included in the " -"return tuple unchanged." +"`type`, and returns a tuple where each such object that has an :meth:" +"`~object.__mro_entries__` method is replaced with an unpacked result of " +"calling this method. If a *bases* item is an instance of :class:`type`, or " +"it doesn't have an :meth:`!__mro_entries__` method, then it is included in " +"the return tuple unchanged." msgstr "" #: ../../library/types.rst:87 diff --git a/reference/datamodel.po b/reference/datamodel.po index efd986b833..e6907e9588 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-09 00:16+0000\n" +"POT-Creation-Date: 2023-04-12 00:15+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-" @@ -2480,45 +2480,58 @@ msgstr "" #: ../../reference/datamodel.rst:2090 msgid "" "If a base that appears in a class definition is not an instance of :class:" -"`type`, then an ``__mro_entries__`` method is searched on the base. If an " -"``__mro_entries__`` method is found, the base is substituted with the result " -"of a call to ``__mro_entries__`` when creating the class. The method is " -"called with the original bases tuple, and must return a tuple of classes " -"that will be used instead of the base. The returned tuple may be empty: in " -"these cases, the original base is ignored." +"`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " +"an :meth:`!__mro_entries__` method is found, the base is substituted with " +"the result of a call to :meth:`!__mro_entries__` when creating the class. " +"The method is called with the original bases tuple passed to the *bases* " +"parameter, and must return a tuple of classes that will be used instead of " +"the base. The returned tuple may be empty: in these cases, the original base " +"is ignored." msgstr "" -#: ../../reference/datamodel.rst:2100 -msgid ":pep:`560` - Core support for typing module and generic types" +#: ../../reference/datamodel.rst:2102 +msgid ":func:`types.resolve_bases`" +msgstr "" + +#: ../../reference/datamodel.rst:2102 +msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" #: ../../reference/datamodel.rst:2104 +msgid ":pep:`560`" +msgstr "" + +#: ../../reference/datamodel.rst:2105 +msgid "Core support for typing module and generic types." +msgstr "" + +#: ../../reference/datamodel.rst:2109 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2108 +#: ../../reference/datamodel.rst:2113 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2110 +#: ../../reference/datamodel.rst:2115 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2111 +#: ../../reference/datamodel.rst:2116 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2113 +#: ../../reference/datamodel.rst:2118 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2116 +#: ../../reference/datamodel.rst:2121 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2527,11 +2540,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2126 +#: ../../reference/datamodel.rst:2131 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2131 +#: ../../reference/datamodel.rst:2136 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2543,25 +2556,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2140 +#: ../../reference/datamodel.rst:2145 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2145 +#: ../../reference/datamodel.rst:2150 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2146 +#: ../../reference/datamodel.rst:2151 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2150 +#: ../../reference/datamodel.rst:2155 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2155 +#: ../../reference/datamodel.rst:2160 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2570,7 +2583,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2161 +#: ../../reference/datamodel.rst:2166 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2579,11 +2592,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2170 +#: ../../reference/datamodel.rst:2175 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2177 +#: ../../reference/datamodel.rst:2182 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2591,7 +2604,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2182 +#: ../../reference/datamodel.rst:2187 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2602,7 +2615,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2197 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2611,39 +2624,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2198 +#: ../../reference/datamodel.rst:2203 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2202 +#: ../../reference/datamodel.rst:2207 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2204 +#: ../../reference/datamodel.rst:2209 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2206 +#: ../../reference/datamodel.rst:2211 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2214 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2213 +#: ../../reference/datamodel.rst:2218 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2651,19 +2664,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2220 +#: ../../reference/datamodel.rst:2225 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2221 +#: ../../reference/datamodel.rst:2226 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2225 +#: ../../reference/datamodel.rst:2230 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2227 +#: ../../reference/datamodel.rst:2232 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2671,17 +2684,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2234 +#: ../../reference/datamodel.rst:2239 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2236 +#: ../../reference/datamodel.rst:2241 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2239 +#: ../../reference/datamodel.rst:2244 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2689,21 +2702,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2246 +#: ../../reference/datamodel.rst:2251 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2253 +#: ../../reference/datamodel.rst:2258 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2258 +#: ../../reference/datamodel.rst:2263 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2711,11 +2724,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2269 +#: ../../reference/datamodel.rst:2274 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2266 +#: ../../reference/datamodel.rst:2271 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2724,11 +2737,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2274 +#: ../../reference/datamodel.rst:2279 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2276 +#: ../../reference/datamodel.rst:2281 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2736,65 +2749,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2289 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2289 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2287 +#: ../../reference/datamodel.rst:2292 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2287 +#: ../../reference/datamodel.rst:2292 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2290 +#: ../../reference/datamodel.rst:2295 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2290 +#: ../../reference/datamodel.rst:2295 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2293 +#: ../../reference/datamodel.rst:2298 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2298 +#: ../../reference/datamodel.rst:2303 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2301 +#: ../../reference/datamodel.rst:2306 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2307 +#: ../../reference/datamodel.rst:2312 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2314 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2313 +#: ../../reference/datamodel.rst:2318 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2803,7 +2816,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2319 +#: ../../reference/datamodel.rst:2324 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2811,11 +2824,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2334 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2336 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2825,14 +2838,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2338 +#: ../../reference/datamodel.rst:2343 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2366 +#: ../../reference/datamodel.rst:2371 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2842,40 +2855,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2385 +#: ../../reference/datamodel.rst:2390 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2410 +#: ../../reference/datamodel.rst:2415 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2409 +#: ../../reference/datamodel.rst:2414 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2417 +#: ../../reference/datamodel.rst:2422 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2424 +#: ../../reference/datamodel.rst:2429 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2431 +#: ../../reference/datamodel.rst:2436 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2433 +#: ../../reference/datamodel.rst:2438 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2911,7 +2924,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2473 +#: ../../reference/datamodel.rst:2478 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2919,7 +2932,7 @@ msgid "" "zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2480 +#: ../../reference/datamodel.rst:2485 msgid "" "In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " "length is larger than :attr:`!sys.maxsize` some features (such as :func:" @@ -2928,7 +2941,7 @@ msgid "" "`__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2489 +#: ../../reference/datamodel.rst:2494 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2938,20 +2951,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2503 +#: ../../reference/datamodel.rst:2508 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2507 +#: ../../reference/datamodel.rst:2512 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2511 +#: ../../reference/datamodel.rst:2516 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2516 +#: ../../reference/datamodel.rst:2521 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -2964,20 +2977,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2528 +#: ../../reference/datamodel.rst:2533 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2533 +#: ../../reference/datamodel.rst:2538 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2541 +#: ../../reference/datamodel.rst:2546 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2986,7 +2999,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2550 +#: ../../reference/datamodel.rst:2555 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2995,13 +3008,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2559 +#: ../../reference/datamodel.rst:2564 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2565 +#: ../../reference/datamodel.rst:2570 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3009,14 +3022,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2573 +#: ../../reference/datamodel.rst:2578 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2577 +#: ../../reference/datamodel.rst:2582 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3025,7 +3038,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2584 +#: ../../reference/datamodel.rst:2589 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3033,14 +3046,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2591 +#: ../../reference/datamodel.rst:2596 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2595 +#: ../../reference/datamodel.rst:2600 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3048,11 +3061,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2604 +#: ../../reference/datamodel.rst:2609 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2606 +#: ../../reference/datamodel.rst:2611 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3060,7 +3073,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2632 +#: ../../reference/datamodel.rst:2637 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3074,13 +3087,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2643 +#: ../../reference/datamodel.rst:2648 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2666 +#: ../../reference/datamodel.rst:2671 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3093,13 +3106,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2678 +#: ../../reference/datamodel.rst:2683 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2683 +#: ../../reference/datamodel.rst:2688 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3108,7 +3121,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2704 +#: ../../reference/datamodel.rst:2709 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3124,19 +3137,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2725 +#: ../../reference/datamodel.rst:2730 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2738 +#: ../../reference/datamodel.rst:2743 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2745 +#: ../../reference/datamodel.rst:2750 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3145,14 +3158,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2751 +#: ../../reference/datamodel.rst:2756 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2763 +#: ../../reference/datamodel.rst:2768 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3161,21 +3174,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2769 +#: ../../reference/datamodel.rst:2774 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2772 +#: ../../reference/datamodel.rst:2777 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2779 +#: ../../reference/datamodel.rst:2784 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2781 +#: ../../reference/datamodel.rst:2786 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3185,32 +3198,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2792 +#: ../../reference/datamodel.rst:2797 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2795 +#: ../../reference/datamodel.rst:2800 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2800 +#: ../../reference/datamodel.rst:2805 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2807 +#: ../../reference/datamodel.rst:2812 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2811 +#: ../../reference/datamodel.rst:2816 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3218,27 +3231,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2815 +#: ../../reference/datamodel.rst:2820 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2822 +#: ../../reference/datamodel.rst:2827 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2822 +#: ../../reference/datamodel.rst:2827 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2829 +#: ../../reference/datamodel.rst:2834 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2831 +#: ../../reference/datamodel.rst:2836 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3246,7 +3259,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2838 +#: ../../reference/datamodel.rst:2843 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3255,7 +3268,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2844 +#: ../../reference/datamodel.rst:2849 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3265,19 +3278,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:2859 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2855 +#: ../../reference/datamodel.rst:2860 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2861 +#: ../../reference/datamodel.rst:2866 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2863 +#: ../../reference/datamodel.rst:2868 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3285,7 +3298,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2878 +#: ../../reference/datamodel.rst:2883 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3294,21 +3307,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2892 +#: ../../reference/datamodel.rst:2897 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:2901 +#: ../../reference/datamodel.rst:2906 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:2927 +#: ../../reference/datamodel.rst:2932 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3317,36 +3330,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:2938 +#: ../../reference/datamodel.rst:2943 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:2942 +#: ../../reference/datamodel.rst:2947 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:2944 +#: ../../reference/datamodel.rst:2949 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:2950 +#: ../../reference/datamodel.rst:2955 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:2956 +#: ../../reference/datamodel.rst:2961 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:2962 +#: ../../reference/datamodel.rst:2967 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3354,15 +3367,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:2970 +#: ../../reference/datamodel.rst:2975 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:2976 +#: ../../reference/datamodel.rst:2981 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:2978 +#: ../../reference/datamodel.rst:2983 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3373,18 +3386,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:2991 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:2990 +#: ../../reference/datamodel.rst:2995 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:2996 +#: ../../reference/datamodel.rst:3001 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3395,7 +3408,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3007 +#: ../../reference/datamodel.rst:3012 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3406,7 +3419,7 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3018 +#: ../../reference/datamodel.rst:3023 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3416,99 +3429,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3026 +#: ../../reference/datamodel.rst:3031 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3032 +#: ../../reference/datamodel.rst:3037 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3034 +#: ../../reference/datamodel.rst:3039 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3037 +#: ../../reference/datamodel.rst:3042 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3041 +#: ../../reference/datamodel.rst:3046 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3045 +#: ../../reference/datamodel.rst:3050 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3048 +#: ../../reference/datamodel.rst:3053 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3065 +#: ../../reference/datamodel.rst:3070 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3070 +#: ../../reference/datamodel.rst:3075 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3078 +#: ../../reference/datamodel.rst:3083 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3080 +#: ../../reference/datamodel.rst:3085 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3083 +#: ../../reference/datamodel.rst:3088 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3087 +#: ../../reference/datamodel.rst:3092 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3092 +#: ../../reference/datamodel.rst:3097 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3095 +#: ../../reference/datamodel.rst:3100 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3108 +#: ../../reference/datamodel.rst:3113 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3109 +#: ../../reference/datamodel.rst:3114 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3113 +#: ../../reference/datamodel.rst:3118 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3516,7 +3529,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3119 +#: ../../reference/datamodel.rst:3124 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3524,7 +3537,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3125 +#: ../../reference/datamodel.rst:3130 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " From d27082ba9e64ed9211ddcc8eea26cabe615307ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 13 Apr 2023 00:16:14 +0000 Subject: [PATCH 05/14] sync with cpython e643412e --- library/pdb.po | 262 +++++++++++++++++++++++++++---------------------- 1 file changed, 146 insertions(+), 116 deletions(-) diff --git a/library/pdb.po b/library/pdb.po index 92f066a2a2..a5d4dc51c2 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-26 00:17+0000\n" +"POT-Creation-Date: 2023-04-13 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -64,74 +64,82 @@ msgid "" msgstr "" #: ../../library/pdb.rst:39 +msgid "The typical usage to break into the debugger is to insert::" +msgstr "" + +#: ../../library/pdb.rst:43 +msgid "Or::" +msgstr "" + +#: ../../library/pdb.rst:47 +msgid "" +"at the location you want to break into the debugger, and then run the " +"program. You can then step through the code following this statement, and " +"continue running without the debugger using the :pdbcmd:`continue` command." +msgstr "" + +#: ../../library/pdb.rst:51 msgid "" -"The debugger's prompt is ``(Pdb)``. Typical usage to run a program under " -"control of the debugger is::" +"The built-in :func:`breakpoint()`, when called with defaults, can be used " +"instead of ``import pdb; pdb.set_trace()``." msgstr "" -#: ../../library/pdb.rst:53 +#: ../../library/pdb.rst:63 +msgid "" +"The debugger's prompt is ``(Pdb)``, which is the indicator that you are in " +"debug mode::" +msgstr "" + +#: ../../library/pdb.rst:72 msgid "" "Tab-completion via the :mod:`readline` module is available for commands and " "command arguments, e.g. the current global and local names are offered as " "arguments of the ``p`` command." msgstr "" -#: ../../library/pdb.rst:58 +#: ../../library/pdb.rst:78 msgid "" -":file:`pdb.py` can also be invoked as a script to debug other scripts. For " -"example::" +"You can also invoke :mod:`pdb` from the command line to debug other " +"scripts. For example::" msgstr "" -#: ../../library/pdb.rst:63 +#: ../../library/pdb.rst:83 msgid "" -"When invoked as a script, pdb will automatically enter post-mortem debugging " +"When invoked as a module, pdb will automatically enter post-mortem debugging " "if the program being debugged exits abnormally. After post-mortem debugging " "(or after normal exit of the program), pdb will restart the program. " "Automatic restarting preserves pdb's state (such as breakpoints) and in most " "cases is more useful than quitting the debugger upon program's exit." msgstr "" -#: ../../library/pdb.rst:69 +#: ../../library/pdb.rst:89 msgid "" -":file:`pdb.py` now accepts a ``-c`` option that executes commands as if " -"given in a :file:`.pdbrc` file, see :ref:`debugger-commands`." +"``-c`` option is introduced to execute commands as if given in a :file:`." +"pdbrc` file, see :ref:`debugger-commands`." msgstr "" -#: ../../library/pdb.rst:73 +#: ../../library/pdb.rst:93 msgid "" -":file:`pdb.py` now accepts a ``-m`` option that execute modules similar to " -"the way ``python -m`` does. As with a script, the debugger will pause " -"execution just before the first line of the module." -msgstr "" - -#: ../../library/pdb.rst:79 -msgid "The typical usage to break into the debugger is to insert::" -msgstr "" - -#: ../../library/pdb.rst:83 -msgid "" -"at the location you want to break into the debugger, and then run the " -"program. You can then step through the code following this statement, and " -"continue running without the debugger using the :pdbcmd:`continue` command." +"``-m`` option is introduced to execute modules similar to the way ``python -" +"m`` does. As with a script, the debugger will pause execution just before " +"the first line of the module." msgstr "" -#: ../../library/pdb.rst:87 -msgid "" -"The built-in :func:`breakpoint()`, when called with defaults, can be used " -"instead of ``import pdb; pdb.set_trace()``." +#: ../../library/pdb.rst:98 +msgid "Typical usage to execute a statement under control of the debugger is::" msgstr "" -#: ../../library/pdb.rst:91 +#: ../../library/pdb.rst:109 msgid "The typical usage to inspect a crashed program is::" msgstr "" -#: ../../library/pdb.rst:109 +#: ../../library/pdb.rst:127 msgid "" "The module defines the following functions; each enters the debugger in a " "slightly different way:" msgstr "" -#: ../../library/pdb.rst:114 +#: ../../library/pdb.rst:132 msgid "" "Execute the *statement* (given as a string or a code object) under debugger " "control. The debugger prompt appears before any code is executed; you can " @@ -143,14 +151,14 @@ msgid "" "`exec` or :func:`eval` functions.)" msgstr "" -#: ../../library/pdb.rst:126 +#: ../../library/pdb.rst:144 msgid "" "Evaluate the *expression* (given as a string or a code object) under " "debugger control. When :func:`runeval` returns, it returns the value of the " "*expression*. Otherwise this function is similar to :func:`run`." msgstr "" -#: ../../library/pdb.rst:133 +#: ../../library/pdb.rst:151 msgid "" "Call the *function* (a function or method object, not a string) with the " "given arguments. When :func:`runcall` returns, it returns whatever the " @@ -158,7 +166,7 @@ msgid "" "is entered." msgstr "" -#: ../../library/pdb.rst:141 +#: ../../library/pdb.rst:159 msgid "" "Enter the debugger at the calling stack frame. This is useful to hard-code " "a breakpoint at a given point in a program, even if the code is not " @@ -166,11 +174,11 @@ msgid "" "is printed to the console just before debugging begins." msgstr "" -#: ../../library/pdb.rst:146 +#: ../../library/pdb.rst:164 msgid "The keyword-only argument *header*." msgstr "" -#: ../../library/pdb.rst:152 +#: ../../library/pdb.rst:170 msgid "" "Enter post-mortem debugging of the given *traceback* object. If no " "*traceback* is given, it uses the one of the exception that is currently " @@ -178,37 +186,37 @@ msgid "" "used)." msgstr "" -#: ../../library/pdb.rst:160 +#: ../../library/pdb.rst:178 msgid "" "Enter post-mortem debugging of the traceback found in :data:`sys." "last_traceback`." msgstr "" -#: ../../library/pdb.rst:164 +#: ../../library/pdb.rst:182 msgid "" "The ``run*`` functions and :func:`set_trace` are aliases for instantiating " "the :class:`Pdb` class and calling the method of the same name. If you want " "to access further features, you have to do this yourself:" msgstr "" -#: ../../library/pdb.rst:171 +#: ../../library/pdb.rst:189 msgid ":class:`Pdb` is the debugger class." msgstr "" -#: ../../library/pdb.rst:173 +#: ../../library/pdb.rst:191 msgid "" "The *completekey*, *stdin* and *stdout* arguments are passed to the " "underlying :class:`cmd.Cmd` class; see the description there." msgstr "" -#: ../../library/pdb.rst:176 +#: ../../library/pdb.rst:194 msgid "" "The *skip* argument, if given, must be an iterable of glob-style module name " "patterns. The debugger will not step into frames that originate in a module " "that matches one of these patterns. [1]_" msgstr "" -#: ../../library/pdb.rst:180 +#: ../../library/pdb.rst:198 msgid "" "By default, Pdb sets a handler for the SIGINT signal (which is sent when the " "user presses :kbd:`Ctrl-C` on the console) when you give a :pdbcmd:" @@ -217,13 +225,13 @@ msgid "" "set *nosigint* to true." msgstr "" -#: ../../library/pdb.rst:185 +#: ../../library/pdb.rst:203 msgid "" "The *readrc* argument defaults to true and controls whether Pdb will load ." "pdbrc files from the filesystem." msgstr "" -#: ../../library/pdb.rst:188 +#: ../../library/pdb.rst:206 msgid "Example call to enable tracing with *skip*::" msgstr "" @@ -232,28 +240,28 @@ msgid "" "Raises an :ref:`auditing event ` ``pdb.Pdb`` with no arguments." msgstr "" -#: ../../library/pdb.rst:194 +#: ../../library/pdb.rst:212 msgid "The *skip* argument." msgstr "" -#: ../../library/pdb.rst:197 +#: ../../library/pdb.rst:215 msgid "" "The *nosigint* argument. Previously, a SIGINT handler was never set by Pdb." msgstr "" -#: ../../library/pdb.rst:201 +#: ../../library/pdb.rst:219 msgid "The *readrc* argument." msgstr "" -#: ../../library/pdb.rst:209 +#: ../../library/pdb.rst:227 msgid "See the documentation for the functions explained above." msgstr "" -#: ../../library/pdb.rst:215 +#: ../../library/pdb.rst:233 msgid "Debugger Commands" msgstr "" -#: ../../library/pdb.rst:217 +#: ../../library/pdb.rst:235 msgid "" "The commands recognized by the debugger are listed below. Most commands can " "be abbreviated to one or two letters as indicated; e.g. ``h(elp)`` means " @@ -265,13 +273,13 @@ msgid "" "are separated by a vertical bar (``|``)." msgstr "" -#: ../../library/pdb.rst:226 +#: ../../library/pdb.rst:244 msgid "" "Entering a blank line repeats the last command entered. Exception: if the " "last command was a :pdbcmd:`list` command, the next 11 lines are listed." msgstr "" -#: ../../library/pdb.rst:229 +#: ../../library/pdb.rst:247 msgid "" "Commands that the debugger doesn't recognize are assumed to be Python " "statements and are executed in the context of the program being debugged. " @@ -282,14 +290,14 @@ msgid "" "is not changed." msgstr "" -#: ../../library/pdb.rst:237 +#: ../../library/pdb.rst:255 msgid "" "The debugger supports :ref:`aliases `. Aliases can have " "parameters which allows one a certain level of adaptability to the context " "under examination." msgstr "" -#: ../../library/pdb.rst:241 +#: ../../library/pdb.rst:259 msgid "" "Multiple commands may be entered on a single line, separated by ``;;``. (A " "single ``;`` is not used as it is the separator for multiple commands in a " @@ -300,7 +308,7 @@ msgid "" "\"\";\"``." msgstr "" -#: ../../library/pdb.rst:252 +#: ../../library/pdb.rst:270 msgid "" "If a file :file:`.pdbrc` exists in the user's home directory or in the " "current directory, it is read with ``'utf-8'`` encoding and executed as if " @@ -309,20 +317,20 @@ msgid "" "and aliases defined there can be overridden by the local file." msgstr "" -#: ../../library/pdb.rst:258 +#: ../../library/pdb.rst:276 msgid "" ":file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was " "read with the system locale encoding." msgstr "" -#: ../../library/pdb.rst:262 +#: ../../library/pdb.rst:280 msgid "" ":file:`.pdbrc` can now contain commands that continue debugging, such as :" "pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no " "effect." msgstr "" -#: ../../library/pdb.rst:270 +#: ../../library/pdb.rst:288 msgid "" "Without argument, print the list of available commands. With a *command* as " "argument, print help about that command. ``help pdb`` displays the full " @@ -331,25 +339,26 @@ msgid "" "the ``!`` command." msgstr "" -#: ../../library/pdb.rst:278 +#: ../../library/pdb.rst:296 msgid "" "Print a stack trace, with the most recent frame at the bottom. An arrow " -"indicates the current frame, which determines the context of most commands." +"(``>``) indicates the current frame, which determines the context of most " +"commands." msgstr "" -#: ../../library/pdb.rst:283 +#: ../../library/pdb.rst:301 msgid "" "Move the current frame *count* (default one) levels down in the stack trace " "(to a newer frame)." msgstr "" -#: ../../library/pdb.rst:288 +#: ../../library/pdb.rst:306 msgid "" "Move the current frame *count* (default one) levels up in the stack trace " "(to an older frame)." msgstr "" -#: ../../library/pdb.rst:293 +#: ../../library/pdb.rst:311 msgid "" "With a *lineno* argument, set a break there in the current file. With a " "*function* argument, set a break at the first executable statement within " @@ -360,33 +369,33 @@ msgid "" "refer." msgstr "" -#: ../../library/pdb.rst:300 +#: ../../library/pdb.rst:318 msgid "" "If a second argument is present, it is an expression which must evaluate to " "true before the breakpoint is honored." msgstr "" -#: ../../library/pdb.rst:303 +#: ../../library/pdb.rst:321 msgid "" "Without argument, list all breaks, including for each breakpoint, the number " "of times that breakpoint has been hit, the current ignore count, and the " "associated condition if any." msgstr "" -#: ../../library/pdb.rst:309 +#: ../../library/pdb.rst:327 msgid "" "Temporary breakpoint, which is removed automatically when it is first hit. " "The arguments are the same as for :pdbcmd:`break`." msgstr "" -#: ../../library/pdb.rst:314 +#: ../../library/pdb.rst:332 msgid "" "With a *filename:lineno* argument, clear all the breakpoints at this line. " "With a space separated list of breakpoint numbers, clear those breakpoints. " "Without argument, clear all breaks (but first ask confirmation)." msgstr "" -#: ../../library/pdb.rst:320 +#: ../../library/pdb.rst:338 msgid "" "Disable the breakpoints given as a space separated list of breakpoint " "numbers. Disabling a breakpoint means it cannot cause the program to stop " @@ -394,11 +403,11 @@ msgid "" "breakpoints and can be (re-)enabled." msgstr "" -#: ../../library/pdb.rst:327 +#: ../../library/pdb.rst:345 msgid "Enable the breakpoints specified." msgstr "" -#: ../../library/pdb.rst:331 +#: ../../library/pdb.rst:349 msgid "" "Set the ignore count for the given breakpoint number. If *count* is " "omitted, the ignore count is set to 0. A breakpoint becomes active when the " @@ -407,39 +416,39 @@ msgid "" "associated condition evaluates to true." msgstr "" -#: ../../library/pdb.rst:339 +#: ../../library/pdb.rst:357 msgid "" "Set a new *condition* for the breakpoint, an expression which must evaluate " "to true before the breakpoint is honored. If *condition* is absent, any " "existing condition is removed; i.e., the breakpoint is made unconditional." msgstr "" -#: ../../library/pdb.rst:345 +#: ../../library/pdb.rst:363 msgid "" "Specify a list of commands for breakpoint number *bpnumber*. The commands " "themselves appear on the following lines. Type a line containing just " "``end`` to terminate the commands. An example::" msgstr "" -#: ../../library/pdb.rst:354 +#: ../../library/pdb.rst:372 msgid "" "To remove all commands from a breakpoint, type ``commands`` and follow it " "immediately with ``end``; that is, give no commands." msgstr "" -#: ../../library/pdb.rst:357 +#: ../../library/pdb.rst:375 msgid "" "With no *bpnumber* argument, ``commands`` refers to the last breakpoint set." msgstr "" -#: ../../library/pdb.rst:359 +#: ../../library/pdb.rst:377 msgid "" "You can use breakpoint commands to start your program up again. Simply use " "the :pdbcmd:`continue` command, or :pdbcmd:`step`, or any other command that " "resumes execution." msgstr "" -#: ../../library/pdb.rst:363 +#: ../../library/pdb.rst:381 msgid "" "Specifying any command resuming execution (currently :pdbcmd:`continue`, :" "pdbcmd:`step`, :pdbcmd:`next`, :pdbcmd:`return`, :pdbcmd:`jump`, :pdbcmd:" @@ -450,7 +459,7 @@ msgid "" "ambiguities about which list to execute." msgstr "" -#: ../../library/pdb.rst:372 +#: ../../library/pdb.rst:390 msgid "" "If you use the ``silent`` command in the command list, the usual message " "about stopping at a breakpoint is not printed. This may be desirable for " @@ -459,13 +468,13 @@ msgid "" "was reached." msgstr "" -#: ../../library/pdb.rst:379 +#: ../../library/pdb.rst:397 msgid "" "Execute the current line, stop at the first possible occasion (either in a " "function that is called or on the next line in the current function)." msgstr "" -#: ../../library/pdb.rst:384 +#: ../../library/pdb.rst:402 msgid "" "Continue execution until the next line in the current function is reached or " "it returns. (The difference between :pdbcmd:`next` and :pdbcmd:`step` is " @@ -474,46 +483,46 @@ msgid "" "line in the current function.)" msgstr "" -#: ../../library/pdb.rst:392 +#: ../../library/pdb.rst:410 msgid "" "Without argument, continue execution until the line with a number greater " "than the current one is reached." msgstr "" -#: ../../library/pdb.rst:395 +#: ../../library/pdb.rst:413 msgid "" "With *lineno*, continue execution until a line with a number greater or " "equal to *lineno* is reached. In both cases, also stop when the current " "frame returns." msgstr "" -#: ../../library/pdb.rst:399 +#: ../../library/pdb.rst:417 msgid "Allow giving an explicit line number." msgstr "" -#: ../../library/pdb.rst:404 +#: ../../library/pdb.rst:422 msgid "Continue execution until the current function returns." msgstr "" -#: ../../library/pdb.rst:408 +#: ../../library/pdb.rst:426 msgid "Continue execution, only stop when a breakpoint is encountered." msgstr "" -#: ../../library/pdb.rst:412 +#: ../../library/pdb.rst:430 msgid "" "Set the next line that will be executed. Only available in the bottom-most " "frame. This lets you jump back and execute code again, or jump forward to " "skip code that you don't want to run." msgstr "" -#: ../../library/pdb.rst:416 +#: ../../library/pdb.rst:434 msgid "" "It should be noted that not all jumps are allowed -- for instance it is not " "possible to jump into the middle of a :keyword:`for` loop or out of a :" "keyword:`finally` clause." msgstr "" -#: ../../library/pdb.rst:422 +#: ../../library/pdb.rst:440 msgid "" "List source code for the current file. Without arguments, list 11 lines " "around the current line or continue the previous listing. With ``.`` as " @@ -522,7 +531,7 @@ msgid "" "second argument is less than the first, it is interpreted as a count." msgstr "" -#: ../../library/pdb.rst:428 +#: ../../library/pdb.rst:446 msgid "" "The current line in the current frame is indicated by ``->``. If an " "exception is being debugged, the line where the exception was originally " @@ -530,69 +539,90 @@ msgid "" "line." msgstr "" -#: ../../library/pdb.rst:433 +#: ../../library/pdb.rst:451 msgid "The ``>>`` marker." msgstr "" -#: ../../library/pdb.rst:438 +#: ../../library/pdb.rst:456 msgid "" "List all source code for the current function or frame. Interesting lines " "are marked as for :pdbcmd:`list`." msgstr "" -#: ../../library/pdb.rst:445 -msgid "Print the argument list of the current function." +#: ../../library/pdb.rst:463 +msgid "Print the arguments of the current function and their current values." msgstr "" -#: ../../library/pdb.rst:449 +#: ../../library/pdb.rst:467 msgid "Evaluate *expression* in the current context and print its value." msgstr "" -#: ../../library/pdb.rst:453 +#: ../../library/pdb.rst:471 msgid "" "``print()`` can also be used, but is not a debugger command --- this " "executes the Python :func:`print` function." msgstr "" -#: ../../library/pdb.rst:459 +#: ../../library/pdb.rst:477 msgid "" "Like the :pdbcmd:`p` command, except the value of *expression* is pretty-" "printed using the :mod:`pprint` module." msgstr "" -#: ../../library/pdb.rst:464 +#: ../../library/pdb.rst:482 msgid "Print the type of *expression*." msgstr "" -#: ../../library/pdb.rst:468 +#: ../../library/pdb.rst:486 msgid "Try to get source code of *expression* and display it." msgstr "" -#: ../../library/pdb.rst:474 +#: ../../library/pdb.rst:492 msgid "" "Display the value of *expression* if it changed, each time execution stops " "in the current frame." msgstr "" -#: ../../library/pdb.rst:477 +#: ../../library/pdb.rst:495 msgid "" "Without *expression*, list all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:483 +#: ../../library/pdb.rst:499 +msgid "" +"Display evaluates *expression* and compares to the result of the previous " +"evaluation of *expression*, so when the result is mutable, display may not " +"be able to pick up the changes." +msgstr "" + +#: ../../library/pdb.rst:503 +msgid "Example::" +msgstr "" + +#: ../../library/pdb.rst:511 +msgid "" +"Display won't realize ``lst`` has been changed because the result of " +"evaluation is modified in place by ``lst.append(1)`` before being compared::" +msgstr "" + +#: ../../library/pdb.rst:526 +msgid "You can do some tricks with copy mechanism to make it work::" +msgstr "" + +#: ../../library/pdb.rst:545 msgid "" "Do not display *expression* anymore in the current frame. Without " "*expression*, clear all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:490 +#: ../../library/pdb.rst:552 msgid "" "Start an interactive interpreter (using the :mod:`code` module) whose global " "namespace contains all the (global and local) names found in the current " "scope." msgstr "" -#: ../../library/pdb.rst:500 +#: ../../library/pdb.rst:562 msgid "" "Create an alias called *name* that executes *command*. The *command* must " "*not* be enclosed in quotes. Replaceable parameters can be indicated by " @@ -601,7 +631,7 @@ msgid "" "arguments are given, all aliases are listed." msgstr "" -#: ../../library/pdb.rst:506 +#: ../../library/pdb.rst:568 msgid "" "Aliases may be nested and can contain anything that can be legally typed at " "the pdb prompt. Note that internal pdb commands *can* be overridden by " @@ -610,17 +640,17 @@ msgid "" "other words in the line are left alone." msgstr "" -#: ../../library/pdb.rst:512 +#: ../../library/pdb.rst:574 msgid "" "As an example, here are two useful aliases (especially when placed in the :" "file:`.pdbrc` file)::" msgstr "" -#: ../../library/pdb.rst:522 +#: ../../library/pdb.rst:584 msgid "Delete the specified alias *name*." msgstr "" -#: ../../library/pdb.rst:526 +#: ../../library/pdb.rst:588 msgid "" "Execute the (one-line) *statement* in the context of the current stack " "frame. The exclamation point can be omitted unless the first word of the " @@ -629,7 +659,7 @@ msgid "" "line, e.g.::" msgstr "" -#: ../../library/pdb.rst:538 +#: ../../library/pdb.rst:600 msgid "" "Restart the debugged Python program. If *args* is supplied, it is split " "with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " @@ -637,25 +667,25 @@ msgid "" "`restart` is an alias for :pdbcmd:`run`." msgstr "" -#: ../../library/pdb.rst:545 +#: ../../library/pdb.rst:607 msgid "Quit from the debugger. The program being executed is aborted." msgstr "" -#: ../../library/pdb.rst:549 +#: ../../library/pdb.rst:611 msgid "" "Enter a recursive debugger that steps through *code* (which is an arbitrary " "expression or statement to be executed in the current environment)." msgstr "" -#: ../../library/pdb.rst:555 -msgid "Print the return value for the last return of a function." +#: ../../library/pdb.rst:617 +msgid "Print the return value for the last return of the current function." msgstr "" -#: ../../library/pdb.rst:558 +#: ../../library/pdb.rst:620 msgid "Footnotes" msgstr "註解" -#: ../../library/pdb.rst:559 +#: ../../library/pdb.rst:621 msgid "" "Whether a frame is considered to originate in a certain module is determined " "by the ``__name__`` in the frame globals." From c0f916030091cf906e8411749179004afdf9b0a4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 14 Apr 2023 00:16:30 +0000 Subject: [PATCH 06/14] sync with cpython 3b929a7b --- howto/enum.po | 208 ++++++++++++++++++++++++------------------------ library/enum.po | 92 ++++++++++----------- 2 files changed, 153 insertions(+), 147 deletions(-) diff --git a/howto/enum.po b/howto/enum.po index 712c8e0051..010eaaab5d 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-06 06:20+0000\n" +"POT-Creation-Date: 2023-04-14 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -710,149 +710,153 @@ msgid "" msgstr "" #: ../../howto/enum.rst:840 +msgid "A ``data type`` is a mixin that defines :meth:`__new__`." +msgstr "" + +#: ../../howto/enum.rst:841 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:843 +#: ../../howto/enum.rst:844 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:848 +#: ../../howto/enum.rst:849 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" -"`__str__` method has been reset to their data types :meth:`__str__` method." +"`__str__` method has been reset to their data types' :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:854 +#: ../../howto/enum.rst:855 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:856 +#: ../../howto/enum.rst:857 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:860 +#: ../../howto/enum.rst:861 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:887 +#: ../../howto/enum.rst:888 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:890 +#: ../../howto/enum.rst:891 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:892 +#: ../../howto/enum.rst:893 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:895 +#: ../../howto/enum.rst:896 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:901 +#: ../../howto/enum.rst:902 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:903 +#: ../../howto/enum.rst:904 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:904 +#: ../../howto/enum.rst:905 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:906 +#: ../../howto/enum.rst:907 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:908 +#: ../../howto/enum.rst:909 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:911 +#: ../../howto/enum.rst:912 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:913 +#: ../../howto/enum.rst:914 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:919 +#: ../../howto/enum.rst:920 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:922 +#: ../../howto/enum.rst:923 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:925 +#: ../../howto/enum.rst:926 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:926 +#: ../../howto/enum.rst:927 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:928 +#: ../../howto/enum.rst:929 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:946 +#: ../../howto/enum.rst:947 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:951 +#: ../../howto/enum.rst:952 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:953 +#: ../../howto/enum.rst:954 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:960 +#: ../../howto/enum.rst:961 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:962 +#: ../../howto/enum.rst:963 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -860,22 +864,22 @@ msgid "" "and is supported." msgstr "" -#: ../../howto/enum.rst:971 +#: ../../howto/enum.rst:972 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:973 +#: ../../howto/enum.rst:974 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:985 +#: ../../howto/enum.rst:986 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:987 +#: ../../howto/enum.rst:988 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -884,137 +888,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:996 +#: ../../howto/enum.rst:997 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1000 +#: ../../howto/enum.rst:1001 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1002 +#: ../../howto/enum.rst:1003 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1013 +#: ../../howto/enum.rst:1014 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1015 +#: ../../howto/enum.rst:1016 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1033 +#: ../../howto/enum.rst:1034 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1035 +#: ../../howto/enum.rst:1036 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1046 +#: ../../howto/enum.rst:1047 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1048 +#: ../../howto/enum.rst:1049 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1049 +#: ../../howto/enum.rst:1050 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1050 +#: ../../howto/enum.rst:1051 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1055 +#: ../../howto/enum.rst:1056 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1064 +#: ../../howto/enum.rst:1065 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1069 +#: ../../howto/enum.rst:1070 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1080 +#: ../../howto/enum.rst:1081 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1086 +#: ../../howto/enum.rst:1087 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1095 +#: ../../howto/enum.rst:1096 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1098 +#: ../../howto/enum.rst:1099 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1099 +#: ../../howto/enum.rst:1100 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1100 +#: ../../howto/enum.rst:1101 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1104 +#: ../../howto/enum.rst:1105 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1102 +#: ../../howto/enum.rst:1103 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1103 +#: ../../howto/enum.rst:1104 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1104 +#: ../../howto/enum.rst:1105 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1106 +#: ../../howto/enum.rst:1107 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1114 +#: ../../howto/enum.rst:1115 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1117 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1121 +#: ../../howto/enum.rst:1122 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1123 +#: ../../howto/enum.rst:1124 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1025,11 +1029,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1132 +#: ../../howto/enum.rst:1133 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1134 +#: ../../howto/enum.rst:1135 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1038,11 +1042,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1140 +#: ../../howto/enum.rst:1141 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1142 +#: ../../howto/enum.rst:1143 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1051,37 +1055,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1148 +#: ../../howto/enum.rst:1149 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1150 +#: ../../howto/enum.rst:1151 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1156 +#: ../../howto/enum.rst:1157 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1158 +#: ../../howto/enum.rst:1159 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1164 +#: ../../howto/enum.rst:1165 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1174 +#: ../../howto/enum.rst:1175 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1177 +#: ../../howto/enum.rst:1178 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1089,149 +1093,149 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1184 +#: ../../howto/enum.rst:1185 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1186 +#: ../../howto/enum.rst:1187 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1189 +#: ../../howto/enum.rst:1190 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1190 +#: ../../howto/enum.rst:1191 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1191 +#: ../../howto/enum.rst:1192 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1192 +#: ../../howto/enum.rst:1193 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1195 +#: ../../howto/enum.rst:1196 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1201 +#: ../../howto/enum.rst:1202 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1203 +#: ../../howto/enum.rst:1204 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1215 +#: ../../howto/enum.rst:1216 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1217 +#: ../../howto/enum.rst:1218 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1227 +#: ../../howto/enum.rst:1228 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1243 +#: ../../howto/enum.rst:1244 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1245 +#: ../../howto/enum.rst:1246 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1257 +#: ../../howto/enum.rst:1258 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1259 +#: ../../howto/enum.rst:1260 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1276 +#: ../../howto/enum.rst:1277 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1286 +#: ../../howto/enum.rst:1287 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1305 +#: ../../howto/enum.rst:1306 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1311 +#: ../../howto/enum.rst:1312 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1313 +#: ../../howto/enum.rst:1314 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1347 +#: ../../howto/enum.rst:1348 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1349 +#: ../../howto/enum.rst:1350 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1374 +#: ../../howto/enum.rst:1375 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1380 +#: ../../howto/enum.rst:1381 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1382 +#: ../../howto/enum.rst:1383 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1411 +#: ../../howto/enum.rst:1412 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1413 +#: ../../howto/enum.rst:1414 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1432 +#: ../../howto/enum.rst:1433 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1434 +#: ../../howto/enum.rst:1435 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/library/enum.po b/library/enum.po index 1aea8f69d6..7fb5077f9b 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-04 00:15+0000\n" +"POT-Creation-Date: 2023-04-14 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -748,106 +748,108 @@ msgid "" msgstr "" #: ../../library/enum.rst:695 -msgid "Out-of-range values cause a :exc:`ValueError` to be raised::" +msgid "" +"Out-of-range values cause a :exc:`ValueError` to be raised. This is the " +"default for :class:`Flag`::" msgstr "" -#: ../../library/enum.rst:711 +#: ../../library/enum.rst:712 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " -"value. This is the default for :class:`Flag`::" +"value::" msgstr "" -#: ../../library/enum.rst:724 +#: ../../library/enum.rst:725 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "" -#: ../../library/enum.rst:736 +#: ../../library/enum.rst:737 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:752 +#: ../../library/enum.rst:753 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:754 +#: ../../library/enum.rst:755 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:757 +#: ../../library/enum.rst:758 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:763 +#: ../../library/enum.rst:764 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:765 +#: ../../library/enum.rst:766 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:766 +#: ../../library/enum.rst:767 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:768 +#: ../../library/enum.rst:769 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:770 +#: ../../library/enum.rst:771 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:773 +#: ../../library/enum.rst:774 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:775 +#: ../../library/enum.rst:776 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "" -#: ../../library/enum.rst:780 +#: ../../library/enum.rst:781 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../library/enum.rst:783 +#: ../../library/enum.rst:784 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../library/enum.rst:786 +#: ../../library/enum.rst:787 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:787 +#: ../../library/enum.rst:788 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:792 +#: ../../library/enum.rst:793 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:796 +#: ../../library/enum.rst:797 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -858,58 +860,58 @@ msgid "" "manually specified values." msgstr "" -#: ../../library/enum.rst:804 +#: ../../library/enum.rst:805 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:807 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:807 +#: ../../library/enum.rst:808 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:809 msgid "used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:809 +#: ../../library/enum.rst:810 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:814 +#: ../../library/enum.rst:815 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: ../../library/enum.rst:817 +#: ../../library/enum.rst:818 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:820 +#: ../../library/enum.rst:821 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:826 +#: ../../library/enum.rst:827 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:830 +#: ../../library/enum.rst:831 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -917,29 +919,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:839 +#: ../../library/enum.rst:840 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:857 +#: ../../library/enum.rst:858 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:865 +#: ../../library/enum.rst:866 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:871 +#: ../../library/enum.rst:872 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:877 +#: ../../library/enum.rst:878 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -947,41 +949,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:887 +#: ../../library/enum.rst:888 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:894 +#: ../../library/enum.rst:895 msgid "Notes" msgstr "" -#: ../../library/enum.rst:896 +#: ../../library/enum.rst:897 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:898 +#: ../../library/enum.rst:899 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:901 +#: ../../library/enum.rst:902 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:903 +#: ../../library/enum.rst:904 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:906 +#: ../../library/enum.rst:907 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:913 +#: ../../library/enum.rst:914 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" From 5c22ad87f50d0378d8b5bb2a4439a229f6bb4dee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 17 Apr 2023 00:17:49 +0000 Subject: [PATCH 07/14] sync with cpython 4c4ef50e --- using/cmdline.po | 246 ++++++++++++++++++++++++----------------------- 1 file changed, 125 insertions(+), 121 deletions(-) diff --git a/using/cmdline.po b/using/cmdline.po index ead840c5a7..7b9a97d13a 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-17 00:16+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-" @@ -495,8 +495,8 @@ msgid "" "`sys.path`." msgstr "" -#: ../../using/cmdline.rst:388 ../../using/cmdline.rst:790 -#: ../../using/cmdline.rst:802 +#: ../../using/cmdline.rst:388 ../../using/cmdline.rst:793 +#: ../../using/cmdline.rst:805 msgid ":pep:`370` -- Per user site-packages directory" msgstr "" @@ -546,7 +546,7 @@ msgid "" "messages to :data:`sys.stderr`." msgstr "" -#: ../../using/cmdline.rst:430 ../../using/cmdline.rst:818 +#: ../../using/cmdline.rst:430 ../../using/cmdline.rst:821 msgid "" "The simplest settings apply a particular action unconditionally to all " "warnings emitted by a process (even those that are otherwise ignored by " @@ -619,7 +619,7 @@ msgid "" "can be used to use a regular expression on the warning message." msgstr "" -#: ../../using/cmdline.rst:480 ../../using/cmdline.rst:829 +#: ../../using/cmdline.rst:480 ../../using/cmdline.rst:832 msgid "" "See :ref:`warning-filter` and :ref:`describing-warning-filters` for more " "details." @@ -638,10 +638,12 @@ msgid "" msgstr "" #: ../../using/cmdline.rst:495 -msgid "``-X faulthandler`` to enable :mod:`faulthandler`;" +msgid "" +"``-X faulthandler`` to enable :mod:`faulthandler`. See also :envvar:" +"`PYTHONFAULTHANDLER`." msgstr "" -#: ../../using/cmdline.rst:496 +#: ../../using/cmdline.rst:497 msgid "" "``-X showrefcount`` to output the total reference count and number of used " "memory blocks when the program finishes or after each statement in the " @@ -649,23 +651,23 @@ msgid "" "build>`." msgstr "" -#: ../../using/cmdline.rst:500 +#: ../../using/cmdline.rst:501 msgid "" "``-X tracemalloc`` to start tracing Python memory allocations using the :mod:" "`tracemalloc` module. By default, only the most recent frame is stored in a " "traceback of a trace. Use ``-X tracemalloc=NFRAME`` to start tracing with a " -"traceback limit of *NFRAME* frames. See the :func:`tracemalloc.start` for " -"more information." +"traceback limit of *NFRAME* frames. See :func:`tracemalloc.start` and :" +"envvar:`PYTHONTRACEMALLOC` for more information." msgstr "" -#: ../../using/cmdline.rst:505 +#: ../../using/cmdline.rst:507 msgid "" "``-X int_max_str_digits`` configures the :ref:`integer string conversion " "length limitation `. See also :envvar:" "`PYTHONINTMAXSTRDIGITS`." msgstr "" -#: ../../using/cmdline.rst:508 +#: ../../using/cmdline.rst:510 msgid "" "``-X importtime`` to show how long each import takes. It shows module name, " "cumulative time (including nested imports) and self time (excluding nested " @@ -674,34 +676,34 @@ msgid "" "asyncio'``. See also :envvar:`PYTHONPROFILEIMPORTTIME`." msgstr "" -#: ../../using/cmdline.rst:513 +#: ../../using/cmdline.rst:515 msgid "" "``-X dev``: enable :ref:`Python Development Mode `, introducing " "additional runtime checks that are too expensive to be enabled by default." msgstr "" -#: ../../using/cmdline.rst:516 +#: ../../using/cmdline.rst:518 msgid "" "``-X utf8`` enables the :ref:`Python UTF-8 Mode `. ``-X utf8=0`` " "explicitly disables :ref:`Python UTF-8 Mode ` (even when it would " -"otherwise activate automatically)." +"otherwise activate automatically). See also :envvar:`PYTHONUTF8`." msgstr "" -#: ../../using/cmdline.rst:519 +#: ../../using/cmdline.rst:522 msgid "" "``-X pycache_prefix=PATH`` enables writing ``.pyc`` files to a parallel tree " "rooted at the given directory instead of to the code tree. See also :envvar:" "`PYTHONPYCACHEPREFIX`." msgstr "" -#: ../../using/cmdline.rst:522 +#: ../../using/cmdline.rst:525 msgid "" "``-X warn_default_encoding`` issues a :class:`EncodingWarning` when the " "locale-specific default encoding is used for opening files. See also :envvar:" "`PYTHONWARNDEFAULTENCODING`." msgstr "" -#: ../../using/cmdline.rst:525 +#: ../../using/cmdline.rst:528 msgid "" "``-X no_debug_ranges`` disables the inclusion of the tables mapping extra " "location information (end line, start column offset and end column offset) " @@ -711,7 +713,7 @@ msgid "" "envvar:`PYTHONNODEBUGRANGES`." msgstr "" -#: ../../using/cmdline.rst:531 +#: ../../using/cmdline.rst:534 msgid "" "``-X frozen_modules`` determines whether or not frozen modules are ignored " "by the import machinery. A value of \"on\" means they get imported and " @@ -722,81 +724,81 @@ msgid "" "are always used, even if this flag is set to \"off\"." msgstr "" -#: ../../using/cmdline.rst:539 +#: ../../using/cmdline.rst:542 msgid "" "It also allows passing arbitrary values and retrieving them through the :" "data:`sys._xoptions` dictionary." msgstr "" -#: ../../using/cmdline.rst:542 +#: ../../using/cmdline.rst:545 msgid "The :option:`-X` option was added." msgstr "新增 :option:`-X` 選項。" -#: ../../using/cmdline.rst:545 +#: ../../using/cmdline.rst:548 msgid "The ``-X faulthandler`` option." msgstr "``-X faulthandler`` 選項。" -#: ../../using/cmdline.rst:548 +#: ../../using/cmdline.rst:551 msgid "The ``-X showrefcount`` and ``-X tracemalloc`` options." msgstr "``-X showrefcount`` 和 ``-X tracemalloc`` 選項。" -#: ../../using/cmdline.rst:551 +#: ../../using/cmdline.rst:554 msgid "The ``-X showalloccount`` option." msgstr "``-X showalloccount`` 選項。" -#: ../../using/cmdline.rst:554 +#: ../../using/cmdline.rst:557 msgid "The ``-X importtime``, ``-X dev`` and ``-X utf8`` options." msgstr "``-X importtime``、``-X dev`` 和 ``-X utf8`` 選項。" -#: ../../using/cmdline.rst:557 +#: ../../using/cmdline.rst:560 msgid "" "The ``-X pycache_prefix`` option. The ``-X dev`` option now logs ``close()`` " "exceptions in :class:`io.IOBase` destructor." msgstr "" -#: ../../using/cmdline.rst:561 +#: ../../using/cmdline.rst:564 msgid "" "Using ``-X dev`` option, check *encoding* and *errors* arguments on string " "encoding and decoding operations." msgstr "" -#: ../../using/cmdline.rst:565 +#: ../../using/cmdline.rst:568 msgid "The ``-X showalloccount`` option has been removed." msgstr "``-X showalloccount`` 選項已被移除。" -#: ../../using/cmdline.rst:567 +#: ../../using/cmdline.rst:570 msgid "The ``-X warn_default_encoding`` option." msgstr "``-X warn_default_encoding`` 選項。" -#: ../../using/cmdline.rst:572 +#: ../../using/cmdline.rst:575 msgid "The ``-X oldparser`` option." msgstr "``-X oldparser`` 選項。" -#: ../../using/cmdline.rst:573 +#: ../../using/cmdline.rst:576 msgid "The ``-X no_debug_ranges`` option." msgstr "``-X no_debug_ranges`` 選項。" -#: ../../using/cmdline.rst:576 +#: ../../using/cmdline.rst:579 msgid "The ``-X frozen_modules`` option." msgstr "``-X frozen_modules`` 選項。" -#: ../../using/cmdline.rst:579 +#: ../../using/cmdline.rst:582 msgid "The ``-X int_max_str_digits`` option." msgstr "``-X int_max_str_digits`` 選項。" -#: ../../using/cmdline.rst:584 +#: ../../using/cmdline.rst:587 msgid "Options you shouldn't use" msgstr "你不該使用的選項" -#: ../../using/cmdline.rst:588 +#: ../../using/cmdline.rst:591 msgid "Reserved for use by Jython_." msgstr "" -#: ../../using/cmdline.rst:596 +#: ../../using/cmdline.rst:599 msgid "Environment variables" msgstr "環境變數" -#: ../../using/cmdline.rst:598 +#: ../../using/cmdline.rst:601 msgid "" "These environment variables influence Python's behavior, they are processed " "before the command-line switches other than -E or -I. It is customary that " @@ -804,7 +806,7 @@ msgid "" "conflict." msgstr "" -#: ../../using/cmdline.rst:605 +#: ../../using/cmdline.rst:608 msgid "" "Change the location of the standard Python libraries. By default, the " "libraries are searched in :file:`{prefix}/lib/python{version}` and :file:" @@ -813,14 +815,14 @@ msgid "" "file:`/usr/local`." msgstr "" -#: ../../using/cmdline.rst:611 +#: ../../using/cmdline.rst:614 msgid "" "When :envvar:`PYTHONHOME` is set to a single directory, its value replaces " "both :file:`{prefix}` and :file:`{exec_prefix}`. To specify different " "values for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`." msgstr "" -#: ../../using/cmdline.rst:618 +#: ../../using/cmdline.rst:621 msgid "" "Augment the default search path for module files. The format is the same as " "the shell's :envvar:`PATH`: one or more directory pathnames separated by :" @@ -828,21 +830,21 @@ msgid "" "existent directories are silently ignored." msgstr "" -#: ../../using/cmdline.rst:623 +#: ../../using/cmdline.rst:626 msgid "" "In addition to normal directories, individual :envvar:`PYTHONPATH` entries " "may refer to zipfiles containing pure Python modules (in either source or " "compiled form). Extension modules cannot be imported from zipfiles." msgstr "" -#: ../../using/cmdline.rst:627 +#: ../../using/cmdline.rst:630 msgid "" "The default search path is installation dependent, but generally begins " "with :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). " "It is *always* appended to :envvar:`PYTHONPATH`." msgstr "" -#: ../../using/cmdline.rst:631 +#: ../../using/cmdline.rst:634 msgid "" "An additional directory will be inserted in the search path in front of :" "envvar:`PYTHONPATH` as described above under :ref:`using-on-interface-" @@ -850,19 +852,19 @@ msgid "" "the variable :data:`sys.path`." msgstr "" -#: ../../using/cmdline.rst:639 +#: ../../using/cmdline.rst:642 msgid "" "If this is set to a non-empty string, don't prepend a potentially unsafe " "path to :data:`sys.path`: see the :option:`-P` option for details." msgstr "" -#: ../../using/cmdline.rst:647 +#: ../../using/cmdline.rst:650 msgid "" "If this is set to a non-empty string, it overrides the :data:`sys." "platlibdir` value." msgstr "" -#: ../../using/cmdline.rst:655 +#: ../../using/cmdline.rst:658 msgid "" "If this is the name of a readable file, the Python commands in that file are " "executed before the first prompt is displayed in interactive mode. The file " @@ -879,20 +881,20 @@ msgid "" "argument ``filename``." msgstr "" -#: ../../using/cmdline.rst:664 +#: ../../using/cmdline.rst:667 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_startup`` with the " "filename as the argument when called on startup." msgstr "" -#: ../../using/cmdline.rst:670 +#: ../../using/cmdline.rst:673 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-O` option. If set to an integer, it is equivalent to specifying :" "option:`-O` multiple times." msgstr "" -#: ../../using/cmdline.rst:677 +#: ../../using/cmdline.rst:680 msgid "" "If this is set, it names a callable using dotted-path notation. The module " "containing the callable will be imported and then the callable will be run " @@ -903,52 +905,52 @@ msgid "" "breakpointhook` to do nothing but return immediately." msgstr "" -#: ../../using/cmdline.rst:689 +#: ../../using/cmdline.rst:692 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-d` option. If set to an integer, it is equivalent to specifying :" "option:`-d` multiple times." msgstr "" -#: ../../using/cmdline.rst:696 +#: ../../using/cmdline.rst:699 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-i` option." msgstr "" -#: ../../using/cmdline.rst:699 +#: ../../using/cmdline.rst:702 msgid "" "This variable can also be modified by Python code using :data:`os.environ` " "to force inspect mode on program termination." msgstr "" -#: ../../using/cmdline.rst:705 +#: ../../using/cmdline.rst:708 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-u` option." msgstr "" -#: ../../using/cmdline.rst:711 +#: ../../using/cmdline.rst:714 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-v` option. If set to an integer, it is equivalent to specifying :" "option:`-v` multiple times." msgstr "" -#: ../../using/cmdline.rst:718 +#: ../../using/cmdline.rst:721 msgid "" "If this is set, Python ignores case in :keyword:`import` statements. This " "only works on Windows and macOS." msgstr "" -#: ../../using/cmdline.rst:724 +#: ../../using/cmdline.rst:727 msgid "" "If this is set to a non-empty string, Python won't try to write ``.pyc`` " "files on the import of source modules. This is equivalent to specifying " "the :option:`-B` option." msgstr "" -#: ../../using/cmdline.rst:731 +#: ../../using/cmdline.rst:734 msgid "" "If this is set, Python will write ``.pyc`` files in a mirror directory tree " "at this path, instead of in ``__pycache__`` directories within the source " @@ -956,40 +958,40 @@ msgid "" "``pycache_prefix=PATH`` option." msgstr "" -#: ../../using/cmdline.rst:741 +#: ../../using/cmdline.rst:744 msgid "" "If this variable is not set or set to ``random``, a random value is used to " "seed the hashes of str and bytes objects." msgstr "" -#: ../../using/cmdline.rst:744 +#: ../../using/cmdline.rst:747 msgid "" "If :envvar:`PYTHONHASHSEED` is set to an integer value, it is used as a " "fixed seed for generating the hash() of the types covered by the hash " "randomization." msgstr "" -#: ../../using/cmdline.rst:748 +#: ../../using/cmdline.rst:751 msgid "" "Its purpose is to allow repeatable hashing, such as for selftests for the " "interpreter itself, or to allow a cluster of python processes to share hash " "values." msgstr "" -#: ../../using/cmdline.rst:752 +#: ../../using/cmdline.rst:755 msgid "" "The integer must be a decimal number in the range [0,4294967295]. " "Specifying the value 0 will disable hash randomization." msgstr "" -#: ../../using/cmdline.rst:759 +#: ../../using/cmdline.rst:762 msgid "" "If this variable is set to an integer, it is used to configure the " "interpreter's global :ref:`integer string conversion length limitation " "`." msgstr "" -#: ../../using/cmdline.rst:767 +#: ../../using/cmdline.rst:770 msgid "" "If this is set before running the interpreter, it overrides the encoding " "used for stdin/stdout/stderr, in the syntax ``encodingname:errorhandler``. " @@ -997,17 +999,17 @@ msgid "" "have the same meaning as in :func:`str.encode`." msgstr "" -#: ../../using/cmdline.rst:772 +#: ../../using/cmdline.rst:775 msgid "" "For stderr, the ``:errorhandler`` part is ignored; the handler will always " "be ``'backslashreplace'``." msgstr "" -#: ../../using/cmdline.rst:775 +#: ../../using/cmdline.rst:778 msgid "The ``encodingname`` part is now optional." msgstr "" -#: ../../using/cmdline.rst:778 +#: ../../using/cmdline.rst:781 msgid "" "On Windows, the encoding specified by this variable is ignored for " "interactive console buffers unless :envvar:`PYTHONLEGACYWINDOWSSTDIO` is " @@ -1015,13 +1017,13 @@ msgid "" "not affected." msgstr "" -#: ../../using/cmdline.rst:785 +#: ../../using/cmdline.rst:788 msgid "" "If this is set, Python won't add the :data:`user site-packages directory " "` to :data:`sys.path`." msgstr "" -#: ../../using/cmdline.rst:795 +#: ../../using/cmdline.rst:798 msgid "" "Defines the :data:`user base directory `, which is used to " "compute the path of the :data:`user site-packages directory ` of the :mod:`asyncio` module." msgstr "" -#: ../../using/cmdline.rst:874 +#: ../../using/cmdline.rst:879 msgid "Set the Python memory allocators and/or install debug hooks." msgstr "" -#: ../../using/cmdline.rst:876 +#: ../../using/cmdline.rst:881 msgid "Set the family of memory allocators used by Python:" msgstr "" -#: ../../using/cmdline.rst:878 +#: ../../using/cmdline.rst:883 msgid "" "``default``: use the :ref:`default memory allocators `." msgstr "" -#: ../../using/cmdline.rst:880 +#: ../../using/cmdline.rst:885 msgid "" "``malloc``: use the :c:func:`malloc` function of the C library for all " "domains (:c:data:`PYMEM_DOMAIN_RAW`, :c:data:`PYMEM_DOMAIN_MEM`, :c:data:" "`PYMEM_DOMAIN_OBJ`)." msgstr "" -#: ../../using/cmdline.rst:883 +#: ../../using/cmdline.rst:888 msgid "" "``pymalloc``: use the :ref:`pymalloc allocator ` for :c:data:" "`PYMEM_DOMAIN_MEM` and :c:data:`PYMEM_DOMAIN_OBJ` domains and use the :c:" "func:`malloc` function for the :c:data:`PYMEM_DOMAIN_RAW` domain." msgstr "" -#: ../../using/cmdline.rst:887 +#: ../../using/cmdline.rst:892 msgid "Install :ref:`debug hooks `:" msgstr "" -#: ../../using/cmdline.rst:889 +#: ../../using/cmdline.rst:894 msgid "" "``debug``: install debug hooks on top of the :ref:`default memory allocators " "`." msgstr "" -#: ../../using/cmdline.rst:891 +#: ../../using/cmdline.rst:896 msgid "``malloc_debug``: same as ``malloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:892 +#: ../../using/cmdline.rst:897 msgid "``pymalloc_debug``: same as ``pymalloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:894 +#: ../../using/cmdline.rst:899 msgid "Added the ``\"default\"`` allocator." msgstr "" -#: ../../using/cmdline.rst:902 +#: ../../using/cmdline.rst:907 msgid "" "If set to a non-empty string, Python will print statistics of the :ref:" "`pymalloc memory allocator ` every time a new pymalloc object " "arena is created, and on shutdown." msgstr "" -#: ../../using/cmdline.rst:906 +#: ../../using/cmdline.rst:911 msgid "" "This variable is ignored if the :envvar:`PYTHONMALLOC` environment variable " "is used to force the :c:func:`malloc` allocator of the C library, or if " "Python is configured without ``pymalloc`` support." msgstr "" -#: ../../using/cmdline.rst:910 +#: ../../using/cmdline.rst:915 msgid "" "This variable can now also be used on Python compiled in release mode. It " "now has no effect if set to an empty string." msgstr "" -#: ../../using/cmdline.rst:917 +#: ../../using/cmdline.rst:922 msgid "" "If set to a non-empty string, the default :term:`filesystem encoding and " "error handler` mode will revert to their pre-3.6 values of 'mbcs' and " @@ -1151,41 +1154,41 @@ msgid "" "'surrogatepass' are used." msgstr "" -#: ../../using/cmdline.rst:922 +#: ../../using/cmdline.rst:927 msgid "" "This may also be enabled at runtime with :func:`sys." "_enablelegacywindowsfsencoding()`." msgstr "" -#: ../../using/cmdline.rst:925 ../../using/cmdline.rst:939 +#: ../../using/cmdline.rst:930 ../../using/cmdline.rst:944 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../using/cmdline.rst:927 +#: ../../using/cmdline.rst:932 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../using/cmdline.rst:932 +#: ../../using/cmdline.rst:937 msgid "" "If set to a non-empty string, does not use the new console reader and " "writer. This means that Unicode characters will be encoded according to the " "active console code page, rather than using utf-8." msgstr "" -#: ../../using/cmdline.rst:936 +#: ../../using/cmdline.rst:941 msgid "" "This variable is ignored if the standard streams are redirected (to files or " "pipes) rather than referring to console buffers." msgstr "" -#: ../../using/cmdline.rst:946 +#: ../../using/cmdline.rst:951 msgid "" "If set to the value ``0``, causes the main Python command line application " "to skip coercing the legacy ASCII-based C and POSIX locales to a more " "capable UTF-8 based alternative." msgstr "" -#: ../../using/cmdline.rst:950 +#: ../../using/cmdline.rst:955 msgid "" "If this variable is *not* set (or is set to a value other than ``0``), the " "``LC_ALL`` locale override environment variable is also not set, and the " @@ -1196,19 +1199,19 @@ msgid "" "runtime:" msgstr "" -#: ../../using/cmdline.rst:958 +#: ../../using/cmdline.rst:963 msgid "``C.UTF-8``" msgstr "``C.UTF-8``" -#: ../../using/cmdline.rst:959 +#: ../../using/cmdline.rst:964 msgid "``C.utf8``" msgstr "``C.utf8``" -#: ../../using/cmdline.rst:960 +#: ../../using/cmdline.rst:965 msgid "``UTF-8``" msgstr "``UTF-8``" -#: ../../using/cmdline.rst:962 +#: ../../using/cmdline.rst:967 msgid "" "If setting one of these locale categories succeeds, then the ``LC_CTYPE`` " "environment variable will also be set accordingly in the current process " @@ -1221,7 +1224,7 @@ msgid "" "(such as Python's own :func:`locale.getdefaultlocale`)." msgstr "" -#: ../../using/cmdline.rst:972 +#: ../../using/cmdline.rst:977 msgid "" "Configuring one of these locales (either explicitly or via the above " "implicit locale coercion) automatically enables the ``surrogateescape`` :ref:" @@ -1231,7 +1234,7 @@ msgid "" "envvar:`PYTHONIOENCODING` as usual." msgstr "" -#: ../../using/cmdline.rst:979 +#: ../../using/cmdline.rst:984 msgid "" "For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause " "Python to emit warning messages on ``stderr`` if either the locale coercion " @@ -1239,7 +1242,7 @@ msgid "" "active when the Python runtime is initialized." msgstr "" -#: ../../using/cmdline.rst:984 +#: ../../using/cmdline.rst:989 msgid "" "Also note that even when locale coercion is disabled, or when it fails to " "find a suitable target locale, :envvar:`PYTHONUTF8` will still activate by " @@ -1248,46 +1251,47 @@ msgid "" "system interfaces." msgstr "" -#: ../../using/cmdline.rst:990 +#: ../../using/cmdline.rst:995 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../using/cmdline.rst:992 +#: ../../using/cmdline.rst:997 msgid "See :pep:`538` for more details." msgstr "更多細節請見 :pep:`538`\\ 。" -#: ../../using/cmdline.rst:998 +#: ../../using/cmdline.rst:1003 msgid "" "If this environment variable is set to a non-empty string, enable :ref:" "`Python Development Mode `, introducing additional runtime checks " -"that are too expensive to be enabled by default." +"that are too expensive to be enabled by default. This is equivalent to " +"setting the :option:`-X` ``dev`` option." msgstr "" -#: ../../using/cmdline.rst:1006 +#: ../../using/cmdline.rst:1012 msgid "If set to ``1``, enable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``1``,則啟用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1008 +#: ../../using/cmdline.rst:1014 msgid "If set to ``0``, disable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``0``,則停用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1010 +#: ../../using/cmdline.rst:1016 msgid "" "Setting any other non-empty string causes an error during interpreter " "initialisation." msgstr "" -#: ../../using/cmdline.rst:1017 +#: ../../using/cmdline.rst:1023 msgid "" "If this environment variable is set to a non-empty string, issue a :class:" "`EncodingWarning` when the locale-specific default encoding is used." msgstr "" -#: ../../using/cmdline.rst:1020 +#: ../../using/cmdline.rst:1026 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節請見 :ref:`io-encoding-warning`\\ 。" -#: ../../using/cmdline.rst:1026 +#: ../../using/cmdline.rst:1032 msgid "" "If this variable is set, it disables the inclusion of the tables mapping " "extra location information (end line, start column offset and end column " @@ -1296,30 +1300,30 @@ msgid "" "visual location indicators when the interpreter displays tracebacks." msgstr "" -#: ../../using/cmdline.rst:1037 +#: ../../using/cmdline.rst:1043 msgid "Debug-mode variables" msgstr "除錯模式變數" -#: ../../using/cmdline.rst:1041 +#: ../../using/cmdline.rst:1047 msgid "If set, Python will print threading debug info into stdout." msgstr "" -#: ../../using/cmdline.rst:1043 +#: ../../using/cmdline.rst:1049 msgid "Need a :ref:`debug build of Python `." msgstr "" -#: ../../using/cmdline.rst:1050 +#: ../../using/cmdline.rst:1056 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter." msgstr "" -#: ../../using/cmdline.rst:1053 ../../using/cmdline.rst:1060 +#: ../../using/cmdline.rst:1059 ../../using/cmdline.rst:1066 msgid "" "Need Python configured with the :option:`--with-trace-refs` build option." msgstr "" -#: ../../using/cmdline.rst:1057 +#: ../../using/cmdline.rst:1063 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter into a file called *FILENAME*." From 7e6d84bcd117f36ffa701c13d274c255a3e08083 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 20 Apr 2023 00:17:23 +0000 Subject: [PATCH 08/14] sync with cpython 2b5dbd1f --- library/argparse.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/argparse.po b/library/argparse.po index 0db75ef049..d5650e791d 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-26 13:06+0000\n" +"POT-Creation-Date: 2023-04-20 00:15+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-" @@ -172,7 +172,7 @@ msgid "Number of times the argument can be used" msgstr "" #: ../../library/argparse.rst:70 -msgid ":class:`int`, ``'?'``, ``'*'``, ``'+'``, or ``argparse.REMAINDER``" +msgid ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" msgstr "" #: ../../library/argparse.rst:71 @@ -1904,9 +1904,9 @@ msgstr "" #: ../../library/argparse.rst:2187 msgid "" "These parsers do not support all the argparse features, and will raise " -"exceptions if unsupported features are used. In particular, subparsers, " -"``argparse.REMAINDER``, and mutually exclusive groups that include both " -"optionals and positionals are not supported." +"exceptions if unsupported features are used. In particular, subparsers, and " +"mutually exclusive groups that include both optionals and positionals are " +"not supported." msgstr "" #: ../../library/argparse.rst:2192 From 120b9589ed2ed27e0e1411fdd60965335193ad8e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 23 Apr 2023 00:19:20 +0000 Subject: [PATCH 09/14] sync with cpython 050b6b34 --- library/functools.po | 178 +++---- library/multiprocessing.po | 964 ++++++++++++++++++------------------- 2 files changed, 575 insertions(+), 567 deletions(-) diff --git a/library/functools.po b/library/functools.po index bb84784ca5..c64faed883 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-04-23 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,20 +53,28 @@ msgid "" "`lru_cache()` with a size limit." msgstr "" -#: ../../library/functools.rst:39 ../../library/functools.rst:273 +#: ../../library/functools.rst:39 ../../library/functools.rst:283 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/functools.rst:52 ../../library/functools.rst:146 +#: ../../library/functools.rst:52 ../../library/functools.rst:151 msgid "" -"The cache is threadsafe so the wrapped function can be used in multiple " -"threads." +"The cache is threadsafe so that the wrapped function can be used in multiple " +"threads. This means that the underlying data structure will remain coherent " +"during concurrent updates." msgstr "" -#: ../../library/functools.rst:60 +#: ../../library/functools.rst:56 ../../library/functools.rst:155 +msgid "" +"It is possible for the wrapped function to be called more than once if " +"another thread makes an additional call before the initial call has been " +"completed and cached." +msgstr "" + +#: ../../library/functools.rst:65 msgid "" "Transform a method of a class into a property whose value is computed once " "and then cached as a normal attribute for the life of the instance. Similar " @@ -74,22 +82,22 @@ msgid "" "computed properties of instances that are otherwise effectively immutable." msgstr "" -#: ../../library/functools.rst:65 ../../library/functools.rst:130 -#: ../../library/functools.rst:365 +#: ../../library/functools.rst:70 ../../library/functools.rst:135 +#: ../../library/functools.rst:375 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/functools.rst:76 +#: ../../library/functools.rst:81 msgid "" "The mechanics of :func:`cached_property` are somewhat different from :func:" "`property`. A regular property blocks attribute writes unless a setter is " "defined. In contrast, a *cached_property* allows writes." msgstr "" -#: ../../library/functools.rst:80 +#: ../../library/functools.rst:85 msgid "" "The *cached_property* decorator only runs on lookups and only when an " "attribute of the same name doesn't exist. When it does run, the " @@ -98,20 +106,20 @@ msgid "" "and it works like a normal attribute." msgstr "" -#: ../../library/functools.rst:86 +#: ../../library/functools.rst:91 msgid "" "The cached value can be cleared by deleting the attribute. This allows the " "*cached_property* method to run again." msgstr "" -#: ../../library/functools.rst:89 +#: ../../library/functools.rst:94 msgid "" "Note, this decorator interferes with the operation of :pep:`412` key-sharing " "dictionaries. This means that instance dictionaries can take more space " "than usual." msgstr "" -#: ../../library/functools.rst:93 +#: ../../library/functools.rst:98 msgid "" "Also, this decorator requires that the ``__dict__`` attribute on each " "instance be a mutable mapping. This means it will not work with some types, " @@ -121,14 +129,14 @@ msgid "" "such classes don't provide a ``__dict__`` attribute at all)." msgstr "" -#: ../../library/functools.rst:100 +#: ../../library/functools.rst:105 msgid "" "If a mutable mapping is not available or if space-efficient key sharing is " "desired, an effect similar to :func:`cached_property` can be achieved by a " "stacking :func:`property` on top of :func:`cache`::" msgstr "" -#: ../../library/functools.rst:118 +#: ../../library/functools.rst:123 msgid "" "Transform an old-style comparison function to a :term:`key function`. Used " "with tools that accept key functions (such as :func:`sorted`, :func:`min`, :" @@ -138,7 +146,7 @@ msgid "" "comparison functions." msgstr "" -#: ../../library/functools.rst:125 +#: ../../library/functools.rst:130 msgid "" "A comparison function is any callable that accepts two arguments, compares " "them, and returns a negative number for less-than, zero for equality, or a " @@ -146,25 +154,25 @@ msgid "" "one argument and returns another value to be used as the sort key." msgstr "" -#: ../../library/functools.rst:134 +#: ../../library/functools.rst:139 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functools.rst:142 +#: ../../library/functools.rst:147 msgid "" "Decorator to wrap a function with a memoizing callable that saves up to the " "*maxsize* most recent calls. It can save time when an expensive or I/O " "bound function is periodically called with the same arguments." msgstr "" -#: ../../library/functools.rst:149 +#: ../../library/functools.rst:159 msgid "" "Since a dictionary is used to cache results, the positional and keyword " "arguments to the function must be :term:`hashable`." msgstr "" -#: ../../library/functools.rst:152 +#: ../../library/functools.rst:162 msgid "" "Distinct argument patterns may be considered to be distinct calls with " "separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` " @@ -172,20 +180,20 @@ msgid "" "entries." msgstr "" -#: ../../library/functools.rst:157 +#: ../../library/functools.rst:167 msgid "" "If *user_function* is specified, it must be a callable. This allows the " "*lru_cache* decorator to be applied directly to a user function, leaving the " "*maxsize* at its default value of 128::" msgstr "" -#: ../../library/functools.rst:165 +#: ../../library/functools.rst:175 msgid "" "If *maxsize* is set to ``None``, the LRU feature is disabled and the cache " "can grow without bound." msgstr "" -#: ../../library/functools.rst:168 +#: ../../library/functools.rst:178 msgid "" "If *typed* is set to true, function arguments of different types will be " "cached separately. If *typed* is false, the implementation will usually " @@ -193,7 +201,7 @@ msgid "" "such as *str* and *int* may be cached separately even when *typed* is false.)" msgstr "" -#: ../../library/functools.rst:174 +#: ../../library/functools.rst:184 msgid "" "Note, type specificity applies only to the function's immediate arguments " "rather than their contents. The scalar arguments, ``Decimal(42)`` and " @@ -202,7 +210,7 @@ msgid "" "Fraction(42))`` are treated as equivalent." msgstr "" -#: ../../library/functools.rst:180 +#: ../../library/functools.rst:190 msgid "" "The wrapped function is instrumented with a :func:`cache_parameters` " "function that returns a new :class:`dict` showing the values for *maxsize* " @@ -210,7 +218,7 @@ msgid "" "has no effect." msgstr "" -#: ../../library/functools.rst:185 +#: ../../library/functools.rst:195 msgid "" "To help measure the effectiveness of the cache and tune the *maxsize* " "parameter, the wrapped function is instrumented with a :func:`cache_info` " @@ -218,32 +226,32 @@ msgid "" "*maxsize* and *currsize*." msgstr "" -#: ../../library/functools.rst:190 +#: ../../library/functools.rst:200 msgid "" "The decorator also provides a :func:`cache_clear` function for clearing or " "invalidating the cache." msgstr "" -#: ../../library/functools.rst:193 +#: ../../library/functools.rst:203 msgid "" "The original underlying function is accessible through the :attr:" "`__wrapped__` attribute. This is useful for introspection, for bypassing " "the cache, or for rewrapping the function with a different cache." msgstr "" -#: ../../library/functools.rst:197 +#: ../../library/functools.rst:207 msgid "" "The cache keeps references to the arguments and return values until they age " "out of the cache or until the cache is cleared." msgstr "" -#: ../../library/functools.rst:200 +#: ../../library/functools.rst:210 msgid "" "If a method is cached, the ``self`` instance argument is included in the " "cache. See :ref:`faq-cache-method-calls`" msgstr "" -#: ../../library/functools.rst:203 +#: ../../library/functools.rst:213 msgid "" "An `LRU (least recently used) cache `_ works best when the " @@ -253,7 +261,7 @@ msgid "" "long-running processes such as web servers." msgstr "" -#: ../../library/functools.rst:210 +#: ../../library/functools.rst:220 msgid "" "In general, the LRU cache should only be used when you want to reuse " "previously computed values. Accordingly, it doesn't make sense to cache " @@ -261,44 +269,44 @@ msgid "" "objects on each call, or impure functions such as time() or random()." msgstr "" -#: ../../library/functools.rst:215 +#: ../../library/functools.rst:225 msgid "Example of an LRU cache for static web content::" msgstr "" -#: ../../library/functools.rst:234 +#: ../../library/functools.rst:244 msgid "" "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " "programming `_ technique::" msgstr "" -#: ../../library/functools.rst:254 +#: ../../library/functools.rst:264 msgid "Added the *typed* option." msgstr "新增 *typed* 選項。" -#: ../../library/functools.rst:257 +#: ../../library/functools.rst:267 msgid "Added the *user_function* option." msgstr "新增 *user_function* 選項。" -#: ../../library/functools.rst:260 +#: ../../library/functools.rst:270 msgid "Added the function :func:`cache_parameters`" msgstr "新增 :func:`cache_parameters` 函式。" -#: ../../library/functools.rst:265 +#: ../../library/functools.rst:275 msgid "" "Given a class defining one or more rich comparison ordering methods, this " "class decorator supplies the rest. This simplifies the effort involved in " "specifying all of the possible rich comparison operations:" msgstr "" -#: ../../library/functools.rst:269 +#: ../../library/functools.rst:279 msgid "" "The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, " "or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` " "method." msgstr "" -#: ../../library/functools.rst:293 +#: ../../library/functools.rst:303 msgid "" "While this decorator makes it easy to create well behaved totally ordered " "types, it *does* come at the cost of slower execution and more complex stack " @@ -307,7 +315,7 @@ msgid "" "rich comparison methods instead is likely to provide an easy speed boost." msgstr "" -#: ../../library/functools.rst:302 +#: ../../library/functools.rst:312 msgid "" "This decorator makes no attempt to override methods that have been declared " "in the class *or its superclasses*. Meaning that if a superclass defines a " @@ -315,13 +323,13 @@ msgid "" "the original method is abstract." msgstr "" -#: ../../library/functools.rst:309 +#: ../../library/functools.rst:319 msgid "" "Returning NotImplemented from the underlying comparison function for " "unrecognised types is now supported." msgstr "" -#: ../../library/functools.rst:315 +#: ../../library/functools.rst:325 msgid "" "Return a new :ref:`partial object` which when called will " "behave like *func* called with the positional arguments *args* and keyword " @@ -330,7 +338,7 @@ msgid "" "extend and override *keywords*. Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:331 +#: ../../library/functools.rst:341 msgid "" "The :func:`partial` is used for partial function application which " "\"freezes\" some portion of a function's arguments and/or keywords resulting " @@ -339,20 +347,20 @@ msgid "" "where the *base* argument defaults to two:" msgstr "" -#: ../../library/functools.rst:346 +#: ../../library/functools.rst:356 msgid "" "Return a new :class:`partialmethod` descriptor which behaves like :class:" "`partial` except that it is designed to be used as a method definition " "rather than being directly callable." msgstr "" -#: ../../library/functools.rst:350 +#: ../../library/functools.rst:360 msgid "" "*func* must be a :term:`descriptor` or a callable (objects which are both, " "like normal functions, are handled as descriptors)." msgstr "" -#: ../../library/functools.rst:353 +#: ../../library/functools.rst:363 msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" "`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " @@ -361,7 +369,7 @@ msgid "" "objects>` returned as the result." msgstr "" -#: ../../library/functools.rst:359 +#: ../../library/functools.rst:369 msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " "created dynamically. This behaves like a normal Python function when used as " @@ -370,7 +378,7 @@ msgid "" "`partialmethod` constructor." msgstr "" -#: ../../library/functools.rst:390 +#: ../../library/functools.rst:400 msgid "" "Apply *function* of two arguments cumulatively to the items of *iterable*, " "from left to right, so as to reduce the iterable to a single value. For " @@ -383,30 +391,30 @@ msgid "" "the first item is returned." msgstr "" -#: ../../library/functools.rst:399 +#: ../../library/functools.rst:409 msgid "Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:411 +#: ../../library/functools.rst:421 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." msgstr "" -#: ../../library/functools.rst:416 +#: ../../library/functools.rst:426 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:419 +#: ../../library/functools.rst:429 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. When defining a function using ``@singledispatch``, note that the " "dispatch happens on the type of the first argument::" msgstr "" -#: ../../library/functools.rst:430 +#: ../../library/functools.rst:440 msgid "" "To add overloaded implementations to the function, use the :func:`register` " "attribute of the generic function, which can be used as a decorator. For " @@ -414,36 +422,36 @@ msgid "" "first argument automatically::" msgstr "" -#: ../../library/functools.rst:448 +#: ../../library/functools.rst:458 msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" msgstr "" -#: ../../library/functools.rst:465 +#: ../../library/functools.rst:475 msgid "" "For code which doesn't use type annotations, the appropriate type argument " "can be passed explicitly to the decorator itself::" msgstr "" -#: ../../library/functools.rst:476 +#: ../../library/functools.rst:486 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " "the :func:`register` attribute can also be used in a functional form::" msgstr "" -#: ../../library/functools.rst:484 +#: ../../library/functools.rst:494 msgid "" "The :func:`register` attribute returns the undecorated function. This " "enables decorator stacking, :mod:`pickling`, and the creation of " "unit tests for each variant independently::" msgstr "" -#: ../../library/functools.rst:498 +#: ../../library/functools.rst:508 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "" -#: ../../library/functools.rst:518 +#: ../../library/functools.rst:528 msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " @@ -452,42 +460,42 @@ msgid "" "found." msgstr "" -#: ../../library/functools.rst:524 +#: ../../library/functools.rst:534 msgid "" "If an implementation is registered to an :term:`abstract base class`, " "virtual subclasses of the base class will be dispatched to that " "implementation::" msgstr "" -#: ../../library/functools.rst:539 +#: ../../library/functools.rst:549 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" -#: ../../library/functools.rst:547 +#: ../../library/functools.rst:557 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "" -#: ../../library/functools.rst:561 +#: ../../library/functools.rst:571 msgid "The :func:`register` attribute now supports using type annotations." msgstr "" -#: ../../library/functools.rst:564 +#: ../../library/functools.rst:574 msgid "" "The :func:`register` attribute now supports :data:`types.UnionType` and :" "data:`typing.Union` as type annotations." msgstr "" -#: ../../library/functools.rst:571 +#: ../../library/functools.rst:581 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:574 +#: ../../library/functools.rst:584 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a function using ``@singledispatchmethod``, note " @@ -495,7 +503,7 @@ msgid "" "argument::" msgstr "" -#: ../../library/functools.rst:592 +#: ../../library/functools.rst:602 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "func:`@classmethod`. Note that to allow for ``dispatcher." @@ -504,14 +512,14 @@ msgid "" "rather than an instance of the class::" msgstr "" -#: ../../library/functools.rst:614 +#: ../../library/functools.rst:624 msgid "" "The same pattern can be used for other similar decorators: :func:" "`@staticmethod`, :func:`@abstractmethod`, " "and others." msgstr "" -#: ../../library/functools.rst:623 +#: ../../library/functools.rst:633 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -525,7 +533,7 @@ msgid "" "``__dict__``, i.e. the instance dictionary)." msgstr "" -#: ../../library/functools.rst:633 +#: ../../library/functools.rst:643 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -533,7 +541,7 @@ msgid "" "that refers to the function being wrapped." msgstr "" -#: ../../library/functools.rst:638 +#: ../../library/functools.rst:648 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -542,7 +550,7 @@ msgid "" "is typically less than helpful." msgstr "" -#: ../../library/functools.rst:644 +#: ../../library/functools.rst:654 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -551,26 +559,26 @@ msgid "" "wrapper function itself is missing any attributes named in *updated*." msgstr "" -#: ../../library/functools.rst:650 +#: ../../library/functools.rst:660 msgid "Automatic addition of the ``__wrapped__`` attribute." msgstr "" -#: ../../library/functools.rst:653 +#: ../../library/functools.rst:663 msgid "Copying of the ``__annotations__`` attribute by default." msgstr "" -#: ../../library/functools.rst:656 +#: ../../library/functools.rst:666 msgid "Missing attributes no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:659 +#: ../../library/functools.rst:669 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: ../../library/functools.rst:667 +#: ../../library/functools.rst:677 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -578,42 +586,42 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: ../../library/functools.rst:693 +#: ../../library/functools.rst:703 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: ../../library/functools.rst:701 +#: ../../library/functools.rst:711 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:703 +#: ../../library/functools.rst:713 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: ../../library/functools.rst:709 +#: ../../library/functools.rst:719 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: ../../library/functools.rst:715 +#: ../../library/functools.rst:725 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: ../../library/functools.rst:721 +#: ../../library/functools.rst:731 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: ../../library/functools.rst:724 +#: ../../library/functools.rst:734 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " "callable, weak referencable, and can have attributes. There are some " diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 3ecef97fa9..7d9911eddf 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-12 00:15+0000\n" +"POT-Creation-Date: 2023-04-23 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-" @@ -165,7 +165,7 @@ msgid "" "pipes." msgstr "" -#: ../../library/multiprocessing.rst:142 ../../library/multiprocessing.rst:1072 +#: ../../library/multiprocessing.rst:142 ../../library/multiprocessing.rst:1070 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " @@ -399,38 +399,38 @@ msgid "" "importable by the children. This is covered in :ref:`multiprocessing-" "programming` however it is worth pointing out here. This means that some " "examples, such as the :class:`multiprocessing.pool.Pool` examples will not " -"work in the interactive interpreter. For example:" +"work in the interactive interpreter. For example::" msgstr "" -#: ../../library/multiprocessing.rst:469 +#: ../../library/multiprocessing.rst:467 msgid "" "(If you try this it will actually output three full tracebacks interleaved " "in a semi-random fashion, and then you may have to stop the parent process " "somehow.)" msgstr "" -#: ../../library/multiprocessing.rst:475 +#: ../../library/multiprocessing.rst:473 msgid "Reference" msgstr "" -#: ../../library/multiprocessing.rst:477 +#: ../../library/multiprocessing.rst:475 msgid "" "The :mod:`multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:482 +#: ../../library/multiprocessing.rst:480 msgid ":class:`Process` and exceptions" msgstr ":class:`Process` 與例外" -#: ../../library/multiprocessing.rst:487 +#: ../../library/multiprocessing.rst:485 msgid "" "Process objects represent activity that is run in a separate process. The :" "class:`Process` class has equivalents of all the methods of :class:" "`threading.Thread`." msgstr "" -#: ../../library/multiprocessing.rst:491 +#: ../../library/multiprocessing.rst:489 msgid "" "The constructor should always be called with keyword arguments. *group* " "should always be ``None``; it exists solely for compatibility with :class:" @@ -444,29 +444,29 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:502 +#: ../../library/multiprocessing.rst:500 msgid "" "By default, no arguments are passed to *target*. The *args* argument, which " "defaults to ``()``, can be used to specify a list or tuple of the arguments " "to pass to *target*." msgstr "" -#: ../../library/multiprocessing.rst:506 +#: ../../library/multiprocessing.rst:504 msgid "" "If a subclass overrides the constructor, it must make sure it invokes the " "base class constructor (:meth:`Process.__init__`) before doing anything else " "to the process." msgstr "" -#: ../../library/multiprocessing.rst:510 +#: ../../library/multiprocessing.rst:508 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/multiprocessing.rst:515 +#: ../../library/multiprocessing.rst:513 msgid "Method representing the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:517 +#: ../../library/multiprocessing.rst:515 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " @@ -474,30 +474,30 @@ msgid "" "*args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/multiprocessing.rst:522 +#: ../../library/multiprocessing.rst:520 msgid "" "Using a list or tuple as the *args* argument passed to :class:`Process` " "achieves the same effect." msgstr "" -#: ../../library/multiprocessing.rst:525 +#: ../../library/multiprocessing.rst:523 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/multiprocessing.rst:537 +#: ../../library/multiprocessing.rst:535 msgid "Start the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:539 +#: ../../library/multiprocessing.rst:537 msgid "" "This must be called at most once per process object. It arranges for the " "object's :meth:`run` method to be invoked in a separate process." msgstr "" -#: ../../library/multiprocessing.rst:544 +#: ../../library/multiprocessing.rst:542 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -507,23 +507,23 @@ msgid "" "terminated." msgstr "" -#: ../../library/multiprocessing.rst:551 +#: ../../library/multiprocessing.rst:549 msgid "A process can be joined many times." msgstr "" -#: ../../library/multiprocessing.rst:553 +#: ../../library/multiprocessing.rst:551 msgid "" "A process cannot join itself because this would cause a deadlock. It is an " "error to attempt to join a process before it has been started." msgstr "" -#: ../../library/multiprocessing.rst:558 +#: ../../library/multiprocessing.rst:556 msgid "" "The process's name. The name is a string used for identification purposes " "only. It has no semantics. Multiple processes may be given the same name." msgstr "" -#: ../../library/multiprocessing.rst:562 +#: ../../library/multiprocessing.rst:560 msgid "" "The initial name is set by the constructor. If no explicit name is provided " "to the constructor, a name of the form 'Process-N\\ :sub:`1`:N\\ :sub:" @@ -531,33 +531,33 @@ msgid "" "child of its parent." msgstr "" -#: ../../library/multiprocessing.rst:569 +#: ../../library/multiprocessing.rst:567 msgid "Return whether the process is alive." msgstr "" -#: ../../library/multiprocessing.rst:571 +#: ../../library/multiprocessing.rst:569 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -#: ../../library/multiprocessing.rst:576 +#: ../../library/multiprocessing.rst:574 msgid "" "The process's daemon flag, a Boolean value. This must be set before :meth:" "`start` is called." msgstr "" -#: ../../library/multiprocessing.rst:579 +#: ../../library/multiprocessing.rst:577 msgid "The initial value is inherited from the creating process." msgstr "" -#: ../../library/multiprocessing.rst:581 +#: ../../library/multiprocessing.rst:579 msgid "" "When a process exits, it attempts to terminate all of its daemonic child " "processes." msgstr "" -#: ../../library/multiprocessing.rst:584 +#: ../../library/multiprocessing.rst:582 msgid "" "Note that a daemonic process is not allowed to create child processes. " "Otherwise a daemonic process would leave its children orphaned if it gets " @@ -566,92 +566,92 @@ msgid "" "(and not joined) if non-daemonic processes have exited." msgstr "" -#: ../../library/multiprocessing.rst:590 +#: ../../library/multiprocessing.rst:588 msgid "" "In addition to the :class:`threading.Thread` API, :class:`Process` objects " "also support the following attributes and methods:" msgstr "" -#: ../../library/multiprocessing.rst:595 +#: ../../library/multiprocessing.rst:593 msgid "" "Return the process ID. Before the process is spawned, this will be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:600 +#: ../../library/multiprocessing.rst:598 msgid "" "The child's exit code. This will be ``None`` if the process has not yet " "terminated." msgstr "" -#: ../../library/multiprocessing.rst:603 +#: ../../library/multiprocessing.rst:601 msgid "" "If the child's :meth:`run` method returned normally, the exit code will be " "0. If it terminated via :func:`sys.exit` with an integer argument *N*, the " "exit code will be *N*." msgstr "" -#: ../../library/multiprocessing.rst:607 +#: ../../library/multiprocessing.rst:605 msgid "" "If the child terminated due to an exception not caught within :meth:`run`, " "the exit code will be 1. If it was terminated by signal *N*, the exit code " "will be the negative value *-N*." msgstr "" -#: ../../library/multiprocessing.rst:613 +#: ../../library/multiprocessing.rst:611 msgid "The process's authentication key (a byte string)." msgstr "" -#: ../../library/multiprocessing.rst:615 +#: ../../library/multiprocessing.rst:613 msgid "" "When :mod:`multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" -#: ../../library/multiprocessing.rst:618 +#: ../../library/multiprocessing.rst:616 msgid "" "When a :class:`Process` object is created, it will inherit the " "authentication key of its parent process, although this may be changed by " "setting :attr:`authkey` to another byte string." msgstr "" -#: ../../library/multiprocessing.rst:622 +#: ../../library/multiprocessing.rst:620 msgid "See :ref:`multiprocessing-auth-keys`." msgstr "參閱 :ref:`multiprocessing-auth-keys`\\ 。" -#: ../../library/multiprocessing.rst:626 +#: ../../library/multiprocessing.rst:624 msgid "" "A numeric handle of a system object which will become \"ready\" when the " "process ends." msgstr "" -#: ../../library/multiprocessing.rst:629 +#: ../../library/multiprocessing.rst:627 msgid "" "You can use this value if you want to wait on several events at once using :" "func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join()` is " "simpler." msgstr "" -#: ../../library/multiprocessing.rst:633 +#: ../../library/multiprocessing.rst:631 msgid "" "On Windows, this is an OS handle usable with the ``WaitForSingleObject`` and " "``WaitForMultipleObjects`` family of API calls. On Unix, this is a file " "descriptor usable with primitives from the :mod:`select` module." msgstr "" -#: ../../library/multiprocessing.rst:641 +#: ../../library/multiprocessing.rst:639 msgid "" "Terminate the process. On Unix this is done using the ``SIGTERM`` signal; " "on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " "finally clauses, etc., will not be executed." msgstr "" -#: ../../library/multiprocessing.rst:645 +#: ../../library/multiprocessing.rst:643 msgid "" "Note that descendant processes of the process will *not* be terminated -- " "they will simply become orphaned." msgstr "" -#: ../../library/multiprocessing.rst:650 +#: ../../library/multiprocessing.rst:648 msgid "" "If this method is used when the associated process is using a pipe or queue " "then the pipe or queue is liable to become corrupted and may become unusable " @@ -660,11 +660,11 @@ msgid "" "deadlock." msgstr "" -#: ../../library/multiprocessing.rst:658 +#: ../../library/multiprocessing.rst:656 msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on Unix." msgstr "" -#: ../../library/multiprocessing.rst:664 +#: ../../library/multiprocessing.rst:662 msgid "" "Close the :class:`Process` object, releasing all resources associated with " "it. :exc:`ValueError` is raised if the underlying process is still " @@ -672,59 +672,59 @@ msgid "" "attributes of the :class:`Process` object will raise :exc:`ValueError`." msgstr "" -#: ../../library/multiprocessing.rst:672 +#: ../../library/multiprocessing.rst:670 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -#: ../../library/multiprocessing.rst:676 +#: ../../library/multiprocessing.rst:674 msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:696 +#: ../../library/multiprocessing.rst:694 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:700 +#: ../../library/multiprocessing.rst:698 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:703 +#: ../../library/multiprocessing.rst:701 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:708 +#: ../../library/multiprocessing.rst:706 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:712 +#: ../../library/multiprocessing.rst:710 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:715 +#: ../../library/multiprocessing.rst:713 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:717 +#: ../../library/multiprocessing.rst:715 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:721 +#: ../../library/multiprocessing.rst:719 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:724 +#: ../../library/multiprocessing.rst:722 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -734,7 +734,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:731 +#: ../../library/multiprocessing.rst:729 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -742,20 +742,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:736 +#: ../../library/multiprocessing.rst:734 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:741 +#: ../../library/multiprocessing.rst:739 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:748 +#: ../../library/multiprocessing.rst:746 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -764,14 +764,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:755 +#: ../../library/multiprocessing.rst:753 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:760 +#: ../../library/multiprocessing.rst:758 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -779,7 +779,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:767 +#: ../../library/multiprocessing.rst:765 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -787,7 +787,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:774 +#: ../../library/multiprocessing.rst:772 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1133 +#: ../../library/multiprocessing.rst:1131 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1136 +#: ../../library/multiprocessing.rst:1134 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1141 +#: ../../library/multiprocessing.rst:1139 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1148 +#: ../../library/multiprocessing.rst:1146 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1152 +#: ../../library/multiprocessing.rst:1150 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1154 +#: ../../library/multiprocessing.rst:1152 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1158 +#: ../../library/multiprocessing.rst:1156 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1160 +#: ../../library/multiprocessing.rst:1158 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1164 +#: ../../library/multiprocessing.rst:1162 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1169 +#: ../../library/multiprocessing.rst:1167 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1171 +#: ../../library/multiprocessing.rst:1169 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1273,7 +1273,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1178 +#: ../../library/multiprocessing.rst:1176 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1281,19 +1281,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1183 +#: ../../library/multiprocessing.rst:1181 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1187 +#: ../../library/multiprocessing.rst:1185 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1194 +#: ../../library/multiprocessing.rst:1192 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1301,45 +1301,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1200 +#: ../../library/multiprocessing.rst:1198 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1205 +#: ../../library/multiprocessing.rst:1203 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1209 +#: ../../library/multiprocessing.rst:1207 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1213 +#: ../../library/multiprocessing.rst:1211 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1218 +#: ../../library/multiprocessing.rst:1216 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1243 +#: ../../library/multiprocessing.rst:1241 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1247 +#: ../../library/multiprocessing.rst:1245 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1347,73 +1347,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1254 +#: ../../library/multiprocessing.rst:1252 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1260 +#: ../../library/multiprocessing.rst:1258 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1264 +#: ../../library/multiprocessing.rst:1262 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1268 +#: ../../library/multiprocessing.rst:1266 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1273 +#: ../../library/multiprocessing.rst:1271 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1279 +#: ../../library/multiprocessing.rst:1277 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1282 -#: ../../library/multiprocessing.rst:1420 +#: ../../library/multiprocessing.rst:1280 +#: ../../library/multiprocessing.rst:1418 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:1286 +#: ../../library/multiprocessing.rst:1284 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1291 +#: ../../library/multiprocessing.rst:1289 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1293 +#: ../../library/multiprocessing.rst:1291 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1296 -#: ../../library/multiprocessing.rst:1845 +#: ../../library/multiprocessing.rst:1294 +#: ../../library/multiprocessing.rst:1843 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1301 +#: ../../library/multiprocessing.rst:1299 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1306 +#: ../../library/multiprocessing.rst:1304 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 " @@ -1424,25 +1424,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1314 +#: ../../library/multiprocessing.rst:1312 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:1318 +#: ../../library/multiprocessing.rst:1316 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1323 -#: ../../library/multiprocessing.rst:1374 +#: ../../library/multiprocessing.rst:1321 +#: ../../library/multiprocessing.rst:1372 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1325 +#: ../../library/multiprocessing.rst:1323 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 " @@ -1450,14 +1450,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1330 +#: ../../library/multiprocessing.rst:1328 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:1334 +#: ../../library/multiprocessing.rst:1332 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 " @@ -1471,19 +1471,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1349 +#: ../../library/multiprocessing.rst:1347 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:1352 +#: ../../library/multiprocessing.rst:1350 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:1358 +#: ../../library/multiprocessing.rst:1356 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. " @@ -1492,20 +1492,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1364 +#: ../../library/multiprocessing.rst:1362 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:1368 +#: ../../library/multiprocessing.rst:1366 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1376 +#: ../../library/multiprocessing.rst:1374 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 " @@ -1518,7 +1518,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1386 +#: ../../library/multiprocessing.rst:1384 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 " @@ -1529,14 +1529,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1394 +#: ../../library/multiprocessing.rst:1392 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:1401 +#: ../../library/multiprocessing.rst:1399 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 " @@ -1546,7 +1546,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1409 +#: ../../library/multiprocessing.rst:1407 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 " @@ -1555,17 +1555,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1418 +#: ../../library/multiprocessing.rst:1416 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1425 +#: ../../library/multiprocessing.rst:1423 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:1430 +#: ../../library/multiprocessing.rst:1428 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1574,13 +1574,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1436 +#: ../../library/multiprocessing.rst:1434 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1441 +#: ../../library/multiprocessing.rst:1439 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1589,32 +1589,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1449 +#: ../../library/multiprocessing.rst:1447 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1451 +#: ../../library/multiprocessing.rst:1449 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1456 +#: ../../library/multiprocessing.rst:1454 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:1460 -#: ../../library/multiprocessing.rst:1547 +#: ../../library/multiprocessing.rst:1458 +#: ../../library/multiprocessing.rst:1545 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:1464 +#: ../../library/multiprocessing.rst:1462 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` " @@ -1624,32 +1624,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1471 +#: ../../library/multiprocessing.rst:1469 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:1477 +#: ../../library/multiprocessing.rst:1475 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1483 -#: ../../library/multiprocessing.rst:1573 -#: ../../library/multiprocessing.rst:1588 +#: ../../library/multiprocessing.rst:1481 +#: ../../library/multiprocessing.rst:1571 +#: ../../library/multiprocessing.rst:1586 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1487 +#: ../../library/multiprocessing.rst:1485 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:1490 +#: ../../library/multiprocessing.rst:1488 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 " @@ -1659,7 +1659,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1497 +#: ../../library/multiprocessing.rst:1495 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:" @@ -1669,28 +1669,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1504 +#: ../../library/multiprocessing.rst:1502 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1506 +#: ../../library/multiprocessing.rst:1504 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:1511 +#: ../../library/multiprocessing.rst:1509 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1516 +#: ../../library/multiprocessing.rst:1514 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:1522 +#: ../../library/multiprocessing.rst:1520 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. " @@ -1699,11 +1699,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1530 +#: ../../library/multiprocessing.rst:1528 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1532 +#: ../../library/multiprocessing.rst:1530 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 " @@ -1713,40 +1713,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1539 +#: ../../library/multiprocessing.rst:1537 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:1545 +#: ../../library/multiprocessing.rst:1543 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1551 +#: ../../library/multiprocessing.rst:1549 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:1555 +#: ../../library/multiprocessing.rst:1553 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:1561 +#: ../../library/multiprocessing.rst:1559 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:1565 -#: ../../library/multiprocessing.rst:1581 +#: ../../library/multiprocessing.rst:1563 +#: ../../library/multiprocessing.rst:1579 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." @@ -1756,121 +1756,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1577 +#: ../../library/multiprocessing.rst:1575 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:1592 +#: ../../library/multiprocessing.rst:1590 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1597 +#: ../../library/multiprocessing.rst:1595 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:1601 +#: ../../library/multiprocessing.rst:1599 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:1605 +#: ../../library/multiprocessing.rst:1603 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:1608 +#: ../../library/multiprocessing.rst:1606 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1612 +#: ../../library/multiprocessing.rst:1610 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:1617 +#: ../../library/multiprocessing.rst:1615 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1615 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1615 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1617 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1617 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1617 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1618 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1618 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1621 +#: ../../library/multiprocessing.rst:1619 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1621 +#: ../../library/multiprocessing.rst:1619 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1621 +#: ../../library/multiprocessing.rst:1619 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1622 +#: ../../library/multiprocessing.rst:1620 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1622 +#: ../../library/multiprocessing.rst:1620 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1622 +#: ../../library/multiprocessing.rst:1620 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1626 +#: ../../library/multiprocessing.rst:1624 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1664 +#: ../../library/multiprocessing.rst:1662 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1677 +#: ../../library/multiprocessing.rst:1675 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1679 +#: ../../library/multiprocessing.rst:1677 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1879,7 +1879,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1688 +#: ../../library/multiprocessing.rst:1686 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1887,31 +1887,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1696 +#: ../../library/multiprocessing.rst:1694 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:1702 +#: ../../library/multiprocessing.rst:1700 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1704 +#: ../../library/multiprocessing.rst:1702 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:1707 +#: ../../library/multiprocessing.rst:1705 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:1710 +#: ../../library/multiprocessing.rst:1708 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`` " @@ -1919,19 +1919,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1715 +#: ../../library/multiprocessing.rst:1713 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1718 +#: ../../library/multiprocessing.rst:1716 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1721 +#: ../../library/multiprocessing.rst:1719 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 " @@ -1939,54 +1939,54 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1726 +#: ../../library/multiprocessing.rst:1724 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1731 +#: ../../library/multiprocessing.rst:1729 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:1736 +#: ../../library/multiprocessing.rst:1734 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:1745 +#: ../../library/multiprocessing.rst:1743 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1749 +#: ../../library/multiprocessing.rst:1747 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1757 +#: ../../library/multiprocessing.rst:1755 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:1760 +#: ../../library/multiprocessing.rst:1758 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1764 +#: ../../library/multiprocessing.rst:1762 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1767 +#: ../../library/multiprocessing.rst:1765 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:1770 +#: ../../library/multiprocessing.rst:1768 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -1994,14 +1994,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1776 +#: ../../library/multiprocessing.rst:1774 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:1780 +#: ../../library/multiprocessing.rst:1778 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2012,7 +2012,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1789 +#: ../../library/multiprocessing.rst:1787 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 " @@ -2022,22 +2022,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1796 +#: ../../library/multiprocessing.rst:1794 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:1800 +#: ../../library/multiprocessing.rst:1798 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1804 +#: ../../library/multiprocessing.rst:1802 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1806 +#: ../../library/multiprocessing.rst:1804 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2045,173 +2045,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1812 +#: ../../library/multiprocessing.rst:1810 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:1817 +#: ../../library/multiprocessing.rst:1815 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:1821 +#: ../../library/multiprocessing.rst:1819 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:1827 +#: ../../library/multiprocessing.rst:1825 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1832 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1837 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1842 +#: ../../library/multiprocessing.rst:1840 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:1850 +#: ../../library/multiprocessing.rst:1848 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1854 +#: ../../library/multiprocessing.rst:1852 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1858 +#: ../../library/multiprocessing.rst:1856 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1862 +#: ../../library/multiprocessing.rst:1860 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1866 +#: ../../library/multiprocessing.rst:1864 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1870 +#: ../../library/multiprocessing.rst:1868 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1875 +#: ../../library/multiprocessing.rst:1873 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1879 +#: ../../library/multiprocessing.rst:1877 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1886 +#: ../../library/multiprocessing.rst:1884 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1891 +#: ../../library/multiprocessing.rst:1889 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1893 +#: ../../library/multiprocessing.rst:1891 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:1900 +#: ../../library/multiprocessing.rst:1898 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1902 +#: ../../library/multiprocessing.rst:1900 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:1905 +#: ../../library/multiprocessing.rst:1903 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:1921 +#: ../../library/multiprocessing.rst:1919 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1923 +#: ../../library/multiprocessing.rst:1921 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:1948 +#: ../../library/multiprocessing.rst:1946 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1950 +#: ../../library/multiprocessing.rst:1948 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:1953 +#: ../../library/multiprocessing.rst:1951 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1965 +#: ../../library/multiprocessing.rst:1963 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1975 +#: ../../library/multiprocessing.rst:1973 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1986 +#: ../../library/multiprocessing.rst:1984 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2011 +#: ../../library/multiprocessing.rst:2009 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2013 +#: ../../library/multiprocessing.rst:2011 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:2017 +#: ../../library/multiprocessing.rst:2015 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2219,14 +2219,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2035 +#: ../../library/multiprocessing.rst:2033 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:2039 +#: ../../library/multiprocessing.rst:2037 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:" @@ -2234,11 +2234,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2055 +#: ../../library/multiprocessing.rst:2053 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2068 +#: ../../library/multiprocessing.rst:2066 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 " @@ -2249,53 +2249,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2087 +#: ../../library/multiprocessing.rst:2085 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:2093 +#: ../../library/multiprocessing.rst:2091 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2101 +#: ../../library/multiprocessing.rst:2099 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2105 +#: ../../library/multiprocessing.rst:2103 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2109 +#: ../../library/multiprocessing.rst:2107 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2111 +#: ../../library/multiprocessing.rst:2109 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2115 +#: ../../library/multiprocessing.rst:2113 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2119 +#: ../../library/multiprocessing.rst:2117 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2121 +#: ../../library/multiprocessing.rst:2119 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:2125 +#: ../../library/multiprocessing.rst:2123 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 " @@ -2303,79 +2303,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2130 +#: ../../library/multiprocessing.rst:2128 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2133 +#: ../../library/multiprocessing.rst:2131 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2147 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2151 +#: ../../library/multiprocessing.rst:2149 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2155 +#: ../../library/multiprocessing.rst:2153 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2159 +#: ../../library/multiprocessing.rst:2157 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2163 +#: ../../library/multiprocessing.rst:2161 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2165 +#: ../../library/multiprocessing.rst:2163 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:2168 +#: ../../library/multiprocessing.rst:2166 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2173 +#: ../../library/multiprocessing.rst:2171 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2176 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:2183 +#: ../../library/multiprocessing.rst:2181 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:2187 +#: ../../library/multiprocessing.rst:2185 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2190 -#: ../../library/multiprocessing.rst:2751 +#: ../../library/multiprocessing.rst:2188 +#: ../../library/multiprocessing.rst:2749 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2193 +#: ../../library/multiprocessing.rst:2191 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 " @@ -2383,7 +2383,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2198 +#: ../../library/multiprocessing.rst:2196 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2391,13 +2391,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2204 +#: ../../library/multiprocessing.rst:2202 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2208 +#: ../../library/multiprocessing.rst:2206 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 " @@ -2405,22 +2405,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2213 +#: ../../library/multiprocessing.rst:2211 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:2217 +#: ../../library/multiprocessing.rst:2215 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2220 +#: ../../library/multiprocessing.rst:2218 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2225 +#: ../../library/multiprocessing.rst:2223 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 " @@ -2431,7 +2431,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2235 +#: ../../library/multiprocessing.rst:2233 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 " @@ -2439,14 +2439,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2242 +#: ../../library/multiprocessing.rst:2240 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2245 -#: ../../library/multiprocessing.rst:2276 +#: ../../library/multiprocessing.rst:2243 +#: ../../library/multiprocessing.rst:2274 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, " @@ -2454,60 +2454,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2250 -#: ../../library/multiprocessing.rst:2281 +#: ../../library/multiprocessing.rst:2248 +#: ../../library/multiprocessing.rst:2279 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:2254 -#: ../../library/multiprocessing.rst:2285 +#: ../../library/multiprocessing.rst:2252 +#: ../../library/multiprocessing.rst:2283 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2259 +#: ../../library/multiprocessing.rst:2257 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:2263 +#: ../../library/multiprocessing.rst:2261 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:2267 +#: ../../library/multiprocessing.rst:2265 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:2273 +#: ../../library/multiprocessing.rst:2271 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2290 +#: ../../library/multiprocessing.rst:2288 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2292 +#: ../../library/multiprocessing.rst:2290 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:2297 +#: ../../library/multiprocessing.rst:2295 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: " @@ -2515,65 +2515,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2304 +#: ../../library/multiprocessing.rst:2302 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:2310 +#: ../../library/multiprocessing.rst:2308 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:2314 +#: ../../library/multiprocessing.rst:2312 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2321 +#: ../../library/multiprocessing.rst:2319 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:2329 +#: ../../library/multiprocessing.rst:2327 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:2334 +#: ../../library/multiprocessing.rst:2332 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:2340 +#: ../../library/multiprocessing.rst:2338 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2343 +#: ../../library/multiprocessing.rst:2341 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:2351 +#: ../../library/multiprocessing.rst:2349 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2356 +#: ../../library/multiprocessing.rst:2354 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2581,41 +2581,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2363 +#: ../../library/multiprocessing.rst:2361 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2367 +#: ../../library/multiprocessing.rst:2365 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2371 +#: ../../library/multiprocessing.rst:2369 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2374 +#: ../../library/multiprocessing.rst:2372 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2378 +#: ../../library/multiprocessing.rst:2376 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2405 +#: ../../library/multiprocessing.rst:2403 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2410 +#: ../../library/multiprocessing.rst:2408 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:2414 +#: ../../library/multiprocessing.rst:2412 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2624,46 +2624,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2423 +#: ../../library/multiprocessing.rst:2421 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2426 +#: ../../library/multiprocessing.rst:2424 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:2432 +#: ../../library/multiprocessing.rst:2430 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:2435 +#: ../../library/multiprocessing.rst:2433 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2440 +#: ../../library/multiprocessing.rst:2438 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2443 +#: ../../library/multiprocessing.rst:2441 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:2447 -#: ../../library/multiprocessing.rst:2482 +#: ../../library/multiprocessing.rst:2445 +#: ../../library/multiprocessing.rst:2480 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 " @@ -2672,26 +2672,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2455 +#: ../../library/multiprocessing.rst:2453 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2458 +#: ../../library/multiprocessing.rst:2456 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2463 +#: ../../library/multiprocessing.rst:2461 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:2467 +#: ../../library/multiprocessing.rst:2465 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 " @@ -2705,49 +2705,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2478 +#: ../../library/multiprocessing.rst:2476 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:2490 +#: ../../library/multiprocessing.rst:2488 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:2497 +#: ../../library/multiprocessing.rst:2495 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:2501 +#: ../../library/multiprocessing.rst:2499 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2505 +#: ../../library/multiprocessing.rst:2503 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2509 +#: ../../library/multiprocessing.rst:2507 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2512 +#: ../../library/multiprocessing.rst:2510 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:2519 +#: ../../library/multiprocessing.rst:2517 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 " @@ -2756,32 +2756,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2525 +#: ../../library/multiprocessing.rst:2523 msgid "" "For both Unix and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2528 +#: ../../library/multiprocessing.rst:2526 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2529 +#: ../../library/multiprocessing.rst:2527 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2530 +#: ../../library/multiprocessing.rst:2528 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2533 +#: ../../library/multiprocessing.rst:2531 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:2536 +#: ../../library/multiprocessing.rst:2534 msgid "" "**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2789,7 +2789,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2542 +#: ../../library/multiprocessing.rst:2540 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 " @@ -2798,46 +2798,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2552 +#: ../../library/multiprocessing.rst:2550 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2554 +#: ../../library/multiprocessing.rst:2552 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:2573 +#: ../../library/multiprocessing.rst:2571 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2590 +#: ../../library/multiprocessing.rst:2588 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2629 +#: ../../library/multiprocessing.rst:2627 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2631 +#: ../../library/multiprocessing.rst:2629 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:2634 +#: ../../library/multiprocessing.rst:2632 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2637 +#: ../../library/multiprocessing.rst:2635 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -2846,17 +2846,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2642 +#: ../../library/multiprocessing.rst:2640 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:2649 +#: ../../library/multiprocessing.rst:2647 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2651 +#: ../../library/multiprocessing.rst:2649 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2864,7 +2864,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2657 +#: ../../library/multiprocessing.rst:2655 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 " @@ -2872,7 +2872,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2663 +#: ../../library/multiprocessing.rst:2661 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2883,17 +2883,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2671 +#: ../../library/multiprocessing.rst:2669 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2675 +#: ../../library/multiprocessing.rst:2673 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2677 +#: ../../library/multiprocessing.rst:2675 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2901,27 +2901,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2684 +#: ../../library/multiprocessing.rst:2682 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2687 +#: ../../library/multiprocessing.rst:2685 msgid "" "When first created the logger has level :data:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2691 +#: ../../library/multiprocessing.rst:2689 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:2698 +#: ../../library/multiprocessing.rst:2696 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 " @@ -2930,25 +2930,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2704 +#: ../../library/multiprocessing.rst:2702 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2719 +#: ../../library/multiprocessing.rst:2717 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2723 +#: ../../library/multiprocessing.rst:2721 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2728 +#: ../../library/multiprocessing.rst:2726 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:2733 +#: ../../library/multiprocessing.rst:2731 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2956,7 +2956,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2741 +#: ../../library/multiprocessing.rst:2739 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2966,18 +2966,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2748 +#: ../../library/multiprocessing.rst:2746 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2754 +#: ../../library/multiprocessing.rst:2752 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2758 +#: ../../library/multiprocessing.rst:2756 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 :" @@ -2987,7 +2987,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2765 +#: ../../library/multiprocessing.rst:2763 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2996,69 +2996,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2775 +#: ../../library/multiprocessing.rst:2773 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2777 +#: ../../library/multiprocessing.rst:2775 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2782 +#: ../../library/multiprocessing.rst:2780 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2784 +#: ../../library/multiprocessing.rst:2782 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2786 +#: ../../library/multiprocessing.rst:2784 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2788 +#: ../../library/multiprocessing.rst:2786 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2791 +#: ../../library/multiprocessing.rst:2789 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:2795 +#: ../../library/multiprocessing.rst:2793 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2797 +#: ../../library/multiprocessing.rst:2795 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2799 +#: ../../library/multiprocessing.rst:2797 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2801 +#: ../../library/multiprocessing.rst:2799 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2804 +#: ../../library/multiprocessing.rst:2802 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2806 +#: ../../library/multiprocessing.rst:2804 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2808 +#: ../../library/multiprocessing.rst:2806 msgid "" "On Unix 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 starts (or :" @@ -3069,11 +3069,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2816 +#: ../../library/multiprocessing.rst:2814 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2818 +#: ../../library/multiprocessing.rst:2816 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3083,11 +3083,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2826 +#: ../../library/multiprocessing.rst:2824 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2828 +#: ../../library/multiprocessing.rst:2826 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3095,18 +3095,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2834 +#: ../../library/multiprocessing.rst:2832 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:2838 +#: ../../library/multiprocessing.rst:2836 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2840 +#: ../../library/multiprocessing.rst:2838 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 " @@ -3115,7 +3115,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2846 +#: ../../library/multiprocessing.rst:2844 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 " @@ -3124,21 +3124,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2852 +#: ../../library/multiprocessing.rst:2850 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2866 +#: ../../library/multiprocessing.rst:2864 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2869 +#: ../../library/multiprocessing.rst:2867 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2871 +#: ../../library/multiprocessing.rst:2869 msgid "" "On Unix using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3146,7 +3146,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2876 +#: ../../library/multiprocessing.rst:2874 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 " @@ -3155,29 +3155,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2883 +#: ../../library/multiprocessing.rst:2881 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2895 +#: ../../library/multiprocessing.rst:2893 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2907 +#: ../../library/multiprocessing.rst:2905 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2909 +#: ../../library/multiprocessing.rst:2907 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2913 +#: ../../library/multiprocessing.rst:2911 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:2919 +#: ../../library/multiprocessing.rst:2917 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3187,33 +3187,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2926 +#: ../../library/multiprocessing.rst:2924 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:2938 +#: ../../library/multiprocessing.rst:2936 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2941 +#: ../../library/multiprocessing.rst:2939 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2943 +#: ../../library/multiprocessing.rst:2941 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2946 +#: ../../library/multiprocessing.rst:2944 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2948 +#: ../../library/multiprocessing.rst:2946 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3221,11 +3221,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2953 +#: ../../library/multiprocessing.rst:2951 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2955 +#: ../../library/multiprocessing.rst:2953 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 " @@ -3233,66 +3233,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2960 +#: ../../library/multiprocessing.rst:2958 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2965 +#: ../../library/multiprocessing.rst:2963 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2967 +#: ../../library/multiprocessing.rst:2965 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such a starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:2971 +#: ../../library/multiprocessing.rst:2969 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2983 +#: ../../library/multiprocessing.rst:2981 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2997 +#: ../../library/multiprocessing.rst:2995 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:3000 +#: ../../library/multiprocessing.rst:2998 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:3003 +#: ../../library/multiprocessing.rst:3001 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3010 +#: ../../library/multiprocessing.rst:3008 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3012 +#: ../../library/multiprocessing.rst:3010 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3018 +#: ../../library/multiprocessing.rst:3016 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:3024 +#: ../../library/multiprocessing.rst:3022 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" From 216bd10724596c3ee75f6609867fce430917a2fd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 24 Apr 2023 00:19:04 +0000 Subject: [PATCH 10/14] sync with cpython 7b2ac6cf --- c-api/file.po | 4 +-- c-api/init.po | 8 ++--- c-api/sys.po | 8 ++--- distributing/index.po | 24 ++++++------- faq/library.po | 6 ++-- howto/functional.po | 18 +++++----- howto/urllib2.po | 18 +++++----- library/array.po | 8 ++--- library/ctypes.po | 24 ++++++------- library/ensurepip.po | 4 +-- library/fcntl.po | 10 +++--- library/ftplib.po | 6 ++-- library/functions.po | 16 ++++----- library/gc.po | 8 ++--- library/glob.po | 6 ++-- library/http.client.po | 6 ++-- library/imaplib.po | 6 ++-- library/io.po | 16 ++++----- library/marshal.po | 12 +++---- library/mmap.po | 4 +-- library/msvcrt.po | 8 ++--- library/nntplib.po | 6 ++-- library/os.po | 76 ++++++++++++++++++++------------------- library/pathlib.po | 6 ++-- library/pdb.po | 4 +-- library/pickle.po | 8 ++--- library/pkgutil.po | 16 ++++----- library/poplib.po | 6 ++-- library/pty.po | 4 +-- library/readline.po | 9 ++--- library/resource.po | 6 ++-- library/shutil.po | 21 +++++------ library/signal.po | 4 +-- library/smtplib.po | 6 ++-- library/socket.po | 28 +++++++-------- library/sqlite3.po | 10 +++--- library/subprocess.po | 4 +-- library/sys.po | 24 ++++++------- library/syslog.po | 10 +++--- library/telnetlib.po | 6 ++-- library/tempfile.po | 8 ++--- library/types.po | 6 ++-- library/urllib.request.po | 4 +-- library/webbrowser.po | 4 +-- library/winreg.po | 44 +++++++++++------------ reference/datamodel.po | 8 ++--- using/cmdline.po | 12 +++---- whatsnew/2.6.po | 26 +++++++------- whatsnew/2.7.po | 33 ++++++++--------- 49 files changed, 312 insertions(+), 307 deletions(-) diff --git a/c-api/file.po b/c-api/file.po index b1a5e88e1d..c8ba148311 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+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-" @@ -116,7 +116,7 @@ msgstr "" msgid "This function is safe to call before :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/file.rst:21 +#: ../../c-api/file.rst:85 msgid "" "Raises an :ref:`auditing event ` ``setopencodehook`` with no " "arguments." diff --git a/c-api/init.po b/c-api/init.po index 67e569c109..9699096b64 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-16 00:18+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -464,7 +464,7 @@ msgid "" "than once." msgstr "" -#: ../../c-api/init.rst:29 +#: ../../c-api/init.rst:305 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." @@ -1259,7 +1259,7 @@ msgid "" "function." msgstr "" -#: ../../c-api/init.rst:5 +#: ../../c-api/init.rst:1109 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1271,7 +1271,7 @@ msgid "" "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:4 +#: ../../c-api/init.rst:1117 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." diff --git a/c-api/sys.po b/c-api/sys.po index d638f9b2c2..be03877fe0 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -154,8 +154,8 @@ msgstr "" msgid "" "Decode a byte string from the :term:`filesystem encoding and error handler`. " "If the error handler is :ref:`surrogateescape error handler " -"`, undecodable bytes are decoded as characters in range U" -"+DC80..U+DCFF; and if a byte sequence can be decoded as a surrogate " +"`, undecodable bytes are decoded as characters in range " +"U+DC80..U+DCFF; and if a byte sequence can be decoded as a surrogate " "character, the bytes are escaped using the surrogateescape error handler " "instead of decoding them." msgstr "" @@ -454,7 +454,7 @@ msgid "" "events table `. Details are in each function's documentation." msgstr "" -#: ../../c-api/sys.rst:26 +#: ../../c-api/sys.rst:390 msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." diff --git a/distributing/index.po b/distributing/index.po index f58138e68f..1bbe497dde 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-02 17:19+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2021-07-04 18:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -255,27 +255,27 @@ msgstr "`上傳專案至 Python 套件索引 (Python Package Index)`_" msgid "`The .pypirc file`_" msgstr "`.pypirc 檔案`_" -#: ../../distributing/index.rst:144 +#: ../../distributing/index.rst:140 msgid "How do I...?" msgstr "我該如何...?" -#: ../../distributing/index.rst:146 +#: ../../distributing/index.rst:142 msgid "These are quick answers or links for some common tasks." msgstr "接下來是關於一些常見任務的快速解答或連結。" -#: ../../distributing/index.rst:149 +#: ../../distributing/index.rst:145 msgid "... choose a name for my project?" msgstr "...為我的專案選擇一個名稱?" -#: ../../distributing/index.rst:151 +#: ../../distributing/index.rst:147 msgid "This isn't an easy topic, but here are a few tips:" msgstr "這不是一個簡單的題目,但這裡有一些提示:" -#: ../../distributing/index.rst:153 +#: ../../distributing/index.rst:149 msgid "check the Python Package Index to see if the name is already in use" msgstr "檢查 Python 套件索引,看看該名稱是否已被使用" -#: ../../distributing/index.rst:154 +#: ../../distributing/index.rst:150 msgid "" "check popular hosting sites like GitHub, Bitbucket, etc to see if there is " "already a project with that name" @@ -283,11 +283,11 @@ msgstr "" "檢查常用的代管網站,像是 GitHub、Bitbucket 等,看看是否已經有一個使用該名稱的" "專案" -#: ../../distributing/index.rst:156 +#: ../../distributing/index.rst:152 msgid "check what comes up in a web search for the name you're considering" msgstr "檢查您正在考慮的名稱在網路搜尋中會出現的內容" -#: ../../distributing/index.rst:157 +#: ../../distributing/index.rst:153 msgid "" "avoid particularly common words, especially ones with multiple meanings, as " "they can make it difficult for users to find your software when searching " @@ -296,11 +296,11 @@ msgstr "" "避免使用特別常見的單字,尤其是那些有多重含義的單字,因為它們會讓使用者在搜尋" "你的軟體時時很難找到它" -#: ../../distributing/index.rst:163 +#: ../../distributing/index.rst:159 msgid "... create and distribute binary extensions?" msgstr "...建立和發布二進制擴充?" -#: ../../distributing/index.rst:165 +#: ../../distributing/index.rst:161 msgid "" "This is actually quite a complex topic, with a variety of alternatives " "available depending on exactly what you're aiming to achieve. See the Python " @@ -309,7 +309,7 @@ msgstr "" "實際上這是一個非常複雜的題目,因為有各式各樣的替代方案可使用,取決於您確實想" "要達成的目標。更多的資訊和建議,請參閱 Python 封裝使用者指南。" -#: ../../distributing/index.rst:171 +#: ../../distributing/index.rst:167 msgid "" "`Python Packaging User Guide: Binary Extensions `__" diff --git a/faq/library.po b/faq/library.po index 1d6a8a250c..34fd7f51b3 100644 --- a/faq/library.po +++ b/faq/library.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2023-02-18 13:22+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1061,8 +1061,8 @@ msgstr "" msgid "" "The :mod:`asyncio` module provides a general purpose single-threaded and " "concurrent asynchronous library, which can be used for writing non-blocking " -"network code. The third-party `Twisted `_ " -"library is a popular and feature-rich alternative." +"network code. The third-party `Twisted `_ library is a " +"popular and feature-rich alternative." msgstr "" ":mod:`asyncio` 模組提供了一個通用的單執行緒並發非同步函式庫,可用於編寫非阻塞" "網路程式碼。第三方`Twisted `_ 函式庫是一種流" diff --git a/howto/functional.po b/howto/functional.po index 43e8526a9c..4c23d8fa4f 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-02 00:20+0000\n" +"POT-Creation-Date: 2023-04-24 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-" @@ -348,8 +348,8 @@ msgstr "" #: ../../howto/functional.rst:246 msgid "" "Built-in functions such as :func:`max` and :func:`min` can take a single " -"iterator argument and will return the largest or smallest element. The ``" -"\"in\"`` and ``\"not in\"`` operators also support iterators: ``X in " +"iterator argument and will return the largest or smallest element. The " +"``\"in\"`` and ``\"not in\"`` operators also support iterators: ``X in " "iterator`` is true if X is found in the stream returned by the iterator. " "You'll run into obvious problems if the iterator is infinite; :func:`max`, :" "func:`min` will never return, and if the element X never appears in the " @@ -1307,12 +1307,12 @@ msgstr "" #: ../../howto/functional.rst:1210 msgid "" "**Structure and Interpretation of Computer Programs**, by Harold Abelson and " -"Gerald Jay Sussman with Julie Sussman. Full text at https://mitpress.mit." -"edu/sicp/. In this classic textbook of computer science, chapters 2 and 3 " -"discuss the use of sequences and streams to organize the data flow inside a " -"program. The book uses Scheme for its examples, but many of the design " -"approaches described in these chapters are applicable to functional-style " -"Python code." +"Gerald Jay Sussman with Julie Sussman. The book can be found at https://" +"mitpress.mit.edu/sicp. In this classic textbook of computer science, " +"chapters 2 and 3 discuss the use of sequences and streams to organize the " +"data flow inside a program. The book uses Scheme for its examples, but many " +"of the design approaches described in these chapters are applicable to " +"functional-style Python code." msgstr "" #: ../../howto/functional.rst:1218 diff --git a/howto/urllib2.po b/howto/urllib2.po index b2f82af3a8..36a954e3e0 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2023-04-24 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-" @@ -150,8 +150,8 @@ msgid "" "In the case of HTTP, there are two extra things that Request objects allow " "you to do: First, you can pass data to be sent to the server. Second, you " "can pass extra information (\"metadata\") *about* the data or about the " -"request itself, to the server - this information is sent as HTTP \"headers" -"\". Let's look at each of these in turn." +"request itself, to the server - this information is sent as HTTP " +"\"headers\". Let's look at each of these in turn." msgstr "" #: ../../howto/urllib2.rst:105 @@ -445,8 +445,8 @@ msgid "" "To illustrate creating and installing a handler we will use the " "``HTTPBasicAuthHandler``. For a more detailed discussion of this subject -- " "including an explanation of how Basic Authentication works - see the `Basic " -"Authentication Tutorial `_." +"Authentication Tutorial `__." msgstr "" #: ../../howto/urllib2.rst:463 @@ -501,10 +501,10 @@ msgstr "" #: ../../howto/urllib2.rst:522 msgid "" "``top_level_url`` is in fact *either* a full URL (including the 'http:' " -"scheme component and the hostname and optionally the port number) e.g. ``" -"\"http://example.com/\"`` *or* an \"authority\" (i.e. the hostname, " -"optionally including the port number) e.g. ``\"example.com\"`` or ``" -"\"example.com:8080\"`` (the latter example includes a port number). The " +"scheme component and the hostname and optionally the port number) e.g. " +"``\"http://example.com/\"`` *or* an \"authority\" (i.e. the hostname, " +"optionally including the port number) e.g. ``\"example.com\"`` or " +"``\"example.com:8080\"`` (the latter example includes a port number). The " "authority, if present, must NOT contain the \"userinfo\" component - for " "example ``\"joe:password@example.com\"`` is not correct." msgstr "" diff --git a/library/array.po b/library/array.po index 7713e9a779..4944c18e30 100644 --- a/library/array.po +++ b/library/array.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-03 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2021-11-23 18:40+0800\n" "Last-Translator: Benson Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -276,7 +276,7 @@ msgstr "" "實作了緩衝區介面,可以在任何支援 :term:`bytes-like objects ` 的地方使用。" -#: ../../library/array.rst:17 +#: ../../library/array.rst:94 msgid "" "Raises an :ref:`auditing event ` ``array.__new__`` with arguments " "``typecode``, ``initializer``." @@ -310,8 +310,8 @@ msgstr "" "回傳一個 tuple ``(address, length)`` 表示當前的記憶體位置和陣列儲存元素的緩衝" "區記憶體長度。緩衝區的長度單位是位元組,並可以用 ``array.buffer_info()[1] * " "array.itemsize`` 計算得到。這偶爾會在底層操作需要記憶體位置的輸出輸入時很有" -"用,例如 :c:func:`!ioctl` 指令。只要陣列存在且沒有使用任何更改長度的操作時,回" -"傳的數值就有效。" +"用,例如 :c:func:`!ioctl` 指令。只要陣列存在且沒有使用任何更改長度的操作時," +"回傳的數值就有效。" #: ../../library/array.rst:124 msgid "" diff --git a/library/ctypes.po b/library/ctypes.po index 44a8088859..0b533a3415 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-26 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1862,7 +1862,7 @@ msgid "" "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:4 +#: ../../library/ctypes.rst:1848 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -1920,7 +1920,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:12 +#: ../../library/ctypes.rst:1892 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -1947,7 +1947,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:13 +#: ../../library/ctypes.rst:1909 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -2009,7 +2009,7 @@ msgid "" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:4 +#: ../../library/ctypes.rst:1967 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." @@ -2021,7 +2021,7 @@ msgid "" "system :data:`LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:4 +#: ../../library/ctypes.rst:1974 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." @@ -2074,7 +2074,7 @@ msgid "" "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:4 +#: ../../library/ctypes.rst:2019 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -2087,7 +2087,7 @@ msgid "" "return the previous value." msgstr "" -#: ../../library/ctypes.rst:5 +#: ../../library/ctypes.rst:2028 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -2106,7 +2106,7 @@ msgid "" "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:5 +#: ../../library/ctypes.rst:2043 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." @@ -2133,7 +2133,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:6 +#: ../../library/ctypes.rst:2065 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." @@ -2168,7 +2168,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:7 +#: ../../library/ctypes.rst:2094 ../../library/ctypes.rst:2104 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -2188,7 +2188,7 @@ msgid "" "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:4 +#: ../../library/ctypes.rst:2111 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." diff --git a/library/ensurepip.po b/library/ensurepip.po index e2ec7070a2..942014aff5 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -208,7 +208,7 @@ msgid "" "bootstrapping operation." msgstr "" -#: ../../library/ensurepip.rst:27 +#: ../../library/ensurepip.rst:136 msgid "" "Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " "argument ``root``." diff --git a/library/fcntl.po b/library/fcntl.po index b4380c79e5..86f5a34a64 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+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-" @@ -112,7 +112,7 @@ msgstr "" msgid "If the :c:func:`fcntl` fails, an :exc:`OSError` is raised." msgstr "" -#: ../../library/fcntl.rst:20 +#: ../../library/fcntl.rst:90 msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." @@ -181,7 +181,7 @@ msgstr "" "\n" "::" -#: ../../library/fcntl.rst:47 +#: ../../library/fcntl.rst:141 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." @@ -199,7 +199,7 @@ msgstr "" msgid "If the :c:func:`flock` fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/fcntl.rst:8 +#: ../../library/fcntl.rst:153 msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." @@ -264,7 +264,7 @@ msgid "" "file. The default for *whence* is also 0." msgstr "" -#: ../../library/fcntl.rst:31 +#: ../../library/fcntl.rst:188 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." diff --git a/library/ftplib.po b/library/ftplib.po index c27f54b035..d7fd8dccb2 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,7 +210,7 @@ msgid "" "port)`` for the socket to bind to as its source address before connecting." msgstr "" -#: ../../library/ftplib.rst:13 +#: ../../library/ftplib.rst:223 msgid "" "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " "``self``, ``host``, ``port``." @@ -246,7 +246,7 @@ msgid "" "Send a simple command string to the server and return the response string." msgstr "" -#: ../../library/ftplib.rst:3 ../../library/ftplib.rst:5 +#: ../../library/ftplib.rst:258 ../../library/ftplib.rst:267 msgid "" "Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments " "``self``, ``cmd``." diff --git a/library/functions.po b/library/functions.po index b853bedc45..b14ed245d8 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-06 00:14+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -520,7 +520,7 @@ msgid "" "not accessible, this function will raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:13 +#: ../../library/functions.rst:171 msgid "" "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " "argument ``breakpointhook``." @@ -798,7 +798,7 @@ msgid "" "parse`." msgstr "如果您想解析 Python 程式碼為 AST 運算式,請參閱 :func:`ast.parse`。" -#: ../../library/functions.rst:47 +#: ../../library/functions.rst:334 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source``, ``filename``." @@ -1126,7 +1126,7 @@ msgstr "" "另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的運算式字" "串。" -#: ../../library/functions.rst:33 ../../library/functions.rst:43 +#: ../../library/functions.rst:559 ../../library/functions.rst:600 msgid "" "Raises an :ref:`auditing event ` ``exec`` with argument " "``code_object``." @@ -1524,7 +1524,7 @@ msgstr "" msgid "This is the address of the object in memory." msgstr "" -#: ../../library/functions.rst:8 +#: ../../library/functions.rst:854 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." @@ -1551,7 +1551,7 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:14 +#: ../../library/functions.rst:873 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt``." @@ -1563,7 +1563,7 @@ msgid "" "``prompt`` before reading input" msgstr "" -#: ../../library/functions.rst:19 +#: ../../library/functions.rst:878 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "argument ``result``." @@ -2223,7 +2223,7 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:191 +#: ../../library/functions.rst:1348 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." diff --git a/library/gc.po b/library/gc.po index 3f835bf836..49df082dc3 100644 --- a/library/gc.po +++ b/library/gc.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-11 00:15+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2022-10-01 14:57+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -111,7 +111,7 @@ msgstr "" msgid "New *generation* parameter." msgstr "新增 *generation* 參數。" -#: ../../library/gc.rst:8 +#: ../../library/gc.rst:75 msgid "" "Raises an :ref:`auditing event ` ``gc.get_objects`` with argument " "``generation``." @@ -227,7 +227,7 @@ msgstr "" "在建構中而處於暫時無效的狀態。不要把 :func:`get_referrers` 用於除錯以外的其它" "目的。" -#: ../../library/gc.rst:17 +#: ../../library/gc.rst:146 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referrers`` with " "argument ``objs``." @@ -253,7 +253,7 @@ msgstr "" "此,可以有以下例子:一個整數對於一個引數是直接可達的,這個整數物件有可能出現" "或不出現在結果的 list 當中。" -#: ../../library/gc.rst:9 +#: ../../library/gc.rst:159 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referents`` with " "argument ``objs``." diff --git a/library/glob.po b/library/glob.po index 6873244ea1..c96f68a159 100644 --- a/library/glob.po +++ b/library/glob.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -94,13 +94,13 @@ msgid "" "directories." msgstr "" -#: ../../library/glob.rst:4 ../../library/glob.rst:29 +#: ../../library/glob.rst:73 ../../library/glob.rst:96 msgid "" "Raises an :ref:`auditing event ` ``glob.glob`` with arguments " "``pathname``, ``recursive``." msgstr "" -#: ../../library/glob.rst:5 ../../library/glob.rst:30 +#: ../../library/glob.rst:74 ../../library/glob.rst:97 msgid "" "Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments " "``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." diff --git a/library/http.client.po b/library/http.client.po index ace2170f29..81c7077c67 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -410,7 +410,7 @@ msgid "" "already have a connection." msgstr "" -#: ../../library/http.client.rst:5 +#: ../../library/http.client.rst:384 msgid "" "Raises an :ref:`auditing event ` ``http.client.connect`` with " "arguments ``self``, ``host``, ``port``." @@ -486,7 +486,7 @@ msgid "" "`endheaders` method has been called and before :meth:`getresponse` is called." msgstr "" -#: ../../library/http.client.rst:5 +#: ../../library/http.client.rst:455 msgid "" "Raises an :ref:`auditing event ` ``http.client.send`` with " "arguments ``self``, ``data``." diff --git a/library/imaplib.po b/library/imaplib.po index 60c90ab635..a9eefe22e0 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -429,7 +429,7 @@ msgid "" "method." msgstr "" -#: ../../library/imaplib.rst:11 +#: ../../library/imaplib.rst:392 msgid "" "Raises an :ref:`auditing event ` ``imaplib.open`` with arguments " "``self``, ``host``, ``port``." @@ -504,7 +504,7 @@ msgstr "" msgid "Sends ``data`` to the remote server. You may override this method." msgstr "" -#: ../../library/imaplib.rst:3 +#: ../../library/imaplib.rst:465 msgid "" "Raises an :ref:`auditing event ` ``imaplib.send`` with arguments " "``self``, ``data``." diff --git a/library/io.po b/library/io.po index b46f38074c..65c7ab85be 100644 --- a/library/io.po +++ b/library/io.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -167,8 +167,8 @@ msgstr "" msgid "" "Accordingly, it is highly recommended that you specify the encoding " "explicitly when opening text files. If you want to use UTF-8, pass " -"``encoding=\"utf-8\"``. To use the current locale encoding, ``encoding=" -"\"locale\"`` is supported since Python 3.10." +"``encoding=\"utf-8\"``. To use the current locale encoding, " +"``encoding=\"locale\"`` is supported since Python 3.10." msgstr "" #: ../../library/io.rst:135 @@ -229,7 +229,7 @@ msgstr "" msgid "This is an alias for the builtin :func:`open` function." msgstr "" -#: ../../library/io.rst:3 +#: ../../library/io.rst:175 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -1293,8 +1293,8 @@ msgstr "" #: ../../library/io.rst:952 msgid "" "*encoding* gives the name of the encoding that the stream will be decoded or " -"encoded with. It defaults to :func:`locale.getencoding()`. ``encoding=" -"\"locale\"`` can be used to specify the current locale's encoding " +"encoded with. It defaults to :func:`locale.getencoding()`. " +"``encoding=\"locale\"`` can be used to specify the current locale's encoding " "explicitly. See :ref:`io-text-encoding` for more information." msgstr "" @@ -1308,8 +1308,8 @@ msgid "" "marker (such as ``'?'``) to be inserted where there is malformed data. " "``'backslashreplace'`` causes malformed data to be replaced by a backslashed " "escape sequence. When writing, ``'xmlcharrefreplace'`` (replace with the " -"appropriate XML character reference) or ``'namereplace'`` (replace with ``" -"\\N{...}`` escape sequences) can be used. Any other error handling name " +"appropriate XML character reference) or ``'namereplace'`` (replace with " +"``\\N{...}`` escape sequences) can be used. Any other error handling name " "that has been registered with :func:`codecs.register_error` is also valid." msgstr "" diff --git a/library/marshal.po b/library/marshal.po index ace4774866..94f0bee797 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2021-12-15 12:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -130,7 +130,7 @@ msgid "" "(see below)." msgstr "*version* 引數指明 ``dump`` 應該使用的資料格式(見下文)。" -#: ../../library/marshal.rst:8 ../../library/marshal.rst:11 +#: ../../library/marshal.rst:69 ../../library/marshal.rst:101 msgid "" "Raises an :ref:`auditing event ` ``marshal.dumps`` with arguments " "``value``, ``version``." @@ -149,7 +149,7 @@ msgstr "" "Python 版本的不相容 marshal 格式),則會引發 :exc:`EOFError`\\ 、\\ :exc:" "`ValueError` 或 :exc:`TypeError`。檔案必須為可讀取的 :term:`binary file`\\ 。" -#: ../../library/marshal.rst:6 +#: ../../library/marshal.rst:79 msgid "" "Raises an :ref:`auditing event ` ``marshal.load`` with no " "arguments." @@ -198,13 +198,13 @@ msgstr "" "`EOFError`\\ 、\\ :exc:`ValueError` 或 :exc:`TypeError`\\ 。輸入中額外的位元" "組串會被忽略。" -#: ../../library/marshal.rst:5 +#: ../../library/marshal.rst:110 msgid "" "Raises an :ref:`auditing event ` ``marshal.loads`` with argument " "``bytes``." msgstr "" -"引發一個附帶引數 ``bytes`` 的\\ :ref:`稽核事件 ` ``marshal.loads``" -"\\ 。" +"引發一個附帶引數 ``bytes`` 的\\ :ref:`稽核事件 ` ``marshal." +"loads``\\ 。" #: ../../library/marshal.rst:114 msgid "" diff --git a/library/mmap.po b/library/mmap.po index 647c6477f2..550836ed76 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+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-" @@ -119,7 +119,7 @@ msgid "" "`ALLOCATIONGRANULARITY`." msgstr "" -#: ../../library/mmap.rst:20 ../../library/mmap.rst:87 +#: ../../library/mmap.rst:83 ../../library/mmap.rst:174 msgid "" "Raises an :ref:`auditing event ` ``mmap.__new__`` with arguments " "``fileno``, ``length``, ``access``, ``offset``." diff --git a/library/msvcrt.po b/library/msvcrt.po index 0f88d7da3e..5e25305235 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+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-" @@ -65,7 +65,7 @@ msgid "" "individually." msgstr "" -#: ../../library/msvcrt.rst:8 +#: ../../library/msvcrt.rst:45 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.locking`` with arguments " "``fd``, ``mode``, ``nbytes``." @@ -103,7 +103,7 @@ msgid "" "as a parameter to :func:`os.fdopen` to create a file object." msgstr "" -#: ../../library/msvcrt.rst:6 +#: ../../library/msvcrt.rst:82 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.open_osfhandle`` with " "arguments ``handle``, ``flags``." @@ -115,7 +115,7 @@ msgid "" "if *fd* is not recognized." msgstr "" -#: ../../library/msvcrt.rst:4 +#: ../../library/msvcrt.rst:90 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.get_osfhandle`` with " "argument ``fd``." diff --git a/library/nntplib.po b/library/nntplib.po index a91a96cc3b..799332cae2 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+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-" @@ -83,13 +83,13 @@ msgid "" "close the NNTP connection when done, e.g.:" msgstr "" -#: ../../library/nntplib.rst:13 ../../library/nntplib.rst:24 +#: ../../library/nntplib.rst:99 ../../library/nntplib.rst:131 msgid "" "Raises an :ref:`auditing event ` ``nntplib.connect`` with " "arguments ``self``, ``host``, ``port``." msgstr "" -#: ../../library/nntplib.rst:15 ../../library/nntplib.rst:26 +#: ../../library/nntplib.rst:101 ../../library/nntplib.rst:133 msgid "" "Raises an :ref:`auditing event ` ``nntplib.putline`` with " "arguments ``self``, ``line``." diff --git a/library/os.po b/library/os.po index 352ab2795b..14547b2a6e 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-22 00:14+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -681,7 +681,7 @@ msgid "" "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." msgstr "" -#: ../../library/os.rst:18 +#: ../../library/os.rst:558 msgid "" "Raises an :ref:`auditing event ` ``os.putenv`` with arguments " "``key``, ``value``." @@ -856,7 +856,7 @@ msgid "" "items of :data:`os.environ`." msgstr "" -#: ../../library/os.rst:12 +#: ../../library/os.rst:758 msgid "" "Raises an :ref:`auditing event ` ``os.unsetenv`` with argument " "``key``." @@ -1016,7 +1016,7 @@ msgid "" "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:5 ../../library/os.rst:6 ../../library/os.rst:38 +#: ../../library/os.rst:896 ../../library/os.rst:1914 ../../library/os.rst:2008 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -1037,7 +1037,7 @@ msgid "" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:5 ../../library/os.rst:6 ../../library/os.rst:11 +#: ../../library/os.rst:911 ../../library/os.rst:1936 ../../library/os.rst:2021 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -1118,7 +1118,7 @@ msgid "" "truncate(fd, length)``." msgstr "" -#: ../../library/os.rst:5 +#: ../../library/os.rst:989 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``fd``, ``length``." @@ -1153,7 +1153,7 @@ msgid "" "specifies the section of the file to lock." msgstr "" -#: ../../library/os.rst:7 +#: ../../library/os.rst:1026 msgid "" "Raises an :ref:`auditing event ` ``os.lockf`` with arguments " "``fd``, ``cmd``, ``len``." @@ -1214,7 +1214,7 @@ msgid "" "` with the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:14 +#: ../../library/os.rst:1092 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -1943,7 +1943,7 @@ msgid "" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:5 ../../library/os.rst:11 +#: ../../library/os.rst:1834 ../../library/os.rst:1967 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." @@ -2014,7 +2014,7 @@ msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:5 ../../library/os.rst:19 +#: ../../library/os.rst:1864 ../../library/os.rst:1993 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -2203,7 +2203,7 @@ msgid "" "`not following symlinks `." msgstr "" -#: ../../library/os.rst:7 +#: ../../library/os.rst:2037 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2245,7 +2245,7 @@ msgid "" "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:15 +#: ../../library/os.rst:2067 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." @@ -2339,7 +2339,7 @@ msgid "" "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:20 ../../library/os.rst:24 +#: ../../library/os.rst:2144 ../../library/os.rst:2178 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -2524,7 +2524,8 @@ msgstr "" msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:6 ../../library/os.rst:12 ../../library/os.rst:14 +#: ../../library/os.rst:2346 ../../library/os.rst:2368 +#: ../../library/os.rst:3157 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2579,7 +2580,8 @@ msgid "" "`replace`." msgstr "" -#: ../../library/os.rst:10 ../../library/os.rst:11 ../../library/os.rst:22 +#: ../../library/os.rst:2397 ../../library/os.rst:2418 +#: ../../library/os.rst:2435 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2625,7 +2627,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:9 +#: ../../library/os.rst:2453 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -2666,7 +2668,7 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:27 +#: ../../library/os.rst:2490 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." @@ -3399,7 +3401,7 @@ msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:23 +#: ../../library/os.rst:3100 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3425,7 +3427,7 @@ msgid "" "bytes in size." msgstr "" -#: ../../library/os.rst:6 +#: ../../library/os.rst:3137 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3480,7 +3482,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:29 +#: ../../library/os.rst:3196 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -3583,7 +3585,7 @@ msgid "" "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:88 +#: ../../library/os.rst:3295 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -3628,7 +3630,7 @@ msgid "" "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:50 +#: ../../library/os.rst:3356 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -3777,7 +3779,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:9 +#: ../../library/os.rst:3528 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -3796,7 +3798,7 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:9 +#: ../../library/os.rst:3544 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." @@ -3810,7 +3812,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:9 +#: ../../library/os.rst:3560 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -3834,7 +3836,7 @@ msgid "" "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:18 +#: ../../library/os.rst:3585 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -3910,7 +3912,7 @@ msgid "" "DLLs are loaded." msgstr "" -#: ../../library/os.rst:14 +#: ../../library/os.rst:3649 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -3992,7 +3994,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:43 +#: ../../library/os.rst:3717 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4127,7 +4129,7 @@ msgid "" "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:7 +#: ../../library/os.rst:3884 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "" @@ -4151,7 +4153,7 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:7 +#: ../../library/os.rst:3905 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "" @@ -4182,7 +4184,7 @@ msgstr "" msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:18 +#: ../../library/os.rst:3933 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4196,7 +4198,7 @@ msgstr "" msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:7 +#: ../../library/os.rst:3949 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4399,7 +4401,7 @@ msgid "" "`POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:7 ../../library/os.rst:77 +#: ../../library/os.rst:4102 ../../library/os.rst:4118 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4540,7 +4542,7 @@ msgid "" "are equivalent::" msgstr "" -#: ../../library/os.rst:54 +#: ../../library/os.rst:4222 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4641,13 +4643,13 @@ msgid "" "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:37 +#: ../../library/os.rst:4307 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." msgstr "" -#: ../../library/os.rst:39 +#: ../../library/os.rst:4309 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -4700,7 +4702,7 @@ msgid "" "code." msgstr "" -#: ../../library/os.rst:27 +#: ../../library/os.rst:4346 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." diff --git a/library/pathlib.po b/library/pathlib.po index e9b524c3e4..d6e449171d 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -585,7 +585,7 @@ msgid "" "inordinate amount of time." msgstr "" -#: ../../library/pathlib.rst:24 +#: ../../library/pathlib.rst:849 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." @@ -834,7 +834,7 @@ msgid "" "the given relative *pattern*::" msgstr "" -#: ../../library/pathlib.rst:11 +#: ../../library/pathlib.rst:1144 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." diff --git a/library/pdb.po b/library/pdb.po index a5d4dc51c2..48600b02e5 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-13 00:14+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -235,7 +235,7 @@ msgstr "" msgid "Example call to enable tracing with *skip*::" msgstr "" -#: ../../library/pdb.rst:22 +#: ../../library/pdb.rst:210 msgid "" "Raises an :ref:`auditing event ` ``pdb.Pdb`` with no arguments." msgstr "" diff --git a/library/pickle.po b/library/pickle.po index 84757fc6a0..5a33e98d77 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,8 +30,8 @@ msgstr "**原始碼:**\\ :source:`Lib/pickle.py`" msgid "" "The :mod:`pickle` module implements binary protocols for serializing and de-" "serializing a Python object structure. *\"Pickling\"* is the process " -"whereby a Python object hierarchy is converted into a byte stream, and *" -"\"unpickling\"* is the inverse operation, whereby a byte stream (from a :" +"whereby a Python object hierarchy is converted into a byte stream, and " +"*\"unpickling\"* is the inverse operation, whereby a byte stream (from a :" "term:`binary file` or :term:`bytes-like object`) is converted back into an " "object hierarchy. Pickling (and unpickling) is alternatively known as " "\"serialization\", \"marshalling,\" [#]_ or \"flattening\"; however, to " @@ -616,7 +616,7 @@ msgid "" "`pickle-restrict` for details." msgstr "" -#: ../../library/pickle.rst:10 +#: ../../library/pickle.rst:460 msgid "" "Raises an :ref:`auditing event ` ``pickle.find_class`` with " "arguments ``module``, ``name``." diff --git a/library/pkgutil.po b/library/pkgutil.po index a9977c78fc..65992f17d2 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-08 00:15+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,10 +44,10 @@ msgstr "" #: ../../library/pkgutil.rst:28 msgid "" -"This will add to the package's ``__path__`` all subdirectories of " -"directories on :data:`sys.path` named after the package. This is useful if " -"one wants to distribute different parts of a single logical package as " -"multiple directories." +"For each directory on :data:`sys.path` that has a subdirectory that matches " +"the package name, add the subdirectory to the package's :attr:`__path__`. " +"This is useful if one wants to distribute different parts of a single " +"logical package as multiple directories." msgstr "" #: ../../library/pkgutil.rst:33 @@ -220,9 +220,9 @@ msgstr "" msgid "" "*onerror* is a function which gets called with one argument (the name of the " "package which was being imported) if any exception occurs while trying to " -"import a package. If no *onerror* function is supplied, :exc:`ImportError`" -"\\s are caught and ignored, while all other exceptions are propagated, " -"terminating the search." +"import a package. If no *onerror* function is supplied, :exc:" +"`ImportError`\\s are caught and ignored, while all other exceptions are " +"propagated, terminating the search." msgstr "" #: ../../library/pkgutil.rst:185 diff --git a/library/poplib.po b/library/poplib.po index a26c60bf93..bb280263b9 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -75,13 +75,13 @@ msgid "" "timeout setting will be used)." msgstr "" -#: ../../library/poplib.rst:7 ../../library/poplib.rst:13 +#: ../../library/poplib.rst:55 ../../library/poplib.rst:81 msgid "" "Raises an :ref:`auditing event ` ``poplib.connect`` with arguments " "``self``, ``host``, ``port``." msgstr "" -#: ../../library/poplib.rst:9 ../../library/poplib.rst:15 +#: ../../library/poplib.rst:57 ../../library/poplib.rst:83 msgid "" "Raises an :ref:`auditing event ` ``poplib.putline`` with arguments " "``self``, ``line``." diff --git a/library/pty.po b/library/pty.po index 9a098648b0..fc6a85f15a 100644 --- a/library/pty.po +++ b/library/pty.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,7 +114,7 @@ msgid "" "an exit code." msgstr "" -#: ../../library/pty.rst:34 +#: ../../library/pty.rst:77 msgid "" "Raises an :ref:`auditing event ` ``pty.spawn`` with argument " "``argv``." diff --git a/library/readline.po b/library/readline.po index 849a920c0c..09a4d5046f 100644 --- a/library/readline.po +++ b/library/readline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-03 00:22+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+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-" @@ -37,9 +37,10 @@ msgstr "" msgid "" "Readline keybindings may be configured via an initialization file, typically " "``.inputrc`` in your home directory. See `Readline Init File `_ in the GNU Readline " -"manual for information about the format and allowable constructs of that " -"file, and the capabilities of the Readline library in general." +"tiswww.cwru.edu/php/chet/readline/rluserman.html#Readline-Init-File>`_ in " +"the GNU Readline manual for information about the format and allowable " +"constructs of that file, and the capabilities of the Readline library in " +"general." msgstr "" #: ../../library/readline.rst:29 diff --git a/library/resource.po b/library/resource.po index 575eb8be6c..ad689555d4 100644 --- a/library/resource.po +++ b/library/resource.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+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-" @@ -121,7 +121,7 @@ msgstr "" msgid "VxWorks only supports setting :data:`RLIMIT_NOFILE`." msgstr "" -#: ../../library/resource.rst:20 +#: ../../library/resource.rst:94 msgid "" "Raises an :ref:`auditing event ` ``resource.setrlimit`` with " "arguments ``resource``, ``limits``." @@ -150,7 +150,7 @@ msgid "" "process." msgstr "" -#: ../../library/resource.rst:15 +#: ../../library/resource.rst:113 msgid "" "Raises an :ref:`auditing event ` ``resource.prlimit`` with " "arguments ``pid``, ``resource``, ``limits``." diff --git a/library/shutil.po b/library/shutil.po index e60e59db89..0896d5162b 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -92,7 +92,8 @@ msgid "" "link will be created instead of copying the file *src* points to." msgstr "" -#: ../../library/shutil.rst:17 ../../library/shutil.rst:18 +#: ../../library/shutil.rst:70 ../../library/shutil.rst:177 +#: ../../library/shutil.rst:208 msgid "" "Raises an :ref:`auditing event ` ``shutil.copyfile`` with " "arguments ``src``, ``dst``." @@ -137,7 +138,7 @@ msgid "" "platform, and it is asked to do so, it will do nothing and return." msgstr "" -#: ../../library/shutil.rst:11 ../../library/shutil.rst:20 +#: ../../library/shutil.rst:106 ../../library/shutil.rst:179 msgid "" "Raises an :ref:`auditing event ` ``shutil.copymode`` with " "arguments ``src``, ``dst``." @@ -200,7 +201,7 @@ msgstr "" msgid "Please see :data:`os.supports_follow_symlinks` for more information." msgstr "更多資訊請見 :data:`os.supports_follow_symlinks`\\ 。" -#: ../../library/shutil.rst:19 ../../library/shutil.rst:41 +#: ../../library/shutil.rst:153 ../../library/shutil.rst:210 msgid "" "Raises an :ref:`auditing event ` ``shutil.copystat`` with " "arguments ``src``, ``dst``." @@ -343,7 +344,7 @@ msgid "" "*src* tree." msgstr "" -#: ../../library/shutil.rst:43 +#: ../../library/shutil.rst:275 msgid "" "Raises an :ref:`auditing event ` ``shutil.copytree`` with " "arguments ``src``, ``dst``." @@ -405,7 +406,7 @@ msgid "" "exc_info`. Exceptions raised by *onerror* will not be caught." msgstr "" -#: ../../library/shutil.rst:31 +#: ../../library/shutil.rst:327 msgid "" "Raises an :ref:`auditing event ` ``shutil.rmtree`` with arguments " "``path``, ``dir_fd``." @@ -466,7 +467,7 @@ msgid "" "the expense of not copying any of the metadata." msgstr "" -#: ../../library/shutil.rst:21 +#: ../../library/shutil.rst:371 msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." @@ -515,7 +516,7 @@ msgstr "" msgid "See also :func:`os.chown`, the underlying function." msgstr "" -#: ../../library/shutil.rst:8 +#: ../../library/shutil.rst:412 msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." @@ -701,7 +702,7 @@ msgstr "" msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:32 +#: ../../library/shutil.rst:573 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -811,7 +812,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:13 +#: ../../library/shutil.rst:643 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." diff --git a/library/signal.po b/library/signal.po index 80c9ddb4d7..39d89fdbd4 100644 --- a/library/signal.po +++ b/library/signal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -493,7 +493,7 @@ msgid "" "performed; this can be used to check if the target thread is still running." msgstr "" -#: ../../library/signal.rst:16 +#: ../../library/signal.rst:433 msgid "" "Raises an :ref:`auditing event ` ``signal.pthread_kill`` with " "arguments ``thread_id``, ``signalnum``." diff --git a/library/smtplib.po b/library/smtplib.po index 7e08993dc7..164be2dbf3 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,7 +78,7 @@ msgid "" "keyword:`!with` statement exits. E.g.::" msgstr "" -#: ../../library/smtplib.rst:34 +#: ../../library/smtplib.rst:70 msgid "" "Raises an :ref:`auditing event ` ``smtplib.send`` with arguments " "``self``, ``data``." @@ -310,7 +310,7 @@ msgid "" "connection response." msgstr "" -#: ../../library/smtplib.rst:9 +#: ../../library/smtplib.rst:273 msgid "" "Raises an :ref:`auditing event ` ``smtplib.connect`` with " "arguments ``self``, ``host``, ``port``." diff --git a/library/socket.po b/library/socket.po index 0745035742..b21c6eb392 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-05 00:14+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -772,7 +772,7 @@ msgstr "" msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:22 +#: ../../library/socket.rst:637 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." @@ -1008,7 +1008,7 @@ msgid "" "be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:30 +#: ../../library/socket.rst:848 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -1052,7 +1052,7 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:7 ../../library/socket.rst:10 +#: ../../library/socket.rst:886 ../../library/socket.rst:902 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." @@ -1087,7 +1087,7 @@ msgid "" "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:4 +#: ../../library/socket.rst:912 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." @@ -1110,7 +1110,7 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:9 +#: ../../library/socket.rst:930 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." @@ -1135,7 +1135,7 @@ msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:11 +#: ../../library/socket.rst:947 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." @@ -1157,7 +1157,7 @@ msgid "" "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:5 +#: ../../library/socket.rst:969 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." @@ -1170,7 +1170,7 @@ msgid "" "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:5 +#: ../../library/socket.rst:980 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." @@ -1359,7 +1359,7 @@ msgid "" "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:4 +#: ../../library/socket.rst:1167 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." @@ -1501,7 +1501,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:4 +#: ../../library/socket.rst:1304 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." @@ -1553,7 +1553,7 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:8 ../../library/socket.rst:11 +#: ../../library/socket.rst:1345 ../../library/socket.rst:1365 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." @@ -1891,7 +1891,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:7 +#: ../../library/socket.rst:1720 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -1928,7 +1928,7 @@ msgstr "" msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/socket.rst:34 +#: ../../library/socket.rst:1763 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." diff --git a/library/sqlite3.po b/library/sqlite3.po index dc4b330103..31aaae07ad 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-23 00:15+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -335,13 +335,13 @@ msgstr "" msgid "Return type" msgstr "" -#: ../../library/sqlite3.rst:67 +#: ../../library/sqlite3.rst:330 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -#: ../../library/sqlite3.rst:68 +#: ../../library/sqlite3.rst:331 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." @@ -999,7 +999,7 @@ msgid "" "program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:17 +#: ../../library/sqlite3.rst:955 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." @@ -1016,7 +1016,7 @@ msgid "" "method." msgstr "" -#: ../../library/sqlite3.rst:5 +#: ../../library/sqlite3.rst:1006 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." diff --git a/library/subprocess.po b/library/subprocess.po index ee5573fd82..da742d1463 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-13 00:16+0000\n" +"POT-Creation-Date: 2023-04-24 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-" @@ -875,7 +875,7 @@ msgid "" "waited for. ::" msgstr "" -#: ../../library/subprocess.rst:334 +#: ../../library/subprocess.rst:707 msgid "" "Raises an :ref:`auditing event ` ``subprocess.Popen`` with " "arguments ``executable``, ``args``, ``cwd``, ``env``." diff --git a/library/sys.po b/library/sys.po index 418c474b7b..eca0748f39 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-06 00:14+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,7 +69,7 @@ msgid "" "mod:`ctypes`) should be completely removed or closely monitored." msgstr "" -#: ../../library/sys.rst:20 +#: ../../library/sys.rst:47 msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." @@ -255,7 +255,7 @@ msgid "" "by the time calling code examines the frame." msgstr "" -#: ../../library/sys.rst:14 +#: ../../library/sys.rst:208 msgid "" "Raises an :ref:`auditing event ` ``sys._current_frames`` with no " "arguments." @@ -273,7 +273,7 @@ msgstr "" msgid "This is most useful for statistical profiling." msgstr "" -#: ../../library/sys.rst:10 +#: ../../library/sys.rst:221 msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." @@ -482,7 +482,7 @@ msgid "" "excepthook``." msgstr "" -#: ../../library/sys.rst:10 +#: ../../library/sys.rst:386 msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." @@ -1174,7 +1174,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:6 +#: ../../library/sys.rst:803 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1526,7 +1526,7 @@ msgid "" "`." msgstr "" -#: ../../library/sys.rst:7 +#: ../../library/sys.rst:1059 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1954,7 +1954,7 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:21 +#: ../../library/sys.rst:1379 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." @@ -2164,7 +2164,7 @@ msgstr "" msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:78 +#: ../../library/sys.rst:1513 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." @@ -2193,13 +2193,13 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:7 +#: ../../library/sys.rst:1535 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" -#: ../../library/sys.rst:9 +#: ../../library/sys.rst:1537 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2534,7 +2534,7 @@ msgstr "" msgid "See also :func:`excepthook` which handles uncaught exceptions." msgstr "" -#: ../../library/sys.rst:32 +#: ../../library/sys.rst:1766 msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " "arguments ``hook``, ``unraisable``." diff --git a/library/syslog.po b/library/syslog.po index 781f1b9eb0..0f36aa242f 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+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-" @@ -67,7 +67,7 @@ msgid "" "func:`openlog` will be called with no arguments." msgstr "" -#: ../../library/syslog.rst:11 +#: ../../library/syslog.rst:47 msgid "" "Raises an :ref:`auditing event ` ``syslog.syslog`` with arguments " "``priority``, ``message``." @@ -97,7 +97,7 @@ msgid "" "for messages which do not have a facility explicitly encoded." msgstr "" -#: ../../library/syslog.rst:12 +#: ../../library/syslog.rst:68 msgid "" "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments " "``ident``, ``logoption``, ``facility``." @@ -122,7 +122,7 @@ msgid "" "`openlog` parameters are reset to defaults." msgstr "" -#: ../../library/syslog.rst:8 +#: ../../library/syslog.rst:84 msgid "" "Raises an :ref:`auditing event ` ``syslog.closelog`` with no " "arguments." @@ -138,7 +138,7 @@ msgid "" "and including *pri*." msgstr "" -#: ../../library/syslog.rst:8 +#: ../../library/syslog.rst:96 msgid "" "Raises an :ref:`auditing event ` ``syslog.setlogmask`` with " "argument ``maskpri``." diff --git a/library/telnetlib.po b/library/telnetlib.po index f39be0f5d4..f4d8457b37 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2022-05-22 02:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -194,7 +194,7 @@ msgstr "" msgid "Do not try to reopen an already connected instance." msgstr "" -#: ../../library/telnetlib.rst:8 +#: ../../library/telnetlib.rst:161 msgid "" "Raises an :ref:`auditing event ` ``telnetlib.Telnet.open`` with " "arguments ``self``, ``host``, ``port``." @@ -232,7 +232,7 @@ msgid "" "connection is closed." msgstr "" -#: ../../library/telnetlib.rst:5 +#: ../../library/telnetlib.rst:198 msgid "" "Raises an :ref:`auditing event ` ``telnetlib.Telnet.write`` with " "arguments ``self``, ``buffer``." diff --git a/library/tempfile.po b/library/tempfile.po index 6c9afc8090..3987ae5a1d 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -134,8 +134,8 @@ msgid "" msgstr "" "在不是 Posix 或 Cygwin 的平臺上,TemporaryFile 是 NamedTemporaryFile 的別名。" -#: ../../library/tempfile.rst:17 ../../library/tempfile.rst:33 -#: ../../library/tempfile.rst:42 +#: ../../library/tempfile.rst:68 ../../library/tempfile.rst:96 +#: ../../library/tempfile.rst:205 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkstemp`` with " "argument ``fullpath``." @@ -263,7 +263,7 @@ msgstr "" "被引發(:func:`cleanup` 呼叫、退出情境管理器、物件被作為垃圾回收或直譯器關閉" "等)。" -#: ../../library/tempfile.rst:13 ../../library/tempfile.rst:21 +#: ../../library/tempfile.rst:154 ../../library/tempfile.rst:231 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkdtemp`` with " "argument ``fullpath``." diff --git a/library/types.po b/library/types.po index 6ff6b17469..e44340f276 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-12 00:15+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -171,7 +171,7 @@ msgid "" "`lambda` expressions." msgstr "" -#: ../../library/types.rst:4 +#: ../../library/types.rst:119 msgid "" "Raises an :ref:`auditing event ` ``function.__new__`` with " "argument ``code``." @@ -205,7 +205,7 @@ msgstr "" msgid "The type for code objects such as returned by :func:`compile`." msgstr "" -#: ../../library/types.rst:5 +#: ../../library/types.rst:153 msgid "" "Raises an :ref:`auditing event ` ``code.__new__`` with arguments " "``code``, ``filename``, ``name``, ``argcount``, ``posonlyargcount``, " diff --git a/library/urllib.request.po b/library/urllib.request.po index a7b54bdff2..37a11d11ba 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -194,7 +194,7 @@ msgstr "" "的處理,以往是透過傳遞 dictionary(字典)參數給 ``urllib.urlopen`` 來取得的," "現在則可以透過 :class:`ProxyHandler` 物件來取得。" -#: ../../library/urllib.request.rst:61 +#: ../../library/urllib.request.rst:102 msgid "" "Raises an :ref:`auditing event ` ``urllib.Request`` with arguments " "``fullurl``, ``data``, ``headers``, ``method``." diff --git a/library/webbrowser.po b/library/webbrowser.po index e7482b0ab3..c37c00d9c8 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -109,7 +109,7 @@ msgid "" "is neither supported nor portable." msgstr "" -#: ../../library/webbrowser.rst:12 +#: ../../library/webbrowser.rst:80 msgid "" "Raises an :ref:`auditing event ` ``webbrowser.open`` with argument " "``url``." diff --git a/library/winreg.po b/library/winreg.po index 44a722e6c0..2696d71b79 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -79,7 +79,7 @@ msgid "" "exc:`OSError` exception is raised." msgstr "" -#: ../../library/winreg.rst:12 +#: ../../library/winreg.rst:56 msgid "" "Raises an :ref:`auditing event ` ``winreg.ConnectRegistry`` with " "arguments ``computer_name``, ``key``." @@ -126,14 +126,14 @@ msgstr "" msgid "If the key already exists, this function opens the existing key." msgstr "" -#: ../../library/winreg.rst:17 ../../library/winreg.rst:23 +#: ../../library/winreg.rst:80 ../../library/winreg.rst:112 msgid "" "Raises an :ref:`auditing event ` ``winreg.CreateKey`` with " "arguments ``key``, ``sub_key``, ``access``." msgstr "" -#: ../../library/winreg.rst:19 ../../library/winreg.rst:20 -#: ../../library/winreg.rst:25 +#: ../../library/winreg.rst:82 ../../library/winreg.rst:114 +#: ../../library/winreg.rst:324 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey/result`` with " "argument ``key``." @@ -172,7 +172,7 @@ msgid "" "removed. If the method fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/winreg.rst:14 ../../library/winreg.rst:24 +#: ../../library/winreg.rst:137 ../../library/winreg.rst:168 msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteKey`` with " "arguments ``key``, ``sub_key``, ``access``." @@ -205,7 +205,7 @@ msgstr "" msgid "*value* is a string that identifies the value to remove." msgstr "" -#: ../../library/winreg.rst:8 +#: ../../library/winreg.rst:185 msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteValue`` with " "arguments ``key``, ``value``." @@ -226,7 +226,7 @@ msgid "" "indicating, no more values are available." msgstr "" -#: ../../library/winreg.rst:12 +#: ../../library/winreg.rst:201 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumKey`` with arguments " "``key``, ``index``." @@ -292,7 +292,7 @@ msgid "" "for :meth:`SetValueEx`)" msgstr "" -#: ../../library/winreg.rst:28 +#: ../../library/winreg.rst:236 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumValue`` with " "arguments ``key``, ``index``." @@ -304,7 +304,7 @@ msgid "" "`REG_EXPAND_SZ`::" msgstr "" -#: ../../library/winreg.rst:7 +#: ../../library/winreg.rst:253 msgid "" "Raises an :ref:`auditing event ` ``winreg." "ExpandEnvironmentStrings`` with argument ``str``." @@ -368,7 +368,7 @@ msgid "" "specified in *file_name* is relative to the remote computer." msgstr "" -#: ../../library/winreg.rst:22 +#: ../../library/winreg.rst:299 msgid "" "Raises an :ref:`auditing event ` ``winreg.LoadKey`` with arguments " "``key``, ``sub_key``, ``file_name``." @@ -403,7 +403,7 @@ msgstr "" msgid "If the function fails, :exc:`OSError` is raised." msgstr "" -#: ../../library/winreg.rst:18 +#: ../../library/winreg.rst:322 msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey`` with arguments " "``key``, ``sub_key``, ``access``." @@ -431,7 +431,7 @@ msgid "" "nanoseconds since Jan 1, 1601." msgstr "" -#: ../../library/winreg.rst:22 +#: ../../library/winreg.rst:356 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryInfoKey`` with " "argument ``key``." @@ -457,7 +457,7 @@ msgid "" "`QueryValueEx` if possible." msgstr "" -#: ../../library/winreg.rst:15 ../../library/winreg.rst:21 +#: ../../library/winreg.rst:375 ../../library/winreg.rst:400 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryValue`` with " "arguments ``key``, ``sub_key``, ``value_name``." @@ -513,7 +513,7 @@ msgstr "" msgid "This function passes ``NULL`` for *security_attributes* to the API." msgstr "" -#: ../../library/winreg.rst:21 +#: ../../library/winreg.rst:425 msgid "" "Raises an :ref:`auditing event ` ``winreg.SaveKey`` with arguments " "``key``, ``file_name``." @@ -559,7 +559,7 @@ msgid "" "`KEY_SET_VALUE` access." msgstr "" -#: ../../library/winreg.rst:24 ../../library/winreg.rst:26 +#: ../../library/winreg.rst:453 ../../library/winreg.rst:483 msgid "" "Raises an :ref:`auditing event ` ``winreg.SetValue`` with " "arguments ``key``, ``sub_key``, ``type``, ``value``." @@ -616,7 +616,7 @@ msgid "" "subkeys." msgstr "" -#: ../../library/winreg.rst:14 +#: ../../library/winreg.rst:501 msgid "" "Raises an :ref:`auditing event ` ``winreg.DisableReflectionKey`` " "with argument ``key``." @@ -631,7 +631,7 @@ msgid "" "Restoring reflection for a key does not affect reflection of any subkeys." msgstr "" -#: ../../library/winreg.rst:11 +#: ../../library/winreg.rst:516 msgid "" "Raises an :ref:`auditing event ` ``winreg.EnableReflectionKey`` " "with argument ``key``." @@ -645,7 +645,7 @@ msgstr "" msgid "Returns ``True`` if reflection is disabled." msgstr "" -#: ../../library/winreg.rst:11 +#: ../../library/winreg.rst:531 msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryReflectionKey`` " "with argument ``key``." @@ -821,8 +821,8 @@ msgstr "" #: ../../library/winreg.rst:689 msgid "" -"Null-terminated string containing references to environment variables (``" -"%PATH%``)." +"Null-terminated string containing references to environment variables " +"(``%PATH%``)." msgstr "" #: ../../library/winreg.rst:694 @@ -936,7 +936,7 @@ msgid "" "underlying Win32 handle to exist beyond the lifetime of the handle object." msgstr "" -#: ../../library/winreg.rst:11 +#: ../../library/winreg.rst:784 msgid "" "Raises an :ref:`auditing event ` ``winreg.PyHKEY.Detach`` with " "argument ``key``." diff --git a/reference/datamodel.po b/reference/datamodel.po index e6907e9588..ca384d90a6 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-12 00:15+0000\n" +"POT-Creation-Date: 2023-04-24 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-" @@ -1944,7 +1944,7 @@ msgid "" "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:16 +#: ../../reference/datamodel.rst:1638 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -1970,7 +1970,7 @@ msgid "" "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:9 +#: ../../reference/datamodel.rst:1655 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -1990,7 +1990,7 @@ msgid "" "object." msgstr "" -#: ../../reference/datamodel.rst:4 +#: ../../reference/datamodel.rst:1667 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." diff --git a/using/cmdline.po b/using/cmdline.po index 7b9a97d13a..de9418ac7e 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-17 00:16+0000\n" +"POT-Creation-Date: 2023-04-24 00:16+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-" @@ -118,7 +118,7 @@ msgid "" "modules)." msgstr "" -#: ../../using/cmdline.rst:10 +#: ../../using/cmdline.rst:73 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_command`` with " "argument ``command``." @@ -177,7 +177,7 @@ msgid "" "execution as a script. An example is the :mod:`timeit` module::" msgstr "" -#: ../../using/cmdline.rst:39 +#: ../../using/cmdline.rst:115 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_module`` with " "argument ``module-name``." @@ -216,7 +216,7 @@ msgid "" "path`." msgstr "" -#: ../../using/cmdline.rst:8 +#: ../../using/cmdline.rst:140 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " "arguments." @@ -258,7 +258,7 @@ msgid "" "too." msgstr "" -#: ../../using/cmdline.rst:22 +#: ../../using/cmdline.rst:167 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_file`` with " "argument ``filename``." @@ -875,7 +875,7 @@ msgid "" "file." msgstr "" -#: ../../using/cmdline.rst:8 +#: ../../using/cmdline.rst:665 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_startup`` with " "argument ``filename``." diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 656b33d763..1c3730a564 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 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-" @@ -187,7 +187,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:174 msgid "" "Hosting of the Python bug tracker is kindly provided by `Upfront Systems " -"`__ of Stellenbosch, South Africa. Martin " +"`__ of Stellenbosch, South Africa. Martin " "von Löwis put a lot of effort into importing existing bugs and patches from " "SourceForge; his scripts for this import operation are at ``https://svn." "python.org/view/tracker/importer/`` and may be useful to other projects " @@ -1028,9 +1028,9 @@ msgstr "" #: ../../whatsnew/2.6.rst:920 msgid "" -"Python 3.0 makes this unambiguous by replacing the comma with the word \"as" -"\". To catch an exception and store the exception object in the variable " -"``exc``, you must write::" +"Python 3.0 makes this unambiguous by replacing the comma with the word " +"\"as\". To catch an exception and store the exception object in the " +"variable ``exc``, you must write::" msgstr "" #: ../../whatsnew/2.6.rst:929 @@ -1454,10 +1454,10 @@ msgstr "" #: ../../whatsnew/2.6.rst:1337 msgid "" -"The :func:`int` and :func:`long` builtins will now accept the \"0o\" and \"0b" -"\" prefixes when base-8 or base-2 are requested, or when the *base* argument " -"is zero (signalling that the base used should be determined from the " -"string)::" +"The :func:`int` and :func:`long` builtins will now accept the \"0o\" and " +"\"0b\" prefixes when base-8 or base-2 are requested, or when the *base* " +"argument is zero (signalling that the base used should be determined from " +"the string)::" msgstr "" #: ../../whatsnew/2.6.rst:1355 @@ -1709,8 +1709,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:1598 msgid "" "Many floating-point features were added. The :func:`float` function will " -"now turn the string ``nan`` into an IEEE 754 Not A Number value, and ``" -"+inf`` and ``-inf`` into positive or negative infinity. This works on any " +"now turn the string ``nan`` into an IEEE 754 Not A Number value, and " +"``+inf`` and ``-inf`` into positive or negative infinity. This works on any " "platform with IEEE 754 semantics. (Contributed by Christian Heimes; :issue:" "`1635`.)" msgstr "" @@ -2617,8 +2617,8 @@ msgid "" "The :func:`setitimer` and :func:`getitimer` functions have also been added " "(where they're available). :func:`setitimer` allows setting interval timers " "that will cause a signal to be delivered to the process after a specified " -"time, measured in wall-clock time, consumed process time, or combined process" -"+system time. (Contributed by Guilherme Polo; :issue:`2240`.)" +"time, measured in wall-clock time, consumed process time, or combined " +"process+system time. (Contributed by Guilherme Polo; :issue:`2240`.)" msgstr "" #: ../../whatsnew/2.6.rst:2348 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 32c8745257..06c21377d2 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-04-24 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-" @@ -179,9 +179,9 @@ msgstr "" msgid "" "You can re-enable display of :exc:`DeprecationWarning` messages by running " "Python with the :option:`-Wdefault <-W>` (short form: :option:`-Wd <-W>`) " -"switch, or by setting the :envvar:`PYTHONWARNINGS` environment variable to ``" -"\"default\"`` (or ``\"d\"``) before running Python. Python code can also re-" -"enable them by calling ``warnings.simplefilter('default')``." +"switch, or by setting the :envvar:`PYTHONWARNINGS` environment variable to " +"``\"default\"`` (or ``\"d\"``) before running Python. Python code can also " +"re-enable them by calling ``warnings.simplefilter('default')``." msgstr "" #: ../../whatsnew/2.7.rst:165 @@ -2376,8 +2376,8 @@ msgid "" "ElementTree's code for converting trees to a string has been significantly " "reworked, making it roughly twice as fast in many cases. The :meth:" "`ElementTree.write() ` and :meth:" -"`Element.write` methods now have a *method* parameter that can be \"xml" -"\" (the default), \"html\", or \"text\". HTML mode will output empty " +"`Element.write` methods now have a *method* parameter that can be " +"\"xml\" (the default), \"html\", or \"text\". HTML mode will output empty " "elements as ```` instead of ````, and text mode will " "skip over elements and only output the text chunks. If you set the :attr:" "`tag` attribute of an element to ``None`` but leave its children in place, " @@ -2448,14 +2448,15 @@ msgstr "" #: ../../whatsnew/2.7.rst:2104 msgid "" "The latest release of the GNU Debugger, GDB 7, can be `scripted using Python " -"`__. When you " -"begin debugging an executable program P, GDB will look for a file named ``P-" -"gdb.py`` and automatically read it. Dave Malcolm contributed a :file:" -"`python-gdb.py` that adds a number of commands useful when debugging Python " -"itself. For example, ``py-up`` and ``py-down`` go up or down one Python " -"stack frame, which usually corresponds to several C stack frames. ``py-" -"print`` prints the value of a Python variable, and ``py-bt`` prints the " -"Python stack trace. (Added as a result of :issue:`8032`.)" +"`__. When you begin debugging an " +"executable program P, GDB will look for a file named ``P-gdb.py`` and " +"automatically read it. Dave Malcolm contributed a :file:`python-gdb.py` " +"that adds a number of commands useful when debugging Python itself. For " +"example, ``py-up`` and ``py-down`` go up or down one Python stack frame, " +"which usually corresponds to several C stack frames. ``py-print`` prints " +"the value of a Python variable, and ``py-bt`` prints the Python stack " +"trace. (Added as a result of :issue:`8032`.)" msgstr "" #: ../../whatsnew/2.7.rst:2116 @@ -2574,8 +2575,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:2202 msgid "" "New format codes: the :c:func:`PyFormat_FromString`, :c:func:" -"`PyFormat_FromStringV`, and :c:func:`PyErr_Format` functions now accept ``" -"%lld`` and ``%llu`` format codes for displaying C's :c:expr:`long long` " +"`PyFormat_FromStringV`, and :c:func:`PyErr_Format` functions now accept " +"``%lld`` and ``%llu`` format codes for displaying C's :c:expr:`long long` " "types. (Contributed by Mark Dickinson; :issue:`7228`.)" msgstr "" From 25114609a9adb535d5ed924394614d0bf4acd013 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 24 Apr 2023 20:40:02 +0800 Subject: [PATCH 11/14] feat(c-api/file): partially translate --- c-api/file.po | 54 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/c-api/file.po b/c-api/file.po index c8ba148311..47e0f111df 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -1,17 +1,17 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Ching-Lung Chuang, 2015 # Liang-Bo Wang , 2015 +# Matt Wang , 2022 msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" -"PO-Revision-Date: 2017-09-22 18:26+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"PO-Revision-Date: 2023-04-24 20:38+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -19,10 +19,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.2.2\n" #: ../../c-api/file.rst:6 msgid "File Objects" -msgstr "檔案(File)物件" +msgstr "檔案物件 (File Objects)" #: ../../c-api/file.rst:10 msgid "" @@ -35,8 +36,14 @@ msgid "" "reporting in the interpreter; third-party code is advised to access the :mod:" "`io` APIs instead." msgstr "" +"這些 API 是用於內建檔案物件的 Python 2 C API 的最小模擬 (minimal emulation)," +"它過去依賴於 C 標準函式庫對於緩衝 I/O (:c:expr:`FILE*`) 的支援。在 Python 3 " +"中,檔案和串流使用新的 :mod:`io` 模組,它在操作系統的低階無緩衝 I/O 上定義了" +"多個層級。下面描述的函式是這些新 API 的便捷 C 包裝器,主要用於直譯器中的內部" +"錯誤報告;建議第三方程式碼改為存取 :mod:`io` API。" #: ../../c-api/file.rst:22 +#, fuzzy msgid "" "Create a Python file object from the file descriptor of an already opened " "file *fd*. The arguments *name*, *encoding*, *errors* and *newline* can be " @@ -45,6 +52,10 @@ msgid "" "failure. For a more comprehensive description of the arguments, please refer " "to the :func:`io.open` function documentation." msgstr "" +"從已打開檔案 *fd* 的檔案描述器建立一個 Python 檔案物件。引數 *name*、" +"*encoding*、*errors* 和 *newline* 可以為 ``NULL`` 以使用預設值; *buffering* " +"可以是 *-1* 以使用預設值。 *name* 被忽略並保留以實作向後相容性。失敗時回傳 " +"``NULL``。有關引數的更全面描述,請參閱 :func:`io.open` 函式文檔。" #: ../../c-api/file.rst:31 msgid "" @@ -52,6 +63,8 @@ msgid "" "level file descriptors can produce various issues (such as unexpected " "ordering of data)." msgstr "" +"由於 Python 串流有自己的緩衝層,將它們與操作系統層級檔案描述器混合使用會產生" +"各種問題(例如資料的排序不符合預期)。" #: ../../c-api/file.rst:35 msgid "Ignore *name* attribute." @@ -65,8 +78,12 @@ msgid "" "integer, which is returned as the file descriptor value. Sets an exception " "and returns ``-1`` on failure." msgstr "" +"回傳與 *p* 關聯的檔案描述器作為 :c:expr:`int`。如果物件是整數,則回傳其值。如" +"果不是整數,則呼叫物件的 :meth:`~io.IOBase.fileno` 方法(如果存在);該方法必" +"須回傳一個整數,它作為檔案描述器值回傳。設定例外並在失敗時回傳 ``-1``。" #: ../../c-api/file.rst:52 +#, fuzzy msgid "" "Equivalent to ``p.readline([n])``, this function reads one line from the " "object *p*. *p* may be a file object or any object with a :meth:`~io.IOBase." @@ -78,18 +95,28 @@ msgid "" "regardless of length, but :exc:`EOFError` is raised if the end of the file " "is reached immediately." msgstr "" +"相當於 ``p.readline([n])``,這個函式從物件 *p* 中讀取一行。 *p* 可以是檔案對" +"像或任何具有 :meth:`~io.IOBase.readline` 方法的物件。如果 *n* 為 ``0``,則只" +"讀取一行,而不管該行的長度。如果 *n* 大於 ``0``,則不會從檔案中讀取超過 *n* " +"個位元組;可以回傳部分行。在這兩種情況下,如果立即到達檔案末尾,則回傳一個空" +"字串。但是,如果 *n* 小於 ``0``,無論長度如何,都會讀取一行,但如果立即到達檔" +"案末尾,則會引發 :exc:`EOFError`。" #: ../../c-api/file.rst:65 msgid "" "Overrides the normal behavior of :func:`io.open_code` to pass its parameter " "through the provided handler." msgstr "" +"覆蓋 :func:`io.open_code` 的正常行為以透過提供的處理程式 (handler) 傳遞其參" +"數。" #: ../../c-api/file.rst:68 msgid "" "The handler is a function of type :c:expr:`PyObject *(\\*)(PyObject *path, " "void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`." msgstr "" +"處理程式是 :c:expr:`PyObject *(\\*)(PyObject *path, void *userData)` 型別的函" +"式,其中 *path* 保證為 :c:type:`PyUnicodeObject`。" #: ../../c-api/file.rst:71 msgid "" @@ -97,6 +124,8 @@ msgid "" "functions may be called from different runtimes, this pointer should not " "refer directly to Python state." msgstr "" +"*userData* 指標被傳遞到掛鉤函式 (hook function) 中。由於可能會從不同的運行時" +"間 (runtime) 呼叫掛鉤函式,因此該指標不應直接指向 Python 狀態。" #: ../../c-api/file.rst:75 msgid "" @@ -104,23 +133,31 @@ msgid "" "modules during its execution unless they are known to be frozen or available " "in ``sys.modules``." msgstr "" +"由於此掛鉤函式是在導入期間有意使用的,因此請避免在其執行期間導入新模組,除非" +"它們已知有被凍結或在 ``sys.modules`` 中可用。" #: ../../c-api/file.rst:79 +#, fuzzy msgid "" "Once a hook has been set, it cannot be removed or replaced, and later calls " "to :c:func:`PyFile_SetOpenCodeHook` will fail. On failure, the function " "returns -1 and sets an exception if the interpreter has been initialized." msgstr "" +"一旦設定了一個掛鉤函式,它就不能被刪除或替換,以後呼叫 :c:func:" +"`PyFile_SetOpenCodeHook` 將失敗。失敗時,函式回傳 -1 並在直譯器已初始化時設定" +"例外。" #: ../../c-api/file.rst:83 msgid "This function is safe to call before :c:func:`Py_Initialize`." -msgstr "" +msgstr "在 :c:func:`Py_Initialize` 之前呼叫此函式是安全的。" #: ../../c-api/file.rst:85 msgid "" "Raises an :ref:`auditing event ` ``setopencodehook`` with no " "arguments." msgstr "" +"不帶引數地引發一個\\ :ref:`稽核事件 (auditing event ) ` " +"``setopencodehook``\\ 。" #: ../../c-api/file.rst:95 msgid "" @@ -129,6 +166,9 @@ msgid "" "instead of the :func:`repr`. Return ``0`` on success or ``-1`` on failure; " "the appropriate exception will be set." msgstr "" +"將物件 *obj* 寫入檔案物件 *p*。 *flags* 唯一支援的旗標是 :const:" +"`Py_PRINT_RAW`;如果有給定,則寫入物件的 :func:`str` 而不是 :func:`repr`。在" +"成功回傳 ``0`` 或在失敗回傳 ``-1``;將設定適當的例外。" #: ../../c-api/file.rst:103 msgid "" From 7e430e699783f1f301e640dfb5a576be985dd86e Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 24 Apr 2023 20:49:32 +0800 Subject: [PATCH 12/14] feat(c-api/init): partially translate --- c-api/init.po | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/c-api/init.po b/c-api/init.po index 9699096b64..19bb117e99 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -3,12 +3,13 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Adrian Liaw , 2018 msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" -"PO-Revision-Date: 2018-05-23 14:06+0000\n" +"POT-Creation-Date: 2023-03-16 00:18+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-" "tw)\n" @@ -17,6 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.2.2\n" #: ../../c-api/init.rst:8 msgid "Initialization, Finalization, and Threads" @@ -200,7 +202,7 @@ msgstr "" #: ../../c-api/init.rst:90 msgid "Set by the :option:`-b` option." -msgstr "" +msgstr "由 :option:`-b` 選項設定。" #: ../../c-api/init.rst:94 msgid "" @@ -212,7 +214,7 @@ msgstr "" msgid "" "Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment " "variable." -msgstr "" +msgstr "由 :option:`-d` 選項與 :envvar:`PYTHONDEBUG` 環境變數設定。" #: ../../c-api/init.rst:102 msgid "" @@ -225,6 +227,7 @@ msgid "" "Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` " "environment variable." msgstr "" +"由 :option:`-B` 選項與 :envvar:`PYTHONDONTWRITEBYTECODE` 環境變數設定。" #: ../../c-api/init.rst:110 msgid "" @@ -241,6 +244,7 @@ msgid "" "Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to " "a non-empty string." msgstr "" +"如果環境變數 :envvar:`PYTHONHASHSEED` 被設定為一個非空字串則設為 ``1``。" #: ../../c-api/init.rst:120 msgid "" @@ -256,7 +260,7 @@ msgstr "" #: ../../c-api/init.rst:128 msgid "Set by the :option:`-E` and :option:`-I` options." -msgstr "" +msgstr "由 :option:`-E` 與 :option:`-I` 選項設定。" #: ../../c-api/init.rst:132 msgid "" @@ -269,11 +273,11 @@ msgstr "" msgid "" "Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment " "variable." -msgstr "" +msgstr "由 :option:`-i` 選項與 :envvar:`PYTHONINSPECT` 環境變數設定。" #: ../../c-api/init.rst:141 msgid "Set by the :option:`-i` option." -msgstr "" +msgstr "由 :option:`-i` 選項設定。" #: ../../c-api/init.rst:145 msgid "" @@ -283,7 +287,7 @@ msgstr "" #: ../../c-api/init.rst:148 msgid "Set by the :option:`-I` option." -msgstr "" +msgstr "由 :option:`-i` 選項設定。" #: ../../c-api/init.rst:154 msgid "" @@ -297,6 +301,8 @@ msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable is set to a non-empty string." msgstr "" +"如果環境變數 :envvar:`PYTHONLEGACYWINDOWSFSENCODING` 被設定為一個非空字串則設" +"為 ``1``。" #: ../../c-api/init.rst:161 msgid "See :pep:`529` for more details." @@ -332,7 +338,7 @@ msgstr "" #: ../../c-api/init.rst:184 msgid "Set by the :option:`-S` option." -msgstr "" +msgstr "由 :option:`-S` 選項設定。" #: ../../c-api/init.rst:188 msgid "" @@ -345,12 +351,14 @@ msgid "" "Set by the :option:`-s` and :option:`-I` options, and the :envvar:" "`PYTHONNOUSERSITE` environment variable." msgstr "" +"由 :option:`-s` 選項、:option:`-l` 選項與 :envvar:`PYTHONNOUSERSITE` 環境變數" +"設定。" #: ../../c-api/init.rst:196 msgid "" "Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment " "variable." -msgstr "" +msgstr "由 :option:`-O` 選項與 :envvar:`PYTHONOPTIMIZE` 環境變數設定。" #: ../../c-api/init.rst:201 msgid "" @@ -359,7 +367,7 @@ msgstr "" #: ../../c-api/init.rst:203 msgid "Set by the :option:`-q` option." -msgstr "" +msgstr "由 :option:`-q` 選項設定。" #: ../../c-api/init.rst:209 msgid "Force the stdout and stderr streams to be unbuffered." @@ -369,7 +377,7 @@ msgstr "" msgid "" "Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` " "environment variable." -msgstr "" +msgstr "由 :option:`-u` 選項與 :envvar:`PYTHONUNBUFFERED` 環境變數設定。" #: ../../c-api/init.rst:216 msgid "" @@ -383,7 +391,7 @@ msgstr "" msgid "" "Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment " "variable." -msgstr "" +msgstr "由 :option:`-v` 選項與 :envvar:`PYTHONVERBOSE` 環境變數設定。" #: ../../c-api/init.rst:226 msgid "Initializing and finalizing the interpreter" @@ -1030,7 +1038,7 @@ msgstr "" #: ../../c-api/init.rst:896 msgid "High-level API" -msgstr "" +msgstr "高階 API" #: ../../c-api/init.rst:898 msgid "" @@ -1072,7 +1080,7 @@ msgstr "" #: ../../c-api/init.rst:933 msgid "The function now does nothing." -msgstr "" +msgstr "此函式現在不會做任何事情。" #: ../../c-api/init.rst:936 msgid "" @@ -1241,7 +1249,7 @@ msgstr "" #: ../../c-api/init.rst:1095 msgid "Low-level API" -msgstr "" +msgstr "低階 API" #: ../../c-api/init.rst:1097 msgid "" @@ -1900,7 +1908,7 @@ msgstr "" #: ../../c-api/init.rst:1666 ../../c-api/init.rst:1680 msgid "The caller must hold the :term:`GIL`." -msgstr "" +msgstr "呼叫者必須持有 :term:`GIL`。" #: ../../c-api/init.rst:1671 msgid "" From 2142a2e34ba16362647d9da475beaccd2a9cd619 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 24 Apr 2023 21:37:46 +0800 Subject: [PATCH 13/14] chore: add some simple translation --- c-api/init.po | 2 +- distributing/index.po | 4 +-- faq/library.po | 5 ++-- howto/functional.po | 12 ++++---- library/argparse.po | 8 +++--- library/datetime.po | 67 +++++++++++++++++++++++-------------------- library/gc.po | 28 +++++++----------- library/marshal.po | 27 +++++++++-------- library/socket.po | 30 +++++++++---------- using/cmdline.po | 6 ++-- 10 files changed, 92 insertions(+), 97 deletions(-) diff --git a/c-api/init.po b/c-api/init.po index 19bb117e99..bfd20c81a9 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -351,7 +351,7 @@ msgid "" "Set by the :option:`-s` and :option:`-I` options, and the :envvar:" "`PYTHONNOUSERSITE` environment variable." msgstr "" -"由 :option:`-s` 選項、:option:`-l` 選項與 :envvar:`PYTHONNOUSERSITE` 環境變數" +"由 :option:`-s` 選項、:option:`-I` 選項與 :envvar:`PYTHONNOUSERSITE` 環境變數" "設定。" #: ../../c-api/init.rst:196 diff --git a/distributing/index.po b/distributing/index.po index 1bbe497dde..87f43ab0fa 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -19,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 2.4.3\n" +"X-Generator: Poedit 3.2.2\n" #: ../../distributing/index.rst:5 msgid "Distributing Python Modules" @@ -82,7 +82,7 @@ msgid "" "open source licensed packages made available for use by other Python users" msgstr "" "`Python 套件索引 (Python Package Index) `__ 是開源授權套件" -"的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用。" +"的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用" #: ../../distributing/index.rst:37 msgid "" diff --git a/faq/library.po b/faq/library.po index 34fd7f51b3..5660463066 100644 --- a/faq/library.po +++ b/faq/library.po @@ -1038,7 +1038,7 @@ msgid "" "values, so you're going to have to check what's returned on your system." msgstr "" "為防止 TCP 連接阻塞,可以將 socket 設定為非阻塞模式。然後當你執行 :meth:" -"`socket.connect` 時,你要么立即連接(不太可能),要么得到一個例外,其中包含錯" +"`socket.connect` 時,你要麼立即連接(不太可能),要麼得到一個例外,其中包含錯" "誤號 ``.errno``。 ``errno.EINPROGRESS`` 表示連接正在進行中,但尚未完成。不同" "的作業系統將回傳不同的值,因此你將不得不檢查系統回傳的內容。" @@ -1057,7 +1057,6 @@ msgstr "" "select` 檢查它是否可寫。" #: ../../faq/library.rst:780 -#, fuzzy msgid "" "The :mod:`asyncio` module provides a general purpose single-threaded and " "concurrent asynchronous library, which can be used for writing non-blocking " @@ -1065,7 +1064,7 @@ msgid "" "popular and feature-rich alternative." msgstr "" ":mod:`asyncio` 模組提供了一個通用的單執行緒並發非同步函式庫,可用於編寫非阻塞" -"網路程式碼。第三方`Twisted `_ 函式庫是一種流" +"網路程式碼。第三方 `Twisted `_ 函式庫是一種流" "行且功能豐富的替代方案。" #: ../../faq/library.rst:788 diff --git a/howto/functional.po b/howto/functional.po index 4c23d8fa4f..15e07c0c89 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -1330,12 +1330,12 @@ msgstr "" #: ../../howto/functional.rst:1224 msgid "https://en.wikipedia.org/wiki/Coroutine: Entry for coroutines." -msgstr "" +msgstr "https://en.wikipedia.org/wiki/Coroutine: Coroutines 的條目。" #: ../../howto/functional.rst:1226 msgid "" "https://en.wikipedia.org/wiki/Currying: Entry for the concept of currying." -msgstr "" +msgstr "https://en.wikipedia.org/wiki/Currying: currying 概念的條目。" #: ../../howto/functional.rst:1229 msgid "Python-specific" @@ -1359,19 +1359,19 @@ msgstr "" #: ../../howto/functional.rst:1244 msgid "Python documentation" -msgstr "" +msgstr "Python 說明文件" #: ../../howto/functional.rst:1246 msgid "Documentation for the :mod:`itertools` module." -msgstr "" +msgstr ":mod:`itertools` 模組的說明文件。" #: ../../howto/functional.rst:1248 msgid "Documentation for the :mod:`functools` module." -msgstr "" +msgstr ":mod:`functools` 模組的說明文件。" #: ../../howto/functional.rst:1250 msgid "Documentation for the :mod:`operator` module." -msgstr "" +msgstr ":mod:`operator` 模組的說明文件。" #: ../../howto/functional.rst:1252 msgid ":pep:`289`: \"Generator Expressions\"" diff --git a/library/argparse.po b/library/argparse.po index d5650e791d..6974392476 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -173,7 +173,7 @@ msgstr "" #: ../../library/argparse.rst:70 msgid ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" -msgstr "" +msgstr ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" #: ../../library/argparse.rst:71 msgid "required_" @@ -199,7 +199,7 @@ msgstr "" msgid "" ":class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable " "function" -msgstr "" +msgstr ":class:`int`、:class:`float`、``argparse.FileType('w')`` 或可呼叫的函式" #: ../../library/argparse.rst:77 msgid "Example" @@ -233,7 +233,7 @@ msgstr "" #: ../../library/argparse.rst:134 msgid "Creating a parser" -msgstr "" +msgstr "建立一個剖析器" #: ../../library/argparse.rst:136 msgid "" @@ -272,7 +272,7 @@ msgstr "" #: ../../library/argparse.rst:168 msgid "Parsing arguments" -msgstr "" +msgstr "剖析引數" #: ../../library/argparse.rst:170 msgid "" diff --git a/library/datetime.po b/library/datetime.po index 365b04193e..d93b8b60b9 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -126,7 +126,7 @@ msgstr "常數" #: ../../library/datetime.rst:74 msgid "The :mod:`datetime` module exports the following constants:" -msgstr "" +msgstr ":mod:`datetime` 模組匯出以下常數:" #: ../../library/datetime.rst:78 msgid "" @@ -295,19 +295,19 @@ msgstr "" #: ../../library/datetime.rst:207 msgid "A millisecond is converted to 1000 microseconds." -msgstr "" +msgstr "一毫秒會被轉換為 1000 微秒。" #: ../../library/datetime.rst:208 msgid "A minute is converted to 60 seconds." -msgstr "" +msgstr "一分鐘會被轉換為 60 秒。" #: ../../library/datetime.rst:209 msgid "An hour is converted to 3600 seconds." -msgstr "" +msgstr "一小時會被轉換為 3600 秒。" #: ../../library/datetime.rst:210 msgid "A week is converted to 7 days." -msgstr "" +msgstr "一週會被轉換為 7 天。" #: ../../library/datetime.rst:212 msgid "" @@ -359,7 +359,7 @@ msgstr "" #: ../../library/datetime.rst:1057 ../../library/datetime.rst:1676 #: ../../library/datetime.rst:2278 msgid "Class attributes:" -msgstr "" +msgstr "類別屬性:" #: ../../library/datetime.rst:260 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." @@ -410,7 +410,7 @@ msgstr "``seconds``" #: ../../library/datetime.rst:284 msgid "Between 0 and 86399 inclusive" -msgstr "" +msgstr "在 0 到 86399 (含)之間" #: ../../library/datetime.rst:286 msgid "``microseconds``" @@ -418,7 +418,7 @@ msgstr "``microseconds``" #: ../../library/datetime.rst:286 msgid "Between 0 and 999999 inclusive" -msgstr "" +msgstr "在 0 到 999999 (含)之間" #: ../../library/datetime.rst:289 ../../library/datetime.rst:587 #: ../../library/datetime.rst:1130 @@ -582,11 +582,11 @@ msgstr "註解:" #: ../../library/datetime.rst:358 msgid "This is exact but may overflow." -msgstr "" +msgstr "這是精確的,但可能會溢位。" #: ../../library/datetime.rst:361 msgid "This is exact and cannot overflow." -msgstr "" +msgstr "這是精確的,且不會溢位。" #: ../../library/datetime.rst:364 msgid "Division by 0 raises :exc:`ZeroDivisionError`." @@ -652,7 +652,7 @@ msgstr "" #: ../../library/datetime.rst:422 ../../library/datetime.rst:633 #: ../../library/datetime.rst:1204 ../../library/datetime.rst:1804 msgid "Instance methods:" -msgstr "" +msgstr "實例方法:" #: ../../library/datetime.rst:426 msgid "" @@ -725,11 +725,11 @@ msgstr "" #: ../../library/datetime.rst:494 msgid "Return the current local date." -msgstr "" +msgstr "回傳目前的本地日期。" #: ../../library/datetime.rst:496 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." -msgstr "" +msgstr "這等同於 ``date.fromtimestamp(time.time())``。" #: ../../library/datetime.rst:500 msgid "" @@ -804,7 +804,7 @@ msgstr "" #: ../../library/datetime.rst:579 ../../library/datetime.rst:1086 msgid "Between 1 and 12 inclusive." -msgstr "" +msgstr "在 1 到 12 (含)之間。" #: ../../library/datetime.rst:584 ../../library/datetime.rst:1091 msgid "Between 1 and the number of days in the given month of the given year." @@ -855,7 +855,7 @@ msgstr "" #: ../../library/datetime.rst:614 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." -msgstr "" +msgstr "``timedelta.seconds`` 和 ``timedelta.microseconds`` 被忽略。" #: ../../library/datetime.rst:617 msgid "" @@ -898,7 +898,7 @@ msgstr "" msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." -msgstr "" +msgstr "回傳一個 :class:`time.struct_time`,如同 :func:`time.localtime` 所回傳。" #: ../../library/datetime.rst:652 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." @@ -984,6 +984,9 @@ msgstr "" #: ../../library/datetime.rst:728 ../../library/datetime.rst:1503 msgid "``d.ctime()`` is equivalent to::" msgstr "" +"``d.ctime()`` 等價於:\n" +"\n" +"::" #: ../../library/datetime.rst:732 msgid "" @@ -1018,7 +1021,7 @@ msgstr "" #: ../../library/datetime.rst:772 msgid "More examples of working with :class:`date`:" -msgstr "" +msgstr "更多 :class:`date` 的用法範例:" #: ../../library/datetime.rst:821 msgid ":class:`.datetime` Objects" @@ -1051,11 +1054,11 @@ msgstr "" #: ../../library/datetime.rst:838 msgid "``MINYEAR <= year <= MAXYEAR``," -msgstr "" +msgstr "``MINYEAR <= year <= MAXYEAR``, " #: ../../library/datetime.rst:839 msgid "``1 <= month <= 12``," -msgstr "" +msgstr "``1 <= month <= 12``," #: ../../library/datetime.rst:840 msgid "``1 <= day <= number of days in the given month and year``," @@ -1063,19 +1066,19 @@ msgstr "" #: ../../library/datetime.rst:841 ../../library/datetime.rst:1667 msgid "``0 <= hour < 24``," -msgstr "" +msgstr "``0 <= hour < 24``," #: ../../library/datetime.rst:842 ../../library/datetime.rst:1668 msgid "``0 <= minute < 60``," -msgstr "" +msgstr "``0 <= minute < 60``," #: ../../library/datetime.rst:843 ../../library/datetime.rst:1669 msgid "``0 <= second < 60``," -msgstr "" +msgstr "``0 <= second < 60``," #: ../../library/datetime.rst:844 ../../library/datetime.rst:1670 msgid "``0 <= microsecond < 1000000``," -msgstr "" +msgstr "``0 <= microsecond < 1000000``," #: ../../library/datetime.rst:845 ../../library/datetime.rst:1671 msgid "``fold in [0, 1]``." @@ -1712,28 +1715,30 @@ msgstr "" #: ../../library/datetime.rst:1422 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" -msgstr "" +msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" #: ../../library/datetime.rst:1423 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" -msgstr "" +msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" #: ../../library/datetime.rst:1425 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" -msgstr "" +msgstr "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" #: ../../library/datetime.rst:1428 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" msgstr "" +"``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:" +"`microsecond` 不是 0" #: ../../library/datetime.rst:1430 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" -msgstr "" +msgstr "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" #: ../../library/datetime.rst:1440 msgid "" @@ -2040,7 +2045,7 @@ msgstr "" #: ../../library/datetime.rst:1907 msgid "Examples of Usage: :class:`.time`" -msgstr "" +msgstr "用法範例:\\ :class:`.time`" #: ../../library/datetime.rst:1909 msgid "Examples of working with a :class:`.time` object::" @@ -2455,7 +2460,7 @@ msgstr "``strptime``" #: ../../library/datetime.rst:2307 msgid "Usage" -msgstr "" +msgstr "用法" #: ../../library/datetime.rst:2307 msgid "Convert object to a string according to a given format" @@ -2472,11 +2477,11 @@ msgstr "" #: ../../library/datetime.rst:2309 msgid "Instance method" -msgstr "" +msgstr "實例方法" #: ../../library/datetime.rst:2309 msgid "Class method" -msgstr "" +msgstr "類別方法" #: ../../library/datetime.rst:2311 msgid "Method of" diff --git a/library/gc.po b/library/gc.po index 49df082dc3..c0dd800e9a 100644 --- a/library/gc.po +++ b/library/gc.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-24 00:16+0000\n" -"PO-Revision-Date: 2022-10-01 14:57+0800\n" +"PO-Revision-Date: 2023-04-24 21:25+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -20,7 +20,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1.1\n" +"X-Generator: Poedit 3.2.2\n" #: ../../library/gc.rst:2 msgid ":mod:`gc` --- Garbage Collector interface" @@ -291,6 +291,8 @@ msgid "" "Freeze all the objects tracked by the garbage collector; move them to a " "permanent generation and ignore them in all the future collections." msgstr "" +"凍結 (freeze) 垃圾回收器所追蹤的所有物件;將它們移至永久代並忽略所有未來的收" +"集動作。" #: ../../library/gc.rst:212 msgid "" @@ -303,6 +305,12 @@ msgid "" "early in the parent process, ``gc.freeze()`` right before ``fork()``, and " "``gc.enable()`` early in child processes." msgstr "" +"如果一個行程將在沒有 ``exec()`` 的情況下進行 ``fork()``,避免子行程中不必要的" +"寫入時複製將最大化記憶體共享並減少整體記憶體使用。這需要避免在父行程的記憶體" +"頁面中建立已釋放的「漏洞」,並確保子行程中的 GC 收集不會觸及源自父行程的長壽" +"命物件的 ``gc_refs`` 計數器。要實現這兩個目標,請在父行程的早期呼叫 ``gc." +"disable()``,在 ``fork()`` 之前呼叫 ``gc.freeze()``,並儘早在子行程中呼叫 " +"``gc.enable()``。" #: ../../library/gc.rst:226 msgid "" @@ -471,19 +479,3 @@ msgid "" msgstr "" "要印出記憶體流失程式之相關資訊時,回收器所需的除錯旗標。(等同於 " "``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | DEBUG_SAVEALL``)。" - -#~ msgid "" -#~ "Freeze all the objects tracked by gc - move them to a permanent " -#~ "generation and ignore all the future collections. This can be used before " -#~ "a POSIX fork() call to make the gc copy-on-write friendly or to speed up " -#~ "collection. Also collection before a POSIX fork() call may free pages for " -#~ "future allocation which can cause copy-on-write too so it's advised to " -#~ "disable gc in parent process and freeze before fork and enable gc in " -#~ "child process." -#~ msgstr "" -#~ "凍結 (freeze) 垃圾回收器所追蹤的所有物件 —— 將它們移至永久代並忽略所有未來" -#~ "的收集動作。這可以在呼叫 POSIX fork() 之前使用以便寫入時複製 (copy-on-" -#~ "write) 或加速回收。且在 POSIX fork() 呼叫之前的回收也可以釋放分頁 " -#~ "(page) ,以供未來可能導致寫入時複製的記憶體分配來使用,因此建議在父行程 " -#~ "(parent process) 中停用垃圾回收器並在 fork 之前凍結,在子行程中則建議啟用" -#~ "垃圾回收器。" diff --git a/library/marshal.po b/library/marshal.po index 94f0bee797..158c42b8d1 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-24 00:16+0000\n" -"PO-Revision-Date: 2021-12-15 12:53+0800\n" +"PO-Revision-Date: 2023-04-24 21:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -20,7 +20,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.0.1\n" +"X-Generator: Poedit 3.2.2\n" #: ../../library/marshal.rst:2 msgid ":mod:`marshal` --- Internal Python object serialization" @@ -90,9 +90,9 @@ msgstr "" "(bytearray)、元組 (tuple)、list、集合 (set)、凍結集合 (frozenset)、" "dictionary 和程式碼物件,需要了解的一點是元組、list、集合、凍結集合和 " "dictionary 只在其所包含的值也屬於這些型別時才會支援。單例 (singleton) 物件 :" -"const:`None`\\ 、\\ :const:`Ellipsis` 和 :exc:`StopIteration` 也可以被 " -"marshal 和 unmarshal。對於 *version* 低於 3 的格式,遞迴 list、集合和 " -"dictionary 無法被寫入(見下文)。" +"const:`None`、:const:`Ellipsis` 和 :exc:`StopIteration` 也可以被 marshal 和 " +"unmarshal。對於 *version* 低於 3 的格式,遞迴 list、集合和 dictionary 無法被" +"寫入(見下文)。" #: ../../library/marshal.rst:51 msgid "" @@ -136,7 +136,7 @@ msgid "" "``value``, ``version``." msgstr "" "引發一個附帶引數 ``value`` 與 ``version`` 的\\ :ref:`稽核事件 (auditing " -"event) ` ``marshal.dumps``\\ 。" +"event) ` ``marshal.dumps``。" #: ../../library/marshal.rst:74 msgid "" @@ -153,16 +153,15 @@ msgstr "" msgid "" "Raises an :ref:`auditing event ` ``marshal.load`` with no " "arguments." -msgstr "" -"引發一個沒有附帶引數的\\ :ref:`稽核事件 ` ``marshal.load``\\ 。" +msgstr "引發一個沒有附帶引數的\\ :ref:`稽核事件 ` ``marshal.load``。" #: ../../library/marshal.rst:83 msgid "" "If an object containing an unsupported type was marshalled with :func:" "`dump`, :func:`load` will substitute ``None`` for the unmarshallable type." msgstr "" -"如果透過 :func:`dump` marshal 了一個包含不支援型別的物件,\\ :func:`load` 會" -"將不可 marshal 的型別替換為 ``None``\\ 。" +"如果透過 :func:`dump` marshal 了一個包含不支援型別的物件,:func:`load` 會將不" +"可 marshal 的型別替換為 ``None``。" #: ../../library/marshal.rst:88 msgid "" @@ -180,7 +179,7 @@ msgid "" msgstr "" "回傳將透過 ``dump(value, file)`` 來被寫入一個檔案的位元組串物件,其值必須是有" "支援的型別,如果值(或其包含的任一物件)為不支援的型別則會引發 :exc:" -"`ValueError`\\ 。" +"`ValueError`。" #: ../../library/marshal.rst:98 msgid "" @@ -195,8 +194,8 @@ msgid "" "bytes in the input are ignored." msgstr "" "將 :term:`bytes-like object` 轉換為一個值。如果找不到有效的值,則會引發 :exc:" -"`EOFError`\\ 、\\ :exc:`ValueError` 或 :exc:`TypeError`\\ 。輸入中額外的位元" -"組串會被忽略。" +"`EOFError`、:exc:`ValueError` 或 :exc:`TypeError`。輸入中額外的位元組串會被忽" +"略。" #: ../../library/marshal.rst:110 msgid "" @@ -204,7 +203,7 @@ msgid "" "``bytes``." msgstr "" "引發一個附帶引數 ``bytes`` 的\\ :ref:`稽核事件 ` ``marshal." -"loads``\\ 。" +"loads``。" #: ../../library/marshal.rst:114 msgid "" diff --git a/library/socket.po b/library/socket.po index b21c6eb392..129f1af24b 100644 --- a/library/socket.po +++ b/library/socket.po @@ -79,7 +79,7 @@ msgstr "" #: ../../library/socket.rst:43 msgid "Socket families" -msgstr "" +msgstr "Socket 系列家族" #: ../../library/socket.rst:45 msgid "" @@ -254,7 +254,7 @@ msgstr "" #: ../../library/socket.rst:151 msgid "NetBSD and DragonFlyBSD support added." -msgstr "" +msgstr "加入對 NetBSD 和 DragonFlyBSD 的支援。" #: ../../library/socket.rst:154 msgid "" @@ -308,7 +308,7 @@ msgstr ":ref:`適用 `:Linux 3.9 以上。" #: ../../library/socket.rst:183 msgid "See :manpage:`vsock(7)`" -msgstr "" +msgstr "請見 :manpage:`vsock(7)`" #: ../../library/socket.rst:187 msgid "" @@ -442,7 +442,7 @@ msgstr "例外" #: ../../library/socket.rst:263 msgid "A deprecated alias of :exc:`OSError`." -msgstr "" +msgstr "一個已棄用的 :exc:`OSError` 的別名。" #: ../../library/socket.rst:265 msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." @@ -557,7 +557,7 @@ msgstr "" #: ../../library/socket.rst:387 msgid "``TCP_NOTSENT_LOWAT`` was added." -msgstr "" +msgstr "新增 ``TCP_NOTSENT_LOWAT``。" #: ../../library/socket.rst:390 msgid "" @@ -736,7 +736,7 @@ msgstr "函式" #: ../../library/socket.rst:598 msgid "Creating sockets" -msgstr "" +msgstr "建立 sockets" #: ../../library/socket.rst:600 msgid "" @@ -784,7 +784,7 @@ msgstr "" #: ../../library/socket.rst:632 msgid "The CAN_BCM protocol was added." -msgstr "" +msgstr "新增 CAN_BCM 協定。" #: ../../library/socket.rst:635 ../../library/socket.rst:772 msgid "The returned socket is now non-inheritable." @@ -792,7 +792,7 @@ msgstr "" #: ../../library/socket.rst:638 msgid "The CAN_ISOTP protocol was added." -msgstr "" +msgstr "新增 CAN_ISOTP 協定。" #: ../../library/socket.rst:641 msgid "" @@ -809,11 +809,11 @@ msgstr "" #: ../../library/socket.rst:657 msgid "The CAN_J1939 protocol was added." -msgstr "" +msgstr "新增 CAN_J1939 協定。" #: ../../library/socket.rst:660 msgid "The IPPROTO_MPTCP protocol was added." -msgstr "" +msgstr "新增 IPPROTO_MPTCP 協定。" #: ../../library/socket.rst:665 msgid "" @@ -840,7 +840,7 @@ msgstr "" #: ../../library/socket.rst:679 msgid "Windows support added." -msgstr "" +msgstr "新增對 Windows 的支援。" #: ../../library/socket.rst:685 msgid "" @@ -954,7 +954,7 @@ msgstr "" #: ../../library/socket.rst:793 msgid "Other functions" -msgstr "" +msgstr "其他函式" #: ../../library/socket.rst:795 msgid "The :mod:`socket` module also offers various network-related services:" @@ -1386,7 +1386,7 @@ msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WAS #: ../../library/socket.rst:1173 ../../library/socket.rst:1200 #: ../../library/socket.rst:1217 msgid "Windows support was added." -msgstr "" +msgstr "增加對 Windows 的支援。" #: ../../library/socket.rst:1178 msgid "" @@ -1396,7 +1396,7 @@ msgstr "" #: ../../library/socket.rst:1181 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -msgstr "" +msgstr "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" #: ../../library/socket.rst:1182 msgid "name: ``ethernet_32770``" @@ -1458,7 +1458,7 @@ msgstr "" #: ../../library/socket.rst:1259 msgid "Socket Objects" -msgstr "" +msgstr "Socket 物件" #: ../../library/socket.rst:1261 msgid "" diff --git a/using/cmdline.po b/using/cmdline.po index de9418ac7e..f25361976b 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -49,7 +49,7 @@ msgstr "" #: ../../using/cmdline.rst:37 msgid "Interface options" -msgstr "" +msgstr "介面選項" #: ../../using/cmdline.rst:39 msgid "" @@ -307,7 +307,7 @@ msgstr "" #: ../../using/cmdline.rst:214 msgid "Print complete usage information and exit." -msgstr "" +msgstr "印出完整使用資訊並離開。" #: ../../using/cmdline.rst:221 msgid "Print the Python version number and exit. Example output could be:" @@ -319,7 +319,7 @@ msgstr "" #: ../../using/cmdline.rst:234 msgid "The ``-VV`` option." -msgstr "" +msgstr "``-VV`` 選項" #: ../../using/cmdline.rst:241 msgid "Miscellaneous options" From 8a37cceea55eb52dc488da6fe5bfd5f8672339bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 25 Apr 2023 00:22:35 +0000 Subject: [PATCH 14/14] sync with cpython 56d50dd9 --- c-api/file.po | 2 +- howto/argparse.po | 208 +++++++++-------- howto/descriptor.po | 63 +++-- library/argparse.po | 39 +++- library/asyncio-task.po | 176 +++++++------- library/dataclasses.po | 340 ++++++++++++++------------- library/optparse.po | 498 ++++++++++++++++++++++------------------ library/pkgutil.po | 5 +- library/sys.po | 73 +++--- using/windows.po | 4 +- 10 files changed, 770 insertions(+), 638 deletions(-) diff --git a/c-api/file.po b/c-api/file.po index 47e0f111df..362cf64a88 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -156,7 +156,7 @@ msgid "" "Raises an :ref:`auditing event ` ``setopencodehook`` with no " "arguments." msgstr "" -"不帶引數地引發一個\\ :ref:`稽核事件 (auditing event ) ` " +"不帶引數地引發一個\\ :ref:`稽核事件 (auditing event) ` " "``setopencodehook``\\ 。" #: ../../c-api/file.rst:95 diff --git a/howto/argparse.po b/howto/argparse.po index 54ab71668a..ed45cbc336 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-04-25 00:20+0000\n" "PO-Revision-Date: 2022-01-31 17:33+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -24,7 +24,7 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.0.1\n" -#: ../../howto/argparse.rst:3 +#: ../../howto/argparse.rst:5 msgid "Argparse Tutorial" msgstr "Argparse 教學" @@ -32,11 +32,11 @@ msgstr "Argparse 教學" msgid "author" msgstr "作者" -#: ../../howto/argparse.rst:5 +#: ../../howto/argparse.rst:7 msgid "Tshepang Lekhonkhobe" msgstr "Tshepang Lekhonkhobe" -#: ../../howto/argparse.rst:9 +#: ../../howto/argparse.rst:11 msgid "" "This tutorial is intended to be a gentle introduction to :mod:`argparse`, " "the recommended command-line parsing module in the Python standard library." @@ -44,39 +44,40 @@ msgstr "" "這個教學傾向簡介 Python 官方標準含式庫中推薦的命令列剖析模組 :mod:" "`argparse`。" -#: ../../howto/argparse.rst:14 +#: ../../howto/argparse.rst:16 +#, fuzzy msgid "" "There are two other modules that fulfill the same task, namely :mod:`getopt` " -"(an equivalent for :c:func:`getopt` from the C language) and the deprecated :" -"mod:`optparse`. Note also that :mod:`argparse` is based on :mod:`optparse`, " -"and therefore very similar in terms of usage." +"(an equivalent for ``getopt()`` from the C language) and the deprecated :mod:" +"`optparse`. Note also that :mod:`argparse` is based on :mod:`optparse`, and " +"therefore very similar in terms of usage." msgstr "" "另外兩個具有同樣功能的模組 :mod:`getopt`\\ (一個相等於 C 語言中的 :c:func:" "`getopt`\\ )以及被棄用的 :mod:`optparse`\\ 。而 :mod:`argparse` 也是根據 :" "mod:`optparse` 為基礎發展而來,因此有非常近似的使用方式。" -#: ../../howto/argparse.rst:22 +#: ../../howto/argparse.rst:24 msgid "Concepts" msgstr "概念" -#: ../../howto/argparse.rst:24 +#: ../../howto/argparse.rst:26 msgid "" "Let's show the sort of functionality that we are going to explore in this " "introductory tutorial by making use of the :command:`ls` command:" msgstr "藉由命令 :command:`ls` 的使用開始這些功能的介紹:" -#: ../../howto/argparse.rst:46 +#: ../../howto/argparse.rst:48 msgid "A few concepts we can learn from the four commands:" msgstr "我們可以從四個命令中可以學到的幾個概念:" -#: ../../howto/argparse.rst:48 +#: ../../howto/argparse.rst:50 msgid "" "The :command:`ls` command is useful when run without any options at all. It " "defaults to displaying the contents of the current directory." msgstr "" "命令 :command:`ls` 在執行時不用其他參數就可以顯示出當前目錄底下的內容。" -#: ../../howto/argparse.rst:51 +#: ../../howto/argparse.rst:53 msgid "" "If we want beyond what it provides by default, we tell it a bit more. In " "this case, we want it to display a different directory, ``pypy``. What we " @@ -93,7 +94,7 @@ msgstr "" "用方式是 ``cp SRC DEST``\\ 。第一個位置參數代表的是\\ *想要複製的目標*\\,第" "二個位置的參數代表的則是\\ *想要複製到的地方*\\ 。" -#: ../../howto/argparse.rst:60 +#: ../../howto/argparse.rst:62 msgid "" "Now, say we want to change behaviour of the program. In our example, we " "display more info for each file instead of just showing the file names. The " @@ -102,7 +103,7 @@ msgstr "" "現在我們想再增加一些,要顯示除了檔名之外更多的資訊。在這裡就可以選擇加上 ``-" "l`` 這個參數。" -#: ../../howto/argparse.rst:64 +#: ../../howto/argparse.rst:66 msgid "" "That's a snippet of the help text. It's very useful in that you can come " "across a program you have never used before, and can figure out how it works " @@ -111,28 +112,28 @@ msgstr "" "這是 help 文件的片段。對於以前從未使用過的程序來說非常有用,可以透過這些 " "help 文件來了解這些該怎麼使用。" -#: ../../howto/argparse.rst:70 +#: ../../howto/argparse.rst:72 msgid "The basics" msgstr "基本用法" -#: ../../howto/argparse.rst:72 +#: ../../howto/argparse.rst:74 msgid "Let us start with a very simple example which does (almost) nothing::" msgstr "" "我們以一個很簡單的例子開始下面的介紹:\n" "\n" "::" -#: ../../howto/argparse.rst:78 ../../howto/argparse.rst:186 -#: ../../howto/argparse.rst:207 +#: ../../howto/argparse.rst:80 ../../howto/argparse.rst:188 +#: ../../howto/argparse.rst:209 msgid "Following is a result of running the code:" msgstr "下面是運行這些代碼的結果:" -#: ../../howto/argparse.rst:95 ../../howto/argparse.rst:252 -#: ../../howto/argparse.rst:296 +#: ../../howto/argparse.rst:97 ../../howto/argparse.rst:254 +#: ../../howto/argparse.rst:298 msgid "Here is what is happening:" msgstr "接者是發生的情況:" -#: ../../howto/argparse.rst:97 +#: ../../howto/argparse.rst:99 msgid "" "Running the script without any options results in nothing displayed to " "stdout. Not so useful." @@ -140,7 +141,7 @@ msgstr "" "運行這個腳本而沒有給與任何參數時就不會顯示任何東西至標準輸出畫面上。這裡並不" "是這麼的有用。" -#: ../../howto/argparse.rst:100 +#: ../../howto/argparse.rst:102 msgid "" "The second one starts to display the usefulness of the :mod:`argparse` " "module. We have done almost nothing, but already we get a nice help message." @@ -148,7 +149,7 @@ msgstr "" "第二個我們呈現出了 :mod:`argparse` 模組的用處。我們幾乎沒有做什麼事情,但已經" "得到一個很好的幫助信息。" -#: ../../howto/argparse.rst:103 +#: ../../howto/argparse.rst:105 msgid "" "The ``--help`` option, which can also be shortened to ``-h``, is the only " "option we get for free (i.e. no need to specify it). Specifying anything " @@ -159,47 +160,50 @@ msgstr "" "的(意即,沒有必要在這個參數後加上任何數值)。如果指定其他參數給他會造成錯" "誤。也因為這樣,我們得到了一個免費的信息。" -#: ../../howto/argparse.rst:110 +#: ../../howto/argparse.rst:112 msgid "Introducing Positional arguments" msgstr "介紹位置參數" -#: ../../howto/argparse.rst:112 +#: ../../howto/argparse.rst:114 msgid "An example::" msgstr "" "例如:\n" "\n" "::" -#: ../../howto/argparse.rst:120 +#: ../../howto/argparse.rst:122 msgid "And running the code:" msgstr "運行這段代碼:" -#: ../../howto/argparse.rst:138 +#: ../../howto/argparse.rst:140 msgid "Here is what's happening:" msgstr "接者是發生的情況:" -#: ../../howto/argparse.rst:140 +#: ../../howto/argparse.rst:142 +#, fuzzy msgid "" -"We've added the :meth:`add_argument` method, which is what we use to specify " -"which command-line options the program is willing to accept. In this case, " -"I've named it ``echo`` so that it's in line with its function." +"We've added the :meth:`~ArgumentParser.add_argument` method, which is what " +"we use to specify which command-line options the program is willing to " +"accept. In this case, I've named it ``echo`` so that it's in line with its " +"function." msgstr "" "我們增加了 :meth:`add_argument` ,利用這個方法可以指名讓我們的程式接受哪些命" "令列參數。" -#: ../../howto/argparse.rst:144 +#: ../../howto/argparse.rst:146 msgid "Calling our program now requires us to specify an option." msgstr "現在呼叫我們的程序時需要指定一個參數選項。" -#: ../../howto/argparse.rst:146 +#: ../../howto/argparse.rst:148 +#, fuzzy msgid "" -"The :meth:`parse_args` method actually returns some data from the options " -"specified, in this case, ``echo``." +"The :meth:`~ArgumentParser.parse_args` method actually returns some data " +"from the options specified, in this case, ``echo``." msgstr "" "在這個例子中, :meth:`parse_args` 這個方法確實根據了 ``echo`` 這個選項回傳了" "資料。" -#: ../../howto/argparse.rst:149 +#: ../../howto/argparse.rst:151 msgid "" "The variable is some form of 'magic' that :mod:`argparse` performs for free " "(i.e. no need to specify which variable that value is stored in). You will " @@ -207,7 +211,7 @@ msgid "" "``echo``." msgstr "" -#: ../../howto/argparse.rst:154 +#: ../../howto/argparse.rst:156 msgid "" "Note however that, although the help display looks nice and all, it " "currently is not as helpful as it can be. For example we see that we got " @@ -221,18 +225,18 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:165 +#: ../../howto/argparse.rst:167 msgid "And we get:" msgstr "然後我們得到:" -#: ../../howto/argparse.rst:178 +#: ../../howto/argparse.rst:180 msgid "Now, how about doing something even more useful::" msgstr "" "現在來做一些更有用處的事情:\n" "\n" "::" -#: ../../howto/argparse.rst:196 +#: ../../howto/argparse.rst:198 msgid "" "That didn't go so well. That's because :mod:`argparse` treats the options we " "give it as strings, unless we tell it otherwise. So, let's tell :mod:" @@ -244,29 +248,29 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:217 +#: ../../howto/argparse.rst:219 msgid "" "That went well. The program now even helpfully quits on bad illegal input " "before proceeding." msgstr "" "這樣很順利。現在程序在開始之前會因為錯誤的輸入而回報有用的訊息並結束掉。" -#: ../../howto/argparse.rst:222 +#: ../../howto/argparse.rst:224 msgid "Introducing Optional arguments" msgstr "介紹選項參數" -#: ../../howto/argparse.rst:224 +#: ../../howto/argparse.rst:226 msgid "" "So far we have been playing with positional arguments. Let us have a look on " "how to add optional ones::" msgstr "" -#: ../../howto/argparse.rst:234 ../../howto/argparse.rst:280 -#: ../../howto/argparse.rst:396 ../../howto/argparse.rst:430 +#: ../../howto/argparse.rst:236 ../../howto/argparse.rst:282 +#: ../../howto/argparse.rst:398 ../../howto/argparse.rst:432 msgid "And the output:" msgstr "接者是結果:" -#: ../../howto/argparse.rst:254 +#: ../../howto/argparse.rst:256 msgid "" "The program is written so as to display something when ``--verbosity`` is " "specified and display nothing when not." @@ -274,26 +278,26 @@ msgstr "" "這個程式是寫成如果有指名 ``--verbosity`` 這個參數選項那才顯示些資訊,反之亦" "然。" -#: ../../howto/argparse.rst:257 +#: ../../howto/argparse.rst:259 msgid "" "To show that the option is actually optional, there is no error when running " "the program without it. Note that by default, if an optional argument isn't " -"used, the relevant variable, in this case :attr:`args.verbosity`, is given " +"used, the relevant variable, in this case ``args.verbosity``, is given " "``None`` as a value, which is the reason it fails the truth test of the :" "keyword:`if` statement." msgstr "" -#: ../../howto/argparse.rst:263 +#: ../../howto/argparse.rst:265 msgid "The help message is a bit different." msgstr "Help 訊息稍微有些不一樣。" -#: ../../howto/argparse.rst:265 +#: ../../howto/argparse.rst:267 msgid "" "When using the ``--verbosity`` option, one must also specify some value, any " "value." msgstr "當使用 ``--verbosity`` 參數選項時必須要指定一個數值。" -#: ../../howto/argparse.rst:268 +#: ../../howto/argparse.rst:270 msgid "" "The above example accepts arbitrary integer values for ``--verbosity``, but " "for our simple program, only two values are actually useful, ``True`` or " @@ -304,30 +308,30 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:298 +#: ../../howto/argparse.rst:300 msgid "" "The option is now more of a flag than something that requires a value. We " "even changed the name of the option to match that idea. Note that we now " "specify a new keyword, ``action``, and give it the value ``\"store_true\"``. " -"This means that, if the option is specified, assign the value ``True`` to :" -"data:`args.verbose`. Not specifying it implies ``False``." +"This means that, if the option is specified, assign the value ``True`` to " +"``args.verbose``. Not specifying it implies ``False``." msgstr "" -#: ../../howto/argparse.rst:305 +#: ../../howto/argparse.rst:307 msgid "" "It complains when you specify a value, in true spirit of what flags actually " "are." msgstr "" -#: ../../howto/argparse.rst:308 +#: ../../howto/argparse.rst:310 msgid "Notice the different help text." msgstr "注意不同的 help 文件。" -#: ../../howto/argparse.rst:312 +#: ../../howto/argparse.rst:314 msgid "Short options" msgstr "" -#: ../../howto/argparse.rst:314 +#: ../../howto/argparse.rst:316 msgid "" "If you are familiar with command line usage, you will notice that I haven't " "yet touched on the topic of short versions of the options. It's quite " @@ -338,135 +342,135 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:326 +#: ../../howto/argparse.rst:328 msgid "And here goes:" msgstr "" -#: ../../howto/argparse.rst:339 +#: ../../howto/argparse.rst:341 msgid "Note that the new ability is also reflected in the help text." msgstr "注意新的表示對於幫助文件也是一樣的" -#: ../../howto/argparse.rst:343 +#: ../../howto/argparse.rst:345 msgid "Combining Positional and Optional arguments" msgstr "現在結合位置與選項參數" -#: ../../howto/argparse.rst:345 +#: ../../howto/argparse.rst:347 msgid "Our program keeps growing in complexity::" msgstr "" "我們的程式成長的越來越複雜:\n" "\n" "::" -#: ../../howto/argparse.rst:360 +#: ../../howto/argparse.rst:362 msgid "And now the output:" msgstr "然後現在的輸出結果:" -#: ../../howto/argparse.rst:374 +#: ../../howto/argparse.rst:376 msgid "We've brought back a positional argument, hence the complaint." msgstr "" -#: ../../howto/argparse.rst:376 +#: ../../howto/argparse.rst:378 msgid "Note that the order does not matter." msgstr "注意現在的順序對於程式來說已經不再重要了." -#: ../../howto/argparse.rst:378 +#: ../../howto/argparse.rst:380 msgid "" "How about we give this program of ours back the ability to have multiple " "verbosity values, and actually get to use them::" msgstr "" -#: ../../howto/argparse.rst:412 +#: ../../howto/argparse.rst:414 msgid "" "These all look good except the last one, which exposes a bug in our program. " "Let's fix it by restricting the values the ``--verbosity`` option can " "accept::" msgstr "" -#: ../../howto/argparse.rst:448 +#: ../../howto/argparse.rst:450 msgid "" "Note that the change also reflects both in the error message as well as the " "help string." msgstr "" -#: ../../howto/argparse.rst:451 +#: ../../howto/argparse.rst:453 msgid "" "Now, let's use a different approach of playing with verbosity, which is " "pretty common. It also matches the way the CPython executable handles its " "own verbosity argument (check the output of ``python --help``)::" msgstr "" -#: ../../howto/argparse.rst:470 +#: ../../howto/argparse.rst:472 msgid "" "We have introduced another action, \"count\", to count the number of " "occurrences of specific options." msgstr "我們已經介紹過另一個操作 \"count\" 用來計算指定的選項出現的次數。" -#: ../../howto/argparse.rst:499 +#: ../../howto/argparse.rst:501 msgid "" "Yes, it's now more of a flag (similar to ``action=\"store_true\"``) in the " "previous version of our script. That should explain the complaint." msgstr "" -#: ../../howto/argparse.rst:502 +#: ../../howto/argparse.rst:504 msgid "It also behaves similar to \"store_true\" action." msgstr "" -#: ../../howto/argparse.rst:504 +#: ../../howto/argparse.rst:506 msgid "" "Now here's a demonstration of what the \"count\" action gives. You've " "probably seen this sort of usage before." msgstr "" "現在來秀一下 \"count\" 這個動作會給予什麼。你可能之前就有見過這種用法。" -#: ../../howto/argparse.rst:507 +#: ../../howto/argparse.rst:509 msgid "" "And if you don't specify the ``-v`` flag, that flag is considered to have " "``None`` value." msgstr "" -#: ../../howto/argparse.rst:510 +#: ../../howto/argparse.rst:512 msgid "" "As should be expected, specifying the long form of the flag, we should get " "the same output." msgstr "應該要如預期那樣,就算給予長選項我們也要獲得一樣的輸出結果。" -#: ../../howto/argparse.rst:513 +#: ../../howto/argparse.rst:515 msgid "" "Sadly, our help output isn't very informative on the new ability our script " "has acquired, but that can always be fixed by improving the documentation " "for our script (e.g. via the ``help`` keyword argument)." msgstr "" -#: ../../howto/argparse.rst:517 +#: ../../howto/argparse.rst:519 msgid "That last output exposes a bug in our program." msgstr "" -#: ../../howto/argparse.rst:520 +#: ../../howto/argparse.rst:522 msgid "Let's fix::" msgstr "讓我們來解決問題" -#: ../../howto/argparse.rst:539 +#: ../../howto/argparse.rst:541 msgid "And this is what it gives:" msgstr "而這也正是它給的:" -#: ../../howto/argparse.rst:554 +#: ../../howto/argparse.rst:556 msgid "" "First output went well, and fixes the bug we had before. That is, we want " "any value >= 2 to be as verbose as possible." msgstr "" -#: ../../howto/argparse.rst:557 +#: ../../howto/argparse.rst:559 msgid "Third output not so good." msgstr "第三個輸出不是這麼的好。" -#: ../../howto/argparse.rst:559 +#: ../../howto/argparse.rst:561 msgid "Let's fix that bug::" msgstr "" "我們來修復這個錯誤:\n" "\n" "::" -#: ../../howto/argparse.rst:576 +#: ../../howto/argparse.rst:578 msgid "" "We've just introduced yet another keyword, ``default``. We've set it to " "``0`` in order to make it comparable to the other int values. Remember that " @@ -475,22 +479,22 @@ msgid "" "`TypeError` exception)." msgstr "" -#: ../../howto/argparse.rst:583 +#: ../../howto/argparse.rst:585 msgid "And:" msgstr "而且" -#: ../../howto/argparse.rst:590 +#: ../../howto/argparse.rst:592 msgid "" "You can go quite far just with what we've learned so far, and we have only " "scratched the surface. The :mod:`argparse` module is very powerful, and " "we'll explore a bit more of it before we end this tutorial." msgstr "" -#: ../../howto/argparse.rst:597 +#: ../../howto/argparse.rst:599 msgid "Getting a little more advanced" msgstr "" -#: ../../howto/argparse.rst:599 +#: ../../howto/argparse.rst:601 msgid "" "What if we wanted to expand our tiny program to perform other powers, not " "just squares::" @@ -499,45 +503,45 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:616 ../../howto/argparse.rst:654 +#: ../../howto/argparse.rst:618 ../../howto/argparse.rst:656 msgid "Output:" msgstr "結果:" -#: ../../howto/argparse.rst:637 +#: ../../howto/argparse.rst:639 msgid "" "Notice that so far we've been using verbosity level to *change* the text " "that gets displayed. The following example instead uses verbosity level to " "display *more* text instead::" msgstr "" -#: ../../howto/argparse.rst:668 +#: ../../howto/argparse.rst:670 msgid "Conflicting options" msgstr "" -#: ../../howto/argparse.rst:670 +#: ../../howto/argparse.rst:672 msgid "" "So far, we have been working with two methods of an :class:`argparse." "ArgumentParser` instance. Let's introduce a third one, :meth:" -"`add_mutually_exclusive_group`. It allows for us to specify options that " -"conflict with each other. Let's also change the rest of the program so that " -"the new functionality makes more sense: we'll introduce the ``--quiet`` " -"option, which will be the opposite of the ``--verbose`` one::" +"`~ArgumentParser.add_mutually_exclusive_group`. It allows for us to specify " +"options that conflict with each other. Let's also change the rest of the " +"program so that the new functionality makes more sense: we'll introduce the " +"``--quiet`` option, which will be the opposite of the ``--verbose`` one::" msgstr "" -#: ../../howto/argparse.rst:696 +#: ../../howto/argparse.rst:698 msgid "" "Our program is now simpler, and we've lost some functionality for the sake " "of demonstration. Anyways, here's the output:" msgstr "" -#: ../../howto/argparse.rst:714 +#: ../../howto/argparse.rst:716 msgid "" "That should be easy to follow. I've added that last output so you can see " "the sort of flexibility you get, i.e. mixing long form options with short " "form ones." msgstr "" -#: ../../howto/argparse.rst:718 +#: ../../howto/argparse.rst:720 msgid "" "Before we conclude, you probably want to tell your users the main purpose of " "your program, just in case they don't know::" @@ -547,18 +551,18 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:739 +#: ../../howto/argparse.rst:741 msgid "" "Note that slight difference in the usage text. Note the ``[-v | -q]``, which " "tells us that we can either use ``-v`` or ``-q``, but not both at the same " "time:" msgstr "" -#: ../../howto/argparse.rst:761 +#: ../../howto/argparse.rst:763 msgid "Conclusion" msgstr "結論" -#: ../../howto/argparse.rst:763 +#: ../../howto/argparse.rst:765 msgid "" "The :mod:`argparse` module offers a lot more than shown here. Its docs are " "quite detailed and thorough, and full of examples. Having gone through this " diff --git a/howto/descriptor.po b/howto/descriptor.po index ec495bab26..b02c9adf43 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-04-25 00:20+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-" @@ -697,8 +697,8 @@ msgstr "" msgid "" "The descriptor protocol is simple and offers exciting possibilities. " "Several use cases are so common that they have been prepackaged into built-" -"in tools. Properties, bound methods, static methods, class methods, and \\_" -"\\_slots\\_\\_ are all based on the descriptor protocol." +"in tools. Properties, bound methods, static methods, class methods, and " +"\\_\\_slots\\_\\_ are all based on the descriptor protocol." msgstr "" #: ../../howto/descriptor.rst:957 @@ -924,18 +924,26 @@ msgid "" "`staticmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1310 +#: ../../howto/descriptor.rst:1291 +msgid "" +"The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " +"that refers to the underlying function. Also it carries forward the " +"attributes necessary to make the wrapper look like the wrapped function: " +"``__name__``, ``__qualname__``, ``__doc__``, and ``__annotations__``." +msgstr "" + +#: ../../howto/descriptor.rst:1359 msgid "Class methods" msgstr "" -#: ../../howto/descriptor.rst:1312 +#: ../../howto/descriptor.rst:1361 msgid "" "Unlike static methods, class methods prepend the class reference to the " "argument list before calling the function. This format is the same for " "whether the caller is an object or a class:" msgstr "" -#: ../../howto/descriptor.rst:1330 +#: ../../howto/descriptor.rst:1379 msgid "" "This behavior is useful whenever the method only needs to have a class " "reference and does not rely on data stored in a specific instance. One use " @@ -944,17 +952,17 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" -#: ../../howto/descriptor.rst:1347 +#: ../../howto/descriptor.rst:1396 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" -#: ../../howto/descriptor.rst:1357 +#: ../../howto/descriptor.rst:1406 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1408 +#: ../../howto/descriptor.rst:1484 msgid "" "The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " "3.9 and makes it possible for :func:`classmethod` to support chained " @@ -962,30 +970,39 @@ msgid "" "together. In Python 3.11, this functionality was deprecated." msgstr "" -#: ../../howto/descriptor.rst:1428 +#: ../../howto/descriptor.rst:1502 +msgid "" +"The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " +"``__wrapped__`` attribute that refers to the underlying function. Also it " +"carries forward the attributes necessary to make the wrapper look like the " +"wrapped function: ``__name__``, ``__qualname__``, ``__doc__``, and " +"``__annotations__``." +msgstr "" + +#: ../../howto/descriptor.rst:1510 msgid "Member objects and __slots__" msgstr "" -#: ../../howto/descriptor.rst:1430 +#: ../../howto/descriptor.rst:1512 msgid "" "When a class defines ``__slots__``, it replaces instance dictionaries with a " "fixed-length array of slot values. From a user point of view that has " "several effects:" msgstr "" -#: ../../howto/descriptor.rst:1434 +#: ../../howto/descriptor.rst:1516 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" -#: ../../howto/descriptor.rst:1450 +#: ../../howto/descriptor.rst:1532 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" -#: ../../howto/descriptor.rst:1485 +#: ../../howto/descriptor.rst:1567 msgid "" "3. Saves memory. On a 64-bit Linux build, an instance with two attributes " "takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " @@ -993,19 +1010,19 @@ msgid "" "only matters when a large number of instances are going to be created." msgstr "" -#: ../../howto/descriptor.rst:1490 +#: ../../howto/descriptor.rst:1572 msgid "" "4. Improves speed. Reading instance variables is 35% faster with " "``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." msgstr "" -#: ../../howto/descriptor.rst:1493 +#: ../../howto/descriptor.rst:1575 msgid "" "5. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -#: ../../howto/descriptor.rst:1515 +#: ../../howto/descriptor.rst:1597 msgid "" "It is not possible to create an exact drop-in pure Python version of " "``__slots__`` because it requires direct access to C structures and control " @@ -1015,36 +1032,36 @@ msgid "" "managed by member descriptors:" msgstr "" -#: ../../howto/descriptor.rst:1560 +#: ../../howto/descriptor.rst:1642 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" -#: ../../howto/descriptor.rst:1576 +#: ../../howto/descriptor.rst:1658 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " "slots instead of an instance dictionary. Here is a rough simulation in pure " "Python:" msgstr "" -#: ../../howto/descriptor.rst:1611 +#: ../../howto/descriptor.rst:1693 msgid "" "To use the simulation in a real class, just inherit from :class:`Object` and " "set the :term:`metaclass` to :class:`Type`:" msgstr "" -#: ../../howto/descriptor.rst:1625 +#: ../../howto/descriptor.rst:1707 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: ../../howto/descriptor.rst:1646 +#: ../../howto/descriptor.rst:1728 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: ../../howto/descriptor.rst:1658 +#: ../../howto/descriptor.rst:1740 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" diff --git a/library/argparse.po b/library/argparse.po index 6974392476..36345e8d6b 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-20 00:15+0000\n" +"POT-Creation-Date: 2023-04-25 00:20+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-" @@ -199,7 +199,8 @@ msgstr "" msgid "" ":class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable " "function" -msgstr ":class:`int`、:class:`float`、``argparse.FileType('w')`` 或可呼叫的函式" +msgstr "" +":class:`int`、:class:`float`、``argparse.FileType('w')`` 或可呼叫的函式" #: ../../library/argparse.rst:77 msgid "Example" @@ -1110,7 +1111,7 @@ msgstr "" msgid "" "For example, JSON or YAML conversions have complex error cases that require " "better reporting than can be given by the ``type`` keyword. A :exc:`~json." -"JSONDecodeError` would not be well formatted and a :exc:`FileNotFound` " +"JSONDecodeError` would not be well formatted and a :exc:`FileNotFoundError` " "exception would not be handled at all." msgstr "" @@ -1299,7 +1300,8 @@ msgstr "" msgid "" "Action classes implement the Action API, a callable which returns a callable " "which processes arguments from the command-line. Any object which follows " -"this API may be passed as the ``action`` parameter to :meth:`add_argument`." +"this API may be passed as the ``action`` parameter to :meth:`~ArgumentParser." +"add_argument`." msgstr "" #: ../../library/argparse.rst:1444 @@ -1529,7 +1531,7 @@ msgid "" "arguments. :class:`ArgumentParser` supports the creation of such sub-" "commands with the :meth:`add_subparsers` method. The :meth:`add_subparsers` " "method is normally called with no arguments and returns a special action " -"object. This object has a single method, :meth:`~ArgumentParser." +"object. This object has a single method, :meth:`~_SubParsersAction." "add_parser`, which takes a command name and any :class:`ArgumentParser` " "constructor arguments, and returns an :class:`ArgumentParser` object that " "can be modified as usual." @@ -1616,7 +1618,7 @@ msgid "" "for that particular parser will be printed. The help message will not " "include parent parser or sibling parser messages. (A help message for each " "subparser command, however, can be given by supplying the ``help=`` argument " -"to :meth:`add_parser` as above.)" +"to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" #: ../../library/argparse.rst:1811 @@ -1842,9 +1844,9 @@ msgstr "" #: ../../library/argparse.rst:2127 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" -"`parse_known_args`. The parser may consume an option even if it's just a " -"prefix of one of its known options, instead of leaving it in the remaining " -"arguments list." +"`~ArgumentParser.parse_known_args`. The parser may consume an option even if " +"it's just a prefix of one of its known options, instead of leaving it in the " +"remaining arguments list." msgstr "" #: ../../library/argparse.rst:2134 @@ -2026,3 +2028,22 @@ msgid "" "``parser.add_argument('--version', action='version', version='')``." msgstr "" + +#: ../../library/argparse.rst:2268 +msgid "Exceptions" +msgstr "" + +#: ../../library/argparse.rst:2272 +msgid "An error from creating or using an argument (optional or positional)." +msgstr "" + +#: ../../library/argparse.rst:2274 +msgid "" +"The string value of this exception is the message, augmented with " +"information about the argument that caused it." +msgstr "" + +#: ../../library/argparse.rst:2279 +msgid "" +"Raised when something goes wrong converting a command line string to a type." +msgstr "" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index a479da1f01..86746aca6a 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-26 00:17+0000\n" +"POT-Creation-Date: 2023-04-25 00:20+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,7 +241,7 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1011 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1012 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" @@ -305,7 +305,7 @@ msgstr "" #: ../../library/asyncio-task.rst:337 ../../library/asyncio-task.rst:467 #: ../../library/asyncio-task.rst:595 ../../library/asyncio-task.rst:653 #: ../../library/asyncio-task.rst:679 ../../library/asyncio-task.rst:722 -#: ../../library/asyncio-task.rst:815 +#: ../../library/asyncio-task.rst:816 msgid "Example::" msgstr "" "範例:\n" @@ -396,7 +396,7 @@ msgstr "" #: ../../library/asyncio-task.rst:425 ../../library/asyncio-task.rst:516 #: ../../library/asyncio-task.rst:570 ../../library/asyncio-task.rst:717 #: ../../library/asyncio-task.rst:747 ../../library/asyncio-task.rst:799 -#: ../../library/asyncio-task.rst:821 +#: ../../library/asyncio-task.rst:822 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" @@ -683,7 +683,9 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:760 -msgid "The *aws* iterable must not be empty." +msgid "" +"The *aws* iterable must not be empty and generators yielding tasks are not " +"accepted." msgstr "" #: ../../library/asyncio-task.rst:762 @@ -764,31 +766,31 @@ msgstr "" #: ../../library/asyncio-task.rst:807 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " -"concurrently. Return an iterator of coroutines. Each coroutine returned can " -"be awaited to get the earliest next result from the iterable of the " -"remaining awaitables." +"concurrently. Generators yielding tasks are not accepted as *aws* iterable. " +"Return an iterator of coroutines. Each coroutine returned can be awaited to " +"get the earliest next result from the iterable of the remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:812 +#: ../../library/asyncio-task.rst:813 msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" -#: ../../library/asyncio-task.rst:824 +#: ../../library/asyncio-task.rst:825 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:830 +#: ../../library/asyncio-task.rst:831 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:834 +#: ../../library/asyncio-task.rst:835 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:836 +#: ../../library/asyncio-task.rst:837 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -796,19 +798,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:841 +#: ../../library/asyncio-task.rst:842 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:843 +#: ../../library/asyncio-task.rst:844 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were run in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:873 +#: ../../library/asyncio-task.rst:874 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " "loop for its duration, resulting in an additional 1 second of run time. " @@ -816,7 +818,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:880 +#: ../../library/asyncio-task.rst:881 msgid "" "Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " "to make IO-bound functions non-blocking. However, for extension modules that " @@ -824,85 +826,85 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:889 +#: ../../library/asyncio-task.rst:890 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:893 +#: ../../library/asyncio-task.rst:894 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:895 +#: ../../library/asyncio-task.rst:896 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:898 +#: ../../library/asyncio-task.rst:899 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:910 +#: ../../library/asyncio-task.rst:911 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:924 +#: ../../library/asyncio-task.rst:925 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:927 +#: ../../library/asyncio-task.rst:928 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:934 +#: ../../library/asyncio-task.rst:935 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:939 +#: ../../library/asyncio-task.rst:940 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:942 +#: ../../library/asyncio-task.rst:943 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:950 +#: ../../library/asyncio-task.rst:951 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:953 +#: ../../library/asyncio-task.rst:954 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:961 +#: ../../library/asyncio-task.rst:962 msgid "Return ``True`` if *obj* is a coroutine object." msgstr "" -#: ../../library/asyncio-task.rst:967 +#: ../../library/asyncio-task.rst:968 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:971 +#: ../../library/asyncio-task.rst:972 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:974 +#: ../../library/asyncio-task.rst:975 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -910,21 +912,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:980 +#: ../../library/asyncio-task.rst:981 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:985 +#: ../../library/asyncio-task.rst:986 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:990 +#: ../../library/asyncio-task.rst:991 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -932,112 +934,112 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:995 +#: ../../library/asyncio-task.rst:996 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1000 +#: ../../library/asyncio-task.rst:1001 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:1004 +#: ../../library/asyncio-task.rst:1005 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:1008 +#: ../../library/asyncio-task.rst:1009 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1014 +#: ../../library/asyncio-task.rst:1015 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1020 +#: ../../library/asyncio-task.rst:1021 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1022 +#: ../../library/asyncio-task.rst:1023 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1027 +#: ../../library/asyncio-task.rst:1028 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1029 +#: ../../library/asyncio-task.rst:1030 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:1033 ../../library/asyncio-task.rst:1047 +#: ../../library/asyncio-task.rst:1034 ../../library/asyncio-task.rst:1048 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1036 +#: ../../library/asyncio-task.rst:1037 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1041 +#: ../../library/asyncio-task.rst:1042 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1043 +#: ../../library/asyncio-task.rst:1044 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1050 +#: ../../library/asyncio-task.rst:1051 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1055 +#: ../../library/asyncio-task.rst:1056 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1057 ../../library/asyncio-task.rst:1066 +#: ../../library/asyncio-task.rst:1058 ../../library/asyncio-task.rst:1067 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1059 +#: ../../library/asyncio-task.rst:1060 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1064 +#: ../../library/asyncio-task.rst:1065 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1068 +#: ../../library/asyncio-task.rst:1069 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1073 +#: ../../library/asyncio-task.rst:1074 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1075 +#: ../../library/asyncio-task.rst:1076 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1045,15 +1047,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1081 +#: ../../library/asyncio-task.rst:1082 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1083 +#: ../../library/asyncio-task.rst:1084 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1085 +#: ../../library/asyncio-task.rst:1086 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1062,66 +1064,66 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1094 +#: ../../library/asyncio-task.rst:1095 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1096 +#: ../../library/asyncio-task.rst:1097 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1099 +#: ../../library/asyncio-task.rst:1100 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1101 +#: ../../library/asyncio-task.rst:1102 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: ../../library/asyncio-task.rst:1106 +#: ../../library/asyncio-task.rst:1107 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1112 +#: ../../library/asyncio-task.rst:1113 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1114 +#: ../../library/asyncio-task.rst:1115 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1122 +#: ../../library/asyncio-task.rst:1123 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1124 +#: ../../library/asyncio-task.rst:1125 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1127 +#: ../../library/asyncio-task.rst:1128 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1134 +#: ../../library/asyncio-task.rst:1135 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1136 +#: ../../library/asyncio-task.rst:1137 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1139 +#: ../../library/asyncio-task.rst:1140 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1133,46 +1135,46 @@ msgid "" "addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1149 +#: ../../library/asyncio-task.rst:1150 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1152 +#: ../../library/asyncio-task.rst:1153 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1157 +#: ../../library/asyncio-task.rst:1158 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1196 +#: ../../library/asyncio-task.rst:1197 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1198 +#: ../../library/asyncio-task.rst:1199 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:1204 +#: ../../library/asyncio-task.rst:1205 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1206 +#: ../../library/asyncio-task.rst:1207 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1208 +#: ../../library/asyncio-task.rst:1209 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1213 +#: ../../library/asyncio-task.rst:1214 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1181,7 +1183,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1231 +#: ../../library/asyncio-task.rst:1232 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1190,20 +1192,20 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1237 +#: ../../library/asyncio-task.rst:1238 msgid "" "If end-user code is, for some reason, suppresing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:1243 +#: ../../library/asyncio-task.rst:1244 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1247 +#: ../../library/asyncio-task.rst:1248 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1212,7 +1214,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1253 +#: ../../library/asyncio-task.rst:1254 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/dataclasses.po b/library/dataclasses.po index b7a722f87c..801367fba2 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-07 00:15+0000\n" +"POT-Creation-Date: 2023-04-25 00:20+0000\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,9 +28,9 @@ msgstr "**原始碼:**\\ :source:`Lib/dataclasses.py`" #, fuzzy msgid "" "This module provides a decorator and functions for automatically adding " -"generated :term:`special method`\\s such as :meth:`__init__` and :meth:" -"`__repr__` to user-defined classes. It was originally described in :pep:" -"`557`." +"generated :term:`special method`\\s such as :meth:`~object.__init__` and :" +"meth:`~object.__repr__` to user-defined classes. It was originally " +"described in :pep:`557`." msgstr "" "該模組提供了一個裝飾器和函式,用於自動新增生成的特殊方法,例如 :meth:" "`__init__` 和 :meth:`__repr__` 到使用者定義的類。它最初在 :pep:`557` 中描述。" @@ -46,7 +46,8 @@ msgstr "" #: ../../library/dataclasses.rst:34 #, fuzzy -msgid "will add, among other things, a :meth:`__init__` that looks like::" +msgid "" +"will add, among other things, a :meth:`~object.__init__` that looks like::" msgstr "將新增,除其他事項外,一個 :meth:`__init__` 看起來像:" #: ../../library/dataclasses.rst:41 @@ -120,19 +121,21 @@ msgstr ":func:`dataclass` 的參數是:" #: ../../library/dataclasses.rst:89 #, fuzzy msgid "" -"``init``: If true (the default), a :meth:`__init__` method will be generated." +"``init``: If true (the default), a :meth:`~object.__init__` method will be " +"generated." msgstr "``init``:如果為真(預設值),將生成一個 :meth:`__init__` 方法。" #: ../../library/dataclasses.rst:92 #, fuzzy msgid "" -"If the class already defines :meth:`__init__`, this parameter is ignored." +"If the class already defines :meth:`~object.__init__`, this parameter is " +"ignored." msgstr "如果該類已經定義了 :meth:`__init__`,則忽略此參數。" #: ../../library/dataclasses.rst:95 #, fuzzy msgid "" -"``repr``: If true (the default), a :meth:`__repr__` method will be " +"``repr``: If true (the default), a :meth:`~object.__repr__` method will be " "generated. The generated repr string will have the class name and the name " "and repr of each field, in the order they are defined in the class. Fields " "that are marked as being excluded from the repr are not included. For " @@ -147,32 +150,37 @@ msgstr "" #: ../../library/dataclasses.rst:102 #, fuzzy msgid "" -"If the class already defines :meth:`__repr__`, this parameter is ignored." +"If the class already defines :meth:`~object.__repr__`, this parameter is " +"ignored." msgstr "如果該類已經定義了 :meth:`__repr__`,則忽略此參數。" #: ../../library/dataclasses.rst:105 #, fuzzy msgid "" -"``eq``: If true (the default), an :meth:`__eq__` method will be generated. " -"This method compares the class as if it were a tuple of its fields, in " -"order. Both instances in the comparison must be of the identical type." +"``eq``: If true (the default), an :meth:`~object.__eq__` method will be " +"generated. This method compares the class as if it were a tuple of its " +"fields, in order. Both instances in the comparison must be of the identical " +"type." msgstr "" "``eq``:如果為真(預設值),將生成一個 :meth:`__eq__` 方法。此方法按順序比較" "類,就好像它是其欄位的元組一樣。比較中的兩個實例必須屬於同一型別。" #: ../../library/dataclasses.rst:110 #, fuzzy -msgid "If the class already defines :meth:`__eq__`, this parameter is ignored." +msgid "" +"If the class already defines :meth:`~object.__eq__`, this parameter is " +"ignored." msgstr "如果該類已經定義了 :meth:`__eq__`,則忽略此參數。" #: ../../library/dataclasses.rst:113 #, fuzzy msgid "" -"``order``: If true (the default is ``False``), :meth:`__lt__`, :meth:" -"`__le__`, :meth:`__gt__`, and :meth:`__ge__` methods will be generated. " -"These compare the class as if it were a tuple of its fields, in order. Both " -"instances in the comparison must be of the identical type. If ``order`` is " -"true and ``eq`` is false, a :exc:`ValueError` is raised." +"``order``: If true (the default is ``False``), :meth:`~object.__lt__`, :meth:" +"`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` methods " +"will be generated. These compare the class as if it were a tuple of its " +"fields, in order. Both instances in the comparison must be of the identical " +"type. If ``order`` is true and ``eq`` is false, a :exc:`ValueError` is " +"raised." msgstr "" "``order``:如果為真(預設為 ``False``),:meth:`__lt__`、:meth:`__le__`、:" "meth:`__gt__` 和 :meth:`__ge__` 方法將是產生。它們按順序比較類,就好像它是其" @@ -182,8 +190,9 @@ msgstr "" #: ../../library/dataclasses.rst:120 #, fuzzy msgid "" -"If the class already defines any of :meth:`__lt__`, :meth:`__le__`, :meth:" -"`__gt__`, or :meth:`__ge__`, then :exc:`TypeError` is raised." +"If the class already defines any of :meth:`~object.__lt__`, :meth:`~object." +"__le__`, :meth:`~object.__gt__`, or :meth:`~object.__ge__`, then :exc:" +"`TypeError` is raised." msgstr "" "如果該類已經定義了 :meth:`__lt__`、:meth:`__le__`、:meth:`__gt__` 或 :meth:" "`__ge__` 中的任何一個,則引發 :exc:`TypeError`。" @@ -191,8 +200,8 @@ msgstr "" #: ../../library/dataclasses.rst:124 #, fuzzy msgid "" -"``unsafe_hash``: If ``False`` (the default), a :meth:`__hash__` method is " -"generated according to how ``eq`` and ``frozen`` are set." +"``unsafe_hash``: If ``False`` (the default), a :meth:`~object.__hash__` " +"method is generated according to how ``eq`` and ``frozen`` are set." msgstr "" "``unsafe_hash``:如果``False``(預設值),將根據``eq`` 和``frozen`` 的設定生" "成一個:meth:`__hash__` 方法。" @@ -200,12 +209,13 @@ msgstr "" #: ../../library/dataclasses.rst:127 #, fuzzy msgid "" -":meth:`__hash__` is used by built-in :meth:`hash()`, and when objects are " -"added to hashed collections such as dictionaries and sets. Having a :meth:" -"`__hash__` implies that instances of the class are immutable. Mutability is " -"a complicated property that depends on the programmer's intent, the " -"existence and behavior of :meth:`__eq__`, and the values of the ``eq`` and " -"``frozen`` flags in the :func:`dataclass` decorator." +":meth:`~object.__hash__` is used by built-in :meth:`hash()`, and when " +"objects are added to hashed collections such as dictionaries and sets. " +"Having a :meth:`~object.__hash__` implies that instances of the class are " +"immutable. Mutability is a complicated property that depends on the " +"programmer's intent, the existence and behavior of :meth:`~object.__eq__`, " +"and the values of the ``eq`` and ``frozen`` flags in the :func:`dataclass` " +"decorator." msgstr "" ":meth:`__hash__` 由內置的:meth:`hash()` 使用,當對像被新增到散列集合(如字典" "和集合)時。擁有 :meth:`__hash__` 意味著該類的實例是不可變的。可變性是一個複" @@ -215,11 +225,11 @@ msgstr "" #: ../../library/dataclasses.rst:134 #, fuzzy msgid "" -"By default, :func:`dataclass` will not implicitly add a :meth:`__hash__` " -"method unless it is safe to do so. Neither will it add or change an " -"existing explicitly defined :meth:`__hash__` method. Setting the class " -"attribute ``__hash__ = None`` has a specific meaning to Python, as described " -"in the :meth:`__hash__` documentation." +"By default, :func:`dataclass` will not implicitly add a :meth:`~object." +"__hash__` method unless it is safe to do so. Neither will it add or change " +"an existing explicitly defined :meth:`~object.__hash__` method. Setting the " +"class attribute ``__hash__ = None`` has a specific meaning to Python, as " +"described in the :meth:`~object.__hash__` documentation." msgstr "" "預設情況下,:func:`dataclass` 不會隱式新增 :meth:`__hash__` 方法,除非這樣做" "是安全的。它也不會新增或更改現有的明確定義的 :meth:`__hash__` 方法。設定類屬" @@ -229,12 +239,13 @@ msgstr "" #: ../../library/dataclasses.rst:140 #, fuzzy msgid "" -"If :meth:`__hash__` is not explicitly defined, or if it is set to ``None``, " -"then :func:`dataclass` *may* add an implicit :meth:`__hash__` method. " -"Although not recommended, you can force :func:`dataclass` to create a :meth:" -"`__hash__` method with ``unsafe_hash=True``. This might be the case if your " -"class is logically immutable but can nonetheless be mutated. This is a " -"specialized use case and should be considered carefully." +"If :meth:`~object.__hash__` is not explicitly defined, or if it is set to " +"``None``, then :func:`dataclass` *may* add an implicit :meth:`~object." +"__hash__` method. Although not recommended, you can force :func:`dataclass` " +"to create a :meth:`~object.__hash__` method with ``unsafe_hash=True``. This " +"might be the case if your class is logically immutable but can nonetheless " +"be mutated. This is a specialized use case and should be considered " +"carefully." msgstr "" "如果 :meth:`__hash__` 沒有明確定義,或者如果它被設定為 ``None``,那麼 :func:" "`dataclass` *可能* 新增一個隱式的 :meth:`__hash__` 方法。雖然不推薦,但您可以" @@ -245,10 +256,10 @@ msgstr "" #: ../../library/dataclasses.rst:147 #, fuzzy msgid "" -"Here are the rules governing implicit creation of a :meth:`__hash__` " -"method. Note that you cannot both have an explicit :meth:`__hash__` method " -"in your dataclass and set ``unsafe_hash=True``; this will result in a :exc:" -"`TypeError`." +"Here are the rules governing implicit creation of a :meth:`~object.__hash__` " +"method. Note that you cannot both have an explicit :meth:`~object.__hash__` " +"method in your dataclass and set ``unsafe_hash=True``; this will result in " +"a :exc:`TypeError`." msgstr "" "以下是管理隱式建立 :meth:`__hash__` 方法的規則。請注意,您不能在資料類中既有" "顯式的 :meth:`__hash__` 方法又設定 ``unsafe_hash=True``;這將導致 :exc:" @@ -258,12 +269,12 @@ msgstr "" #, fuzzy msgid "" "If ``eq`` and ``frozen`` are both true, by default :func:`dataclass` will " -"generate a :meth:`__hash__` method for you. If ``eq`` is true and " -"``frozen`` is false, :meth:`__hash__` will be set to ``None``, marking it " -"unhashable (which it is, since it is mutable). If ``eq`` is false, :meth:" -"`__hash__` will be left untouched meaning the :meth:`__hash__` method of the " -"superclass will be used (if the superclass is :class:`object`, this means it " -"will fall back to id-based hashing)." +"generate a :meth:`~object.__hash__` method for you. If ``eq`` is true and " +"``frozen`` is false, :meth:`~object.__hash__` will be set to ``None``, " +"marking it unhashable (which it is, since it is mutable). If ``eq`` is " +"false, :meth:`~object.__hash__` will be left untouched meaning the :meth:" +"`~object.__hash__` method of the superclass will be used (if the superclass " +"is :class:`object`, this means it will fall back to id-based hashing)." msgstr "" "如果``eq`` 和``frozen`` 都為真,預設情況下:func:`dataclass` 會為你生成一個:" "meth:`__hash__` 方法。如果 ``eq`` 為真且 ``frozen`` 為假,:meth:`__hash__` 將" @@ -277,8 +288,8 @@ msgstr "" msgid "" "``frozen``: If true (the default is ``False``), assigning to fields will " "generate an exception. This emulates read-only frozen instances. If :meth:" -"`__setattr__` or :meth:`__delattr__` is defined in the class, then :exc:" -"`TypeError` is raised. See the discussion below." +"`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the " +"class, then :exc:`TypeError` is raised. See the discussion below." msgstr "" "``frozen``:如果為真(預設為``False``),分配給欄位將產生例外。這模擬了只讀的" "凍結實例。如果 :meth:`__setattr__` 或 :meth:`__delattr__` 在類中定義,則 :" @@ -289,9 +300,9 @@ msgstr "" msgid "" "``match_args``: If true (the default is ``True``), the ``__match_args__`` " "tuple will be created from the list of parameters to the generated :meth:" -"`__init__` method (even if :meth:`__init__` is not generated, see above). " -"If false, or if ``__match_args__`` is already defined in the class, then " -"``__match_args__`` will not be generated." +"`~object.__init__` method (even if :meth:`~object.__init__` is not " +"generated, see above). If false, or if ``__match_args__`` is already " +"defined in the class, then ``__match_args__`` will not be generated." msgstr "" "``match_args``:如果為真(預設為 ``True``),``__match_args__`` 元組將從參數" "列表建立到生成的 :meth:`__init__` 方法(即使 :meth: `__init__` 未生成,見上" @@ -303,11 +314,11 @@ msgstr "" msgid "" "``kw_only``: If true (the default value is ``False``), then all fields will " "be marked as keyword-only. If a field is marked as keyword-only, then the " -"only effect is that the :meth:`__init__` parameter generated from a keyword-" -"only field must be specified with a keyword when :meth:`__init__` is " -"called. There is no effect on any other aspect of dataclasses. See the :" -"term:`parameter` glossary entry for details. Also see the :const:`KW_ONLY` " -"section." +"only effect is that the :meth:`~object.__init__` parameter generated from a " +"keyword-only field must be specified with a keyword when :meth:`~object." +"__init__` is called. There is no effect on any other aspect of " +"dataclasses. See the :term:`parameter` glossary entry for details. Also " +"see the :const:`KW_ONLY` section." msgstr "" "``kw_only``:如果為 true(預設值為 ``False``),則所有欄位將被標記為僅限關鍵" "字。如果一個欄位被標記為僅限關鍵字,那麼唯一的影響是從僅限關鍵字欄位生成的 :" @@ -318,10 +329,10 @@ msgstr "" #: ../../library/dataclasses.rst:185 #, fuzzy msgid "" -"``slots``: If true (the default is ``False``), :attr:`__slots__` attribute " -"will be generated and new class will be returned instead of the original " -"one. If :attr:`__slots__` is already defined in the class, then :exc:" -"`TypeError` is raised." +"``slots``: If true (the default is ``False``), :attr:`~object.__slots__` " +"attribute will be generated and new class will be returned instead of the " +"original one. If :attr:`~object.__slots__` is already defined in the class, " +"then :exc:`TypeError` is raised." msgstr "" "``slots``:如果為 true(預設為 ``False``),將生成:attr:`__slots__` 屬性並回" "傳新類而不是原始類。如果 :attr:`__slots__` 已經在類中定義,則 :exc:" @@ -365,7 +376,7 @@ msgstr "``field``\\s 可以選擇指定一個預設值,使用普通的 Python #, fuzzy msgid "" "In this example, both ``a`` and ``b`` will be included in the added :meth:" -"`__init__` method, which will be defined as::" +"`~object.__init__` method, which will be defined as::" msgstr "" "在此示例中,``a`` 和``b`` 都將包含在新增的 :meth:`__init__` 方法中,該方法將" "定義為:" @@ -437,7 +448,7 @@ msgstr "" #, fuzzy msgid "" "``init``: If true (the default), this field is included as a parameter to " -"the generated :meth:`__init__` method." +"the generated :meth:`~object.__init__` method." msgstr "" "``init``:如果為 true(預設值),則此欄位將作為生成的 __init__` 方法的參數包" "含在內。" @@ -446,7 +457,7 @@ msgstr "" #, fuzzy msgid "" "``repr``: If true (the default), this field is included in the string " -"returned by the generated :meth:`__repr__` method." +"returned by the generated :meth:`~object.__repr__` method." msgstr "" "``repr``:如果為真(預設值),則此欄位包含在生成的 :meth:`__repr__` 方法回傳" "的字串中。" @@ -455,10 +466,11 @@ msgstr "" #, fuzzy msgid "" "``hash``: This can be a bool or ``None``. If true, this field is included " -"in the generated :meth:`__hash__` method. If ``None`` (the default), use " -"the value of ``compare``: this would normally be the expected behavior. A " -"field should be considered in the hash if it's used for comparisons. " -"Setting this value to anything other than ``None`` is discouraged." +"in the generated :meth:`~object.__hash__` method. If ``None`` (the " +"default), use the value of ``compare``: this would normally be the expected " +"behavior. A field should be considered in the hash if it's used for " +"comparisons. Setting this value to anything other than ``None`` is " +"discouraged." msgstr "" "``hash``:這可以是 bool 或 ``None``。如果為真,則此欄位包含在生成的 :meth:" "`__hash__` 方法中。如果“無”(預設值),則使用“比較”的值:這通常是預期的行為。" @@ -482,7 +494,8 @@ msgstr "" #, fuzzy msgid "" "``compare``: If true (the default), this field is included in the generated " -"equality and comparison methods (:meth:`__eq__`, :meth:`__gt__`, et al.)." +"equality and comparison methods (:meth:`~object.__eq__`, :meth:`~object." +"__gt__`, et al.)." msgstr "" "``compare``:如果為真(預設值),則此欄位包含在生成的相等和比較方法中(:meth:" "`__eq__`、:meth:`__gt__` 等)。" @@ -506,7 +519,8 @@ msgstr "" #, fuzzy msgid "" "``kw_only``: If true, this field will be marked as keyword-only. This is " -"used when the generated :meth:`__init__` method's parameters are computed." +"used when the generated :meth:`~object.__init__` method's parameters are " +"computed." msgstr "" "``kw_only``:如果為真,該欄位將被標記為僅限關鍵字。這在計算生成的 :meth:" "`__init__` 方法的參數時使用。" @@ -689,9 +703,9 @@ msgstr "" #: ../../library/dataclasses.rst:434 #, fuzzy msgid "" -"The newly returned object is created by calling the :meth:`__init__` method " -"of the dataclass. This ensures that :meth:`__post_init__`, if present, is " -"also called." +"The newly returned object is created by calling the :meth:`~object.__init__` " +"method of the dataclass. This ensures that :ref:`__post_init__ `, if present, is also called." msgstr "" "新回傳的對像是通過呼叫資料類的 :meth:`__init__` 方法建立的。這確保 :meth:" "`__post_init__`(如果存在)也被呼叫。" @@ -700,8 +714,8 @@ msgstr "" #, fuzzy msgid "" "Init-only variables without default values, if any exist, must be specified " -"on the call to :func:`replace` so that they can be passed to :meth:" -"`__init__` and :meth:`__post_init__`." +"on the call to :func:`replace` so that they can be passed to :meth:`~object." +"__init__` and :ref:`__post_init__ `." msgstr "" "沒有預設值的僅初始化變數(如果存在)必須在呼叫 :func:`replace` 時指定,以便它" "們可以傳遞給 :meth:`__init__` 和 :meth:`__post_init__`。" @@ -720,11 +734,11 @@ msgstr "" msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:" "`replace`. They are not copied from the source object, but rather are " -"initialized in :meth:`__post_init__`, if they're initialized at all. It is " -"expected that ``init=False`` fields will be rarely and judiciously used. If " -"they are used, it might be wise to have alternate class constructors, or " -"perhaps a custom ``replace()`` (or similarly named) method which handles " -"instance copying." +"initialized in :ref:`__post_init__ `, if they're " +"initialized at all. It is expected that ``init=False`` fields will be " +"rarely and judiciously used. If they are used, it might be wise to have " +"alternate class constructors, or perhaps a custom ``replace()`` (or " +"similarly named) method which handles instance copying." msgstr "" "預先警告 ``init=False`` 欄位在呼叫 :func:`replace` 期間是如何工作的。它們不是" "從源物件複製的,而是在 :meth:`__post_init__` 中初始化的,如果它們被初始化的" @@ -762,8 +776,8 @@ msgid "" "that a pseudo-field of type :const:`KW_ONLY` is otherwise completely " "ignored. This includes the name of such a field. By convention, a name of " "``_`` is used for a :const:`KW_ONLY` field. Keyword-only fields signify :" -"meth:`__init__` parameters that must be specified as keywords when the class " -"is instantiated." +"meth:`~object.__init__` parameters that must be specified as keywords when " +"the class is instantiated." msgstr "" "用作型別註釋的標記值。型別為 KW_ONLY 的偽欄位之後的任何欄位都被標記為僅關鍵字" "欄位。請注意,KW_ONLY 型別的偽欄位將被完全忽略。這包括此類欄位的名稱。按照慣" @@ -787,27 +801,28 @@ msgstr "在單個資料類中,指定多個型別為 KW_ONLY 的欄位是錯誤 #: ../../library/dataclasses.rst:500 #, fuzzy msgid "" -"Raised when an implicitly defined :meth:`__setattr__` or :meth:`__delattr__` " -"is called on a dataclass which was defined with ``frozen=True``. It is a " -"subclass of :exc:`AttributeError`." +"Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" +"`~object.__delattr__` is called on a dataclass which was defined with " +"``frozen=True``. It is a subclass of :exc:`AttributeError`." msgstr "" "當在使用 frozen=True 定義的資料類上呼叫隱式定義的 :meth:`__setattr__` 或 :" "meth:`__delattr__` 時引發。它是 :exc:`AttributeError` 的子類別。" -#: ../../library/dataclasses.rst:505 +#: ../../library/dataclasses.rst:507 #, fuzzy msgid "Post-init processing" msgstr "初始化後處理" -#: ../../library/dataclasses.rst:507 +#: ../../library/dataclasses.rst:509 #, fuzzy msgid "" -"The generated :meth:`__init__` code will call a method named :meth:" -"`__post_init__`, if :meth:`__post_init__` is defined on the class. It will " +"The generated :meth:`~object.__init__` code will call a method named :meth:`!" +"__post_init__`, if :meth:`!__post_init__` is defined on the class. It will " "normally be called as ``self.__post_init__()``. However, if any ``InitVar`` " -"fields are defined, they will also be passed to :meth:`__post_init__` in the " -"order they were defined in the class. If no :meth:`__init__` method is " -"generated, then :meth:`__post_init__` will not automatically be called." +"fields are defined, they will also be passed to :meth:`!__post_init__` in " +"the order they were defined in the class. If no :meth:`~object.__init__` " +"method is generated, then :meth:`!__post_init__` will not automatically be " +"called." msgstr "" "生成的 :meth:`__init__` 程式碼將呼叫一個名為 :meth:`__post_init__` 的方法,如" "果 :meth:`__post_init__` 是在類上定義的。它通常被稱為 ``self." @@ -815,7 +830,7 @@ msgstr "" "類中定義的順序傳遞給 :meth:`__post_init__` 。如果沒有生成 :meth:`__init__` 方" "法,那麼 :meth:`__post_init__` 將不會被自動呼叫。" -#: ../../library/dataclasses.rst:515 +#: ../../library/dataclasses.rst:517 #, fuzzy msgid "" "Among other uses, this allows for initializing field values that depend on " @@ -824,44 +839,45 @@ msgstr "" "在其他用途\\u200b\\u200b中,這允許初始化依賴於一個或多個其他欄位的欄位值。例" "如::" -#: ../../library/dataclasses.rst:527 +#: ../../library/dataclasses.rst:529 #, fuzzy msgid "" -"The :meth:`__init__` method generated by :func:`dataclass` does not call " -"base class :meth:`__init__` methods. If the base class has an :meth:" -"`__init__` method that has to be called, it is common to call this method in " -"a :meth:`__post_init__` method::" +"The :meth:`~object.__init__` method generated by :func:`dataclass` does not " +"call base class :meth:`~object.__init__` methods. If the base class has an :" +"meth:`~object.__init__` method that has to be called, it is common to call " +"this method in a :meth:`!__post_init__` method::" msgstr "" ":func:`dataclass` 生成的:meth:`__init__` 方法不呼叫基底類別:meth:`__init__` " "方法。如果基底類別有一個必須呼叫的 :meth:`__init__` 方法,通常在 :meth:" "`__post_init__` 方法中呼叫此方法::" -#: ../../library/dataclasses.rst:544 +#: ../../library/dataclasses.rst:546 #, fuzzy msgid "" -"Note, however, that in general the dataclass-generated :meth:`__init__` " -"methods don't need to be called, since the derived dataclass will take care " -"of initializing all fields of any base class that is a dataclass itself." +"Note, however, that in general the dataclass-generated :meth:`~object." +"__init__` methods don't need to be called, since the derived dataclass will " +"take care of initializing all fields of any base class that is a dataclass " +"itself." msgstr "" "但是請注意,通常不需要呼叫資料類生成的 :meth:`__init__` 方法,因為派生資料類" "將負責初始化作為資料類本身的任何基底類別的所有欄位。" -#: ../../library/dataclasses.rst:548 +#: ../../library/dataclasses.rst:550 #, fuzzy msgid "" "See the section below on init-only variables for ways to pass parameters to :" -"meth:`__post_init__`. Also see the warning about how :func:`replace` " +"meth:`!__post_init__`. Also see the warning about how :func:`replace` " "handles ``init=False`` fields." msgstr "" "請參閱下面有關僅初始化變數的部分,了解將參數傳遞給 :meth:`__post_init__` 的方" "法。另請參閱有關 :func:`replace` 如何處理 ``init=False`` 欄位的警告。" -#: ../../library/dataclasses.rst:553 +#: ../../library/dataclasses.rst:555 #, fuzzy msgid "Class variables" msgstr "類變數" -#: ../../library/dataclasses.rst:555 +#: ../../library/dataclasses.rst:557 #, fuzzy msgid "" "One of the few places where :func:`dataclass` actually inspects the type of " @@ -876,12 +892,12 @@ msgstr "" "一個欄位是一個“ClassVar”,它就被排除在考慮之外,並被資料類機制忽略。模組級 :" "func:`fields` 函式不會回傳此類 ``ClassVar`` 偽欄位。" -#: ../../library/dataclasses.rst:564 +#: ../../library/dataclasses.rst:566 #, fuzzy msgid "Init-only variables" msgstr "僅初始化變數" -#: ../../library/dataclasses.rst:566 +#: ../../library/dataclasses.rst:568 #, fuzzy msgid "" "Another place where :func:`dataclass` inspects a type annotation is to " @@ -890,8 +906,9 @@ msgid "" "``InitVar``, it is considered a pseudo-field called an init-only field. As " "it is not a true field, it is not returned by the module-level :func:" "`fields` function. Init-only fields are added as parameters to the " -"generated :meth:`__init__` method, and are passed to the optional :meth:" -"`__post_init__` method. They are not otherwise used by dataclasses." +"generated :meth:`~object.__init__` method, and are passed to the optional :" +"ref:`__post_init__ ` method. They are not otherwise " +"used by dataclasses." msgstr "" ":func:`dataclass` 檢查型別註解的另一個地方是確定欄位是否是僅初始化變數。它通" "過查看欄位的型別是否為“dataclasses.InitVar”型別來執行此操作。如果一個欄位是一" @@ -900,14 +917,14 @@ msgstr "" "meth:`__init__` 方法,並傳遞給可選的 :meth:`__post_init__` 方法。它們不被資料" "類使用。" -#: ../../library/dataclasses.rst:576 +#: ../../library/dataclasses.rst:578 #, fuzzy msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "例如,假設一個欄位將從資料庫中初始化,如果在建立類時沒有提供值::" -#: ../../library/dataclasses.rst:591 +#: ../../library/dataclasses.rst:593 #, fuzzy msgid "" "In this case, :func:`fields` will return :class:`Field` objects for ``i`` " @@ -916,41 +933,41 @@ msgstr "" "在這種情況下,:func:`fields` 將為 ``i`` 和 ``j`` 回傳 :class:`Field` 物件,但" "不會為 ``database`` 回傳。" -#: ../../library/dataclasses.rst:595 +#: ../../library/dataclasses.rst:597 #, fuzzy msgid "Frozen instances" msgstr "凍結實例" -#: ../../library/dataclasses.rst:597 +#: ../../library/dataclasses.rst:599 #, fuzzy msgid "" "It is not possible to create truly immutable Python objects. However, by " "passing ``frozen=True`` to the :meth:`dataclass` decorator you can emulate " -"immutability. In that case, dataclasses will add :meth:`__setattr__` and :" -"meth:`__delattr__` methods to the class. These methods will raise a :exc:" -"`FrozenInstanceError` when invoked." +"immutability. In that case, dataclasses will add :meth:`~object." +"__setattr__` and :meth:`~object.__delattr__` methods to the class. These " +"methods will raise a :exc:`FrozenInstanceError` when invoked." msgstr "" "不可能建立真正不可變的 Python 物件。但是,通過將 ``frozen=True`` 傳遞給 :" "meth:`dataclass` 裝飾器,您可以模擬不變性。在這種情況下,資料類將向類新增 :" "meth:`__setattr__` 和 :meth:`__delattr__` 方法。這些方法在呼叫時會引發:exc:" "`FrozenInstanceError`。" -#: ../../library/dataclasses.rst:603 +#: ../../library/dataclasses.rst:605 #, fuzzy msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" -"`__init__` cannot use simple assignment to initialize fields, and must use :" -"meth:`object.__setattr__`." +"`~object.__init__` cannot use simple assignment to initialize fields, and " +"must use :meth:`~object.__setattr__`." msgstr "" "使用 ``frozen=True`` 時有一個微小的性能損失::meth:`__init__` 不能使用簡單賦" "值來初始化欄位,必須使用 :meth:`object.__setattr__`。" -#: ../../library/dataclasses.rst:608 +#: ../../library/dataclasses.rst:610 #, fuzzy msgid "Inheritance" msgstr "遺產" -#: ../../library/dataclasses.rst:610 +#: ../../library/dataclasses.rst:612 #, fuzzy msgid "" "When the dataclass is being created by the :meth:`dataclass` decorator, it " @@ -968,7 +985,7 @@ msgstr "" "增到有序映射中。所有生成的方法都將使用這種組合的、計算的有序欄位映射。因為欄" "位是按插入順序排列的,所以派生類會覆蓋基底類別。一個例子::" -#: ../../library/dataclasses.rst:630 +#: ../../library/dataclasses.rst:632 #, fuzzy msgid "" "The final list of fields is, in order, ``x``, ``y``, ``z``. The final type " @@ -977,29 +994,30 @@ msgstr "" "最終的欄位列表按順序為“x”、“y”、“z”。 ``x`` 的最終型別是 ``int``,如類 ``C`` " "中指定的那樣。" -#: ../../library/dataclasses.rst:633 +#: ../../library/dataclasses.rst:635 #, fuzzy -msgid "The generated :meth:`__init__` method for ``C`` will look like::" +msgid "" +"The generated :meth:`~object.__init__` method for ``C`` will look like::" msgstr "為 ``C`` 生成的 :meth:`__init__` 方法將如下所示:" -#: ../../library/dataclasses.rst:638 +#: ../../library/dataclasses.rst:640 #, fuzzy -msgid "Re-ordering of keyword-only parameters in :meth:`__init__`" +msgid "Re-ordering of keyword-only parameters in :meth:`~object.__init__`" msgstr ":meth:`__init__` 中僅關鍵字參數的重新排序" -#: ../../library/dataclasses.rst:640 +#: ../../library/dataclasses.rst:642 #, fuzzy msgid "" -"After the parameters needed for :meth:`__init__` are computed, any keyword-" -"only parameters are moved to come after all regular (non-keyword-only) " -"parameters. This is a requirement of how keyword-only parameters are " +"After the parameters needed for :meth:`~object.__init__` are computed, any " +"keyword-only parameters are moved to come after all regular (non-keyword-" +"only) parameters. This is a requirement of how keyword-only parameters are " "implemented in Python: they must come after non-keyword-only parameters." msgstr "" "在計算 :meth:`__init__` 所需的參數後,任何僅關鍵字參數都將移動到所有常規(非" "僅關鍵字)參數之後。這是如何在 Python 中實作僅關鍵字參數的要求:它們必須位於" "非僅關鍵字參數之後。" -#: ../../library/dataclasses.rst:646 +#: ../../library/dataclasses.rst:648 #, fuzzy msgid "" "In this example, ``Base.y``, ``Base.w``, and ``D.t`` are keyword-only " @@ -1008,12 +1026,13 @@ msgstr "" "在此示例中,``Base.y``、``Base.w`` 和``D.t`` 是僅限關鍵字的欄位,``Base.x`` " "和``D.z`` 是常規欄位: :" -#: ../../library/dataclasses.rst:661 +#: ../../library/dataclasses.rst:663 #, fuzzy -msgid "The generated :meth:`__init__` method for ``D`` will look like::" +msgid "" +"The generated :meth:`~object.__init__` method for ``D`` will look like::" msgstr "為 ``D`` 生成的 :meth:`__init__` 方法將如下所示:" -#: ../../library/dataclasses.rst:665 +#: ../../library/dataclasses.rst:667 #, fuzzy msgid "" "Note that the parameters have been re-ordered from how they appear in the " @@ -1023,19 +1042,19 @@ msgstr "" "請注意,參數已根據它們在欄位列表中的顯示方式重新排序:從常規欄位派生的參數後" "跟從僅關鍵字欄位派生的參數。" -#: ../../library/dataclasses.rst:669 +#: ../../library/dataclasses.rst:671 #, fuzzy msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" -"ordered :meth:`__init__` parameter list." +"ordered :meth:`~object.__init__` parameter list." msgstr "僅關鍵字參數的相對順序在重新排序的 :meth:`__init__` 參數列表中維護。" -#: ../../library/dataclasses.rst:674 +#: ../../library/dataclasses.rst:676 #, fuzzy msgid "Default factory functions" msgstr "預設工廠函式" -#: ../../library/dataclasses.rst:676 +#: ../../library/dataclasses.rst:678 #, fuzzy msgid "" "If a :func:`field` specifies a ``default_factory``, it is called with zero " @@ -1045,47 +1064,48 @@ msgstr "" "如果 :func:`field` 指定了 ``default_factory``,當需要該欄位的預設值時,它會以" "零參數呼叫。例如,要建立列表的新實例,請使用:" -#: ../../library/dataclasses.rst:682 +#: ../../library/dataclasses.rst:684 #, fuzzy msgid "" -"If a field is excluded from :meth:`__init__` (using ``init=False``) and the " -"field also specifies ``default_factory``, then the default factory function " -"will always be called from the generated :meth:`__init__` function. This " -"happens because there is no other way to give the field an initial value." +"If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " +"and the field also specifies ``default_factory``, then the default factory " +"function will always be called from the generated :meth:`~object.__init__` " +"function. This happens because there is no other way to give the field an " +"initial value." msgstr "" "如果一個欄位從 :meth:`__init__` 中排除(使用 ``init=False``)並且該欄位還指定" "了 ``default_factory``,那麼預設工廠函式將始終從生成的 :meth:`__init__ 中呼叫" "`功能。發生這種情況是因為沒有其他方法可以為該欄位賦予初始值。" -#: ../../library/dataclasses.rst:689 +#: ../../library/dataclasses.rst:691 #, fuzzy msgid "Mutable default values" msgstr "可變預設值" -#: ../../library/dataclasses.rst:691 +#: ../../library/dataclasses.rst:693 #, fuzzy msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" msgstr "Python 將預設成員變數值存儲在類屬性中。考慮這個例子,不使用資料類::" -#: ../../library/dataclasses.rst:706 +#: ../../library/dataclasses.rst:708 #, fuzzy msgid "" "Note that the two instances of class ``C`` share the same class variable " "``x``, as expected." msgstr "請注意,類“C”的兩個實例共享同一個類變數“x”,正如預期的那樣。" -#: ../../library/dataclasses.rst:709 +#: ../../library/dataclasses.rst:711 #, fuzzy msgid "Using dataclasses, *if* this code was valid::" msgstr "使用資料類,*如果*此程式碼有效::" -#: ../../library/dataclasses.rst:717 +#: ../../library/dataclasses.rst:719 msgid "it would generate code similar to::" msgstr "它會生成類似的程式碼::" -#: ../../library/dataclasses.rst:728 +#: ../../library/dataclasses.rst:730 #, fuzzy msgid "" "This has the same issue as the original example using class ``C``. That is, " @@ -1105,14 +1125,14 @@ msgstr "" "`TypeError`。假設是如果一個值是不可散列的,那麼它就是可變的。這是一個部分解決" "方案,但它確實可以防止許多常見錯誤。" -#: ../../library/dataclasses.rst:739 +#: ../../library/dataclasses.rst:741 #, fuzzy msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "使用預設工廠函式是一種建立可變型別的新實例作為欄位預設值的方法:" -#: ../../library/dataclasses.rst:748 +#: ../../library/dataclasses.rst:750 #, fuzzy msgid "" "Instead of looking for and disallowing objects of type ``list``, ``dict``, " @@ -1122,12 +1142,12 @@ msgstr "" "不再查找和禁止型別為“list”、“dict”或“set”的物件,現在不允許使用不可散列的對像" "作為預設值。不可散列性用於近似可變性。" -#: ../../library/dataclasses.rst:755 +#: ../../library/dataclasses.rst:757 #, fuzzy msgid "Descriptor-typed fields" msgstr "描述器型別的欄位" -#: ../../library/dataclasses.rst:757 +#: ../../library/dataclasses.rst:759 #, fuzzy msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " @@ -1136,7 +1156,7 @@ msgstr "" "指定為 :ref:`descriptor objects ` 作為預設值的欄位具有以下特殊行" "為:" -#: ../../library/dataclasses.rst:760 +#: ../../library/dataclasses.rst:762 #, fuzzy msgid "" "The value for the field passed to the dataclass's ``__init__`` method is " @@ -1146,7 +1166,7 @@ msgstr "" "傳遞給資料類的“__init__”方法的欄位值被傳遞給描述器的“__set__”方法,而不是覆蓋" "描述器物件。" -#: ../../library/dataclasses.rst:763 +#: ../../library/dataclasses.rst:765 #, fuzzy msgid "" "Similarly, when getting or setting the field, the descriptor's ``__get__`` " @@ -1156,7 +1176,7 @@ msgstr "" "同樣,在獲取或設定欄位時,將呼叫描述器的“__get__”或“__set__”方法,而不是回傳" "或覆蓋描述器物件。" -#: ../../library/dataclasses.rst:766 +#: ../../library/dataclasses.rst:768 #, fuzzy msgid "" "To determine whether a field contains a default value, ``dataclasses`` will " @@ -1171,7 +1191,7 @@ msgstr "" "情況下,描述器回傳一個值,它將用作欄位的預設值。另一方面,如果描述器在這種情" "況下引發 :exc:`AttributeError`,則不會為該欄位提供預設值。" -#: ../../library/dataclasses.rst:801 +#: ../../library/dataclasses.rst:803 #, fuzzy msgid "" "Note that if a field is annotated with a descriptor type, but is not " diff --git a/library/optparse.po b/library/optparse.po index d5803d16c8..f284f026a0 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-21 00:16+0000\n" +"POT-Creation-Date: 2023-04-25 00:20+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -717,7 +717,7 @@ msgstr "" msgid "An option group is obtained using the class :class:`OptionGroup`:" msgstr "" -#: ../../library/optparse.rst:568 ../../library/optparse.rst:1620 +#: ../../library/optparse.rst:568 ../../library/optparse.rst:1637 msgid "where" msgstr "" @@ -1126,7 +1126,7 @@ msgstr "``\"append_const\"``" msgid "append a constant value to a list, pre-set via :attr:`Option.const`" msgstr "" -#: ../../library/optparse.rst:949 ../../library/optparse.rst:1226 +#: ../../library/optparse.rst:949 ../../library/optparse.rst:1243 msgid "``\"help\"``" msgstr "``\"help\"``" @@ -1146,50 +1146,70 @@ msgstr "" msgid "" "As you can see, most actions involve storing or updating a value somewhere. :" "mod:`optparse` always creates a special object for this, conventionally " -"called ``options`` (it happens to be an instance of :class:`optparse." -"Values`). Option arguments (and various other values) are stored as " -"attributes of this object, according to the :attr:`~Option.dest` " -"(destination) option attribute." +"called ``options``, which is an instance of :class:`optparse.Values`." msgstr "" #: ../../library/optparse.rst:961 +msgid "" +"An object holding parsed argument names and values as attributes. Normally " +"created by calling when calling :meth:`OptionParser.parse_args`, and can be " +"overridden by a custom subclass passed to the *values* argument of :meth:" +"`OptionParser.parse_args` (as described in :ref:`optparse-parsing-" +"arguments`)." +msgstr "" + +#: ../../library/optparse.rst:966 +msgid "" +"Option arguments (and various other values) are stored as attributes of this " +"object, according to the :attr:`~Option.dest` (destination) option attribute." +msgstr "" + +#: ../../library/optparse.rst:970 msgid "For example, when you call ::" msgstr "" "例如說,當你呼叫:\n" "\n" "::" -#: ../../library/optparse.rst:965 +#: ../../library/optparse.rst:974 msgid "" "one of the first things :mod:`optparse` does is create the ``options`` " "object::" msgstr "" -#: ../../library/optparse.rst:969 +#: ../../library/optparse.rst:978 msgid "If one of the options in this parser is defined with ::" msgstr "" -#: ../../library/optparse.rst:973 +#: ../../library/optparse.rst:982 msgid "and the command-line being parsed includes any of the following::" msgstr "" -#: ../../library/optparse.rst:980 +#: ../../library/optparse.rst:989 msgid "" "then :mod:`optparse`, on seeing this option, will do the equivalent of ::" msgstr "" -#: ../../library/optparse.rst:984 +#: ../../library/optparse.rst:993 msgid "" "The :attr:`~Option.type` and :attr:`~Option.dest` option attributes are " "almost as important as :attr:`~Option.action`, but :attr:`~Option.action` is " "the only one that makes sense for *all* options." msgstr "" -#: ../../library/optparse.rst:992 +#: ../../library/optparse.rst:1001 msgid "Option attributes" msgstr "" -#: ../../library/optparse.rst:994 +#: ../../library/optparse.rst:1005 +msgid "" +"A single command line argument, with various attributes passed by keyword to " +"the constructor. Normally created with :meth:`OptionParser.add_option` " +"rather than directly, and can be overridden by a custom class via the " +"*option_class* argument to :class:`OptionParser`." +msgstr "" + +#: ../../library/optparse.rst:1011 msgid "" "The following option attributes may be passed as keyword arguments to :meth:" "`OptionParser.add_option`. If you pass an option attribute that is not " @@ -1197,33 +1217,33 @@ msgid "" "attribute, :mod:`optparse` raises :exc:`OptionError`." msgstr "" -#: ../../library/optparse.rst:1001 +#: ../../library/optparse.rst:1018 msgid "(default: ``\"store\"``)" msgstr "" -#: ../../library/optparse.rst:1003 +#: ../../library/optparse.rst:1020 msgid "" "Determines :mod:`optparse`'s behaviour when this option is seen on the " "command line; the available options are documented :ref:`here `." msgstr "" -#: ../../library/optparse.rst:1009 +#: ../../library/optparse.rst:1026 msgid "(default: ``\"string\"``)" msgstr "" -#: ../../library/optparse.rst:1011 +#: ../../library/optparse.rst:1028 msgid "" "The argument type expected by this option (e.g., ``\"string\"`` or " "``\"int\"``); the available option types are documented :ref:`here `." msgstr "" -#: ../../library/optparse.rst:1017 ../../library/optparse.rst:1067 +#: ../../library/optparse.rst:1034 ../../library/optparse.rst:1084 msgid "(default: derived from option strings)" msgstr "" -#: ../../library/optparse.rst:1019 +#: ../../library/optparse.rst:1036 msgid "" "If the option's action implies writing or modifying a value somewhere, this " "tells :mod:`optparse` where to write it: :attr:`~Option.dest` names an " @@ -1231,47 +1251,47 @@ msgid "" "the command line." msgstr "" -#: ../../library/optparse.rst:1026 +#: ../../library/optparse.rst:1043 msgid "" "The value to use for this option's destination if the option is not seen on " "the command line. See also :meth:`OptionParser.set_defaults`." msgstr "" -#: ../../library/optparse.rst:1031 +#: ../../library/optparse.rst:1048 msgid "(default: 1)" msgstr "" -#: ../../library/optparse.rst:1033 +#: ../../library/optparse.rst:1050 msgid "" "How many arguments of type :attr:`~Option.type` should be consumed when this " "option is seen. If > 1, :mod:`optparse` will store a tuple of values to :" "attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1039 +#: ../../library/optparse.rst:1056 msgid "For actions that store a constant value, the constant value to store." msgstr "" -#: ../../library/optparse.rst:1043 +#: ../../library/optparse.rst:1060 msgid "" "For options of type ``\"choice\"``, the list of strings the user may choose " "from." msgstr "" -#: ../../library/optparse.rst:1048 +#: ../../library/optparse.rst:1065 msgid "" "For options with action ``\"callback\"``, the callable to call when this " "option is seen. See section :ref:`optparse-option-callbacks` for detail on " "the arguments passed to the callable." msgstr "" -#: ../../library/optparse.rst:1055 +#: ../../library/optparse.rst:1072 msgid "" "Additional positional and keyword arguments to pass to ``callback`` after " "the four standard callback arguments." msgstr "" -#: ../../library/optparse.rst:1060 +#: ../../library/optparse.rst:1077 msgid "" "Help text to print for this option when listing all available options after " "the user supplies a :attr:`~Option.help` option (such as ``--help``). If no " @@ -1279,17 +1299,17 @@ msgid "" "this option, use the special value :data:`optparse.SUPPRESS_HELP`." msgstr "" -#: ../../library/optparse.rst:1069 +#: ../../library/optparse.rst:1086 msgid "" "Stand-in for the option argument(s) to use when printing help text. See " "section :ref:`optparse-tutorial` for an example." msgstr "" -#: ../../library/optparse.rst:1076 +#: ../../library/optparse.rst:1093 msgid "Standard option actions" msgstr "" -#: ../../library/optparse.rst:1078 +#: ../../library/optparse.rst:1095 msgid "" "The various option actions all have slightly different requirements and " "effects. Most actions have several relevant option attributes which you may " @@ -1297,13 +1317,13 @@ msgid "" "attributes, which you must specify for any option using that action." msgstr "" -#: ../../library/optparse.rst:1083 +#: ../../library/optparse.rst:1100 msgid "" "``\"store\"`` [relevant: :attr:`~Option.type`, :attr:`~Option.dest`, :attr:" "`~Option.nargs`, :attr:`~Option.choices`]" msgstr "" -#: ../../library/optparse.rst:1086 +#: ../../library/optparse.rst:1103 msgid "" "The option must be followed by an argument, which is converted to a value " "according to :attr:`~Option.type` and stored in :attr:`~Option.dest`. If :" @@ -1313,17 +1333,17 @@ msgid "" "option-types` section." msgstr "" -#: ../../library/optparse.rst:1093 +#: ../../library/optparse.rst:1110 msgid "" "If :attr:`~Option.choices` is supplied (a list or tuple of strings), the " "type defaults to ``\"choice\"``." msgstr "" -#: ../../library/optparse.rst:1096 +#: ../../library/optparse.rst:1113 msgid "If :attr:`~Option.type` is not supplied, it defaults to ``\"string\"``." msgstr "" -#: ../../library/optparse.rst:1098 +#: ../../library/optparse.rst:1115 msgid "" "If :attr:`~Option.dest` is not supplied, :mod:`optparse` derives a " "destination from the first long option string (e.g., ``--foo-bar`` implies " @@ -1331,62 +1351,62 @@ msgid "" "destination from the first short option string (e.g., ``-f`` implies ``f``)." msgstr "" -#: ../../library/optparse.rst:1103 ../../library/optparse.rst:1123 -#: ../../library/optparse.rst:1145 ../../library/optparse.rst:1163 -#: ../../library/optparse.rst:1202 ../../library/optparse.rst:1240 +#: ../../library/optparse.rst:1120 ../../library/optparse.rst:1140 +#: ../../library/optparse.rst:1162 ../../library/optparse.rst:1180 +#: ../../library/optparse.rst:1219 ../../library/optparse.rst:1257 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/optparse.rst:1108 +#: ../../library/optparse.rst:1125 msgid "As it parses the command line ::" msgstr "" -#: ../../library/optparse.rst:1112 +#: ../../library/optparse.rst:1129 msgid ":mod:`optparse` will set ::" msgstr "" -#: ../../library/optparse.rst:1118 +#: ../../library/optparse.rst:1135 msgid "" "``\"store_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1121 +#: ../../library/optparse.rst:1138 msgid "The value :attr:`~Option.const` is stored in :attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1132 +#: ../../library/optparse.rst:1149 msgid "If ``--noisy`` is seen, :mod:`optparse` will set ::" msgstr "" -#: ../../library/optparse.rst:1136 +#: ../../library/optparse.rst:1153 msgid "``\"store_true\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1138 +#: ../../library/optparse.rst:1155 msgid "" "A special case of ``\"store_const\"`` that stores ``True`` to :attr:`~Option." "dest`." msgstr "" -#: ../../library/optparse.rst:1141 +#: ../../library/optparse.rst:1158 msgid "``\"store_false\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1143 +#: ../../library/optparse.rst:1160 msgid "Like ``\"store_true\"``, but stores ``False``." msgstr "" -#: ../../library/optparse.rst:1150 +#: ../../library/optparse.rst:1167 msgid "" "``\"append\"`` [relevant: :attr:`~Option.type`, :attr:`~Option.dest`, :attr:" "`~Option.nargs`, :attr:`~Option.choices`]" msgstr "" -#: ../../library/optparse.rst:1153 +#: ../../library/optparse.rst:1170 msgid "" "The option must be followed by an argument, which is appended to the list " "in :attr:`~Option.dest`. If no default value for :attr:`~Option.dest` is " @@ -1396,23 +1416,23 @@ msgid "" "is appended to :attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1160 +#: ../../library/optparse.rst:1177 msgid "" "The defaults for :attr:`~Option.type` and :attr:`~Option.dest` are the same " "as for the ``\"store\"`` action." msgstr "" -#: ../../library/optparse.rst:1167 +#: ../../library/optparse.rst:1184 msgid "" "If ``-t3`` is seen on the command-line, :mod:`optparse` does the equivalent " "of::" msgstr "" -#: ../../library/optparse.rst:1173 +#: ../../library/optparse.rst:1190 msgid "If, a little later on, ``--tracks=4`` is seen, it does::" msgstr "" -#: ../../library/optparse.rst:1177 +#: ../../library/optparse.rst:1194 msgid "" "The ``append`` action calls the ``append`` method on the current value of " "the option. This means that any default value specified must have an " @@ -1421,13 +1441,13 @@ msgid "" "with any values from the command line appended after those default values::" msgstr "" -#: ../../library/optparse.rst:1188 +#: ../../library/optparse.rst:1205 msgid "" "``\"append_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1191 +#: ../../library/optparse.rst:1208 msgid "" "Like ``\"store_const\"``, but the value :attr:`~Option.const` is appended " "to :attr:`~Option.dest`; as with ``\"append\"``, :attr:`~Option.dest` " @@ -1435,45 +1455,45 @@ msgid "" "time the option is encountered." msgstr "" -#: ../../library/optparse.rst:1196 +#: ../../library/optparse.rst:1213 msgid "``\"count\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1198 +#: ../../library/optparse.rst:1215 msgid "" "Increment the integer stored at :attr:`~Option.dest`. If no default value " "is supplied, :attr:`~Option.dest` is set to zero before being incremented " "the first time." msgstr "" -#: ../../library/optparse.rst:1206 +#: ../../library/optparse.rst:1223 msgid "" "The first time ``-v`` is seen on the command line, :mod:`optparse` does the " "equivalent of::" msgstr "" -#: ../../library/optparse.rst:1212 +#: ../../library/optparse.rst:1229 msgid "Every subsequent occurrence of ``-v`` results in ::" msgstr "" -#: ../../library/optparse.rst:1216 +#: ../../library/optparse.rst:1233 msgid "" "``\"callback\"`` [required: :attr:`~Option.callback`; relevant: :attr:" "`~Option.type`, :attr:`~Option.nargs`, :attr:`~Option.callback_args`, :attr:" "`~Option.callback_kwargs`]" msgstr "" -#: ../../library/optparse.rst:1220 +#: ../../library/optparse.rst:1237 msgid "" "Call the function specified by :attr:`~Option.callback`, which is called " "as ::" msgstr "" -#: ../../library/optparse.rst:1224 +#: ../../library/optparse.rst:1241 msgid "See section :ref:`optparse-option-callbacks` for more detail." msgstr "更多細節請見 :ref:`optparse-option-callbacks`\\ 。" -#: ../../library/optparse.rst:1228 +#: ../../library/optparse.rst:1245 msgid "" "Prints a complete help message for all the options in the current option " "parser. The help message is constructed from the ``usage`` string passed to " @@ -1481,37 +1501,37 @@ msgid "" "every option." msgstr "" -#: ../../library/optparse.rst:1233 +#: ../../library/optparse.rst:1250 msgid "" "If no :attr:`~Option.help` string is supplied for an option, it will still " "be listed in the help message. To omit an option entirely, use the special " "value :data:`optparse.SUPPRESS_HELP`." msgstr "" -#: ../../library/optparse.rst:1237 +#: ../../library/optparse.rst:1254 msgid "" ":mod:`optparse` automatically adds a :attr:`~Option.help` option to all " "OptionParsers, so you do not normally need to create one." msgstr "" -#: ../../library/optparse.rst:1255 +#: ../../library/optparse.rst:1272 msgid "" "If :mod:`optparse` sees either ``-h`` or ``--help`` on the command line, it " "will print something like the following help message to stdout (assuming " "``sys.argv[0]`` is ``\"foo.py\"``):" msgstr "" -#: ../../library/optparse.rst:1268 +#: ../../library/optparse.rst:1285 msgid "" "After printing the help message, :mod:`optparse` terminates your process " "with ``sys.exit(0)``." msgstr "" -#: ../../library/optparse.rst:1271 +#: ../../library/optparse.rst:1288 msgid "``\"version\"``" msgstr "``\"version\"``" -#: ../../library/optparse.rst:1273 +#: ../../library/optparse.rst:1290 msgid "" "Prints the version number supplied to the OptionParser to stdout and exits. " "The version number is actually formatted and printed by the " @@ -1521,58 +1541,58 @@ msgid "" "since :mod:`optparse` automatically adds them when needed." msgstr "" -#: ../../library/optparse.rst:1284 +#: ../../library/optparse.rst:1301 msgid "Standard option types" msgstr "" -#: ../../library/optparse.rst:1286 +#: ../../library/optparse.rst:1303 msgid "" ":mod:`optparse` has five built-in option types: ``\"string\"``, ``\"int\"``, " "``\"choice\"``, ``\"float\"`` and ``\"complex\"``. If you need to add new " "option types, see section :ref:`optparse-extending-optparse`." msgstr "" -#: ../../library/optparse.rst:1290 +#: ../../library/optparse.rst:1307 msgid "" "Arguments to string options are not checked or converted in any way: the " "text on the command line is stored in the destination (or passed to the " "callback) as-is." msgstr "" -#: ../../library/optparse.rst:1293 +#: ../../library/optparse.rst:1310 msgid "Integer arguments (type ``\"int\"``) are parsed as follows:" msgstr "" -#: ../../library/optparse.rst:1295 +#: ../../library/optparse.rst:1312 msgid "if the number starts with ``0x``, it is parsed as a hexadecimal number" msgstr "" -#: ../../library/optparse.rst:1297 +#: ../../library/optparse.rst:1314 msgid "if the number starts with ``0``, it is parsed as an octal number" msgstr "" -#: ../../library/optparse.rst:1299 +#: ../../library/optparse.rst:1316 msgid "if the number starts with ``0b``, it is parsed as a binary number" msgstr "" -#: ../../library/optparse.rst:1301 +#: ../../library/optparse.rst:1318 msgid "otherwise, the number is parsed as a decimal number" msgstr "" -#: ../../library/optparse.rst:1304 +#: ../../library/optparse.rst:1321 msgid "" "The conversion is done by calling :func:`int` with the appropriate base (2, " "8, 10, or 16). If this fails, so will :mod:`optparse`, although with a more " "useful error message." msgstr "" -#: ../../library/optparse.rst:1308 +#: ../../library/optparse.rst:1325 msgid "" "``\"float\"`` and ``\"complex\"`` option arguments are converted directly " "with :func:`float` and :func:`complex`, with similar error-handling." msgstr "" -#: ../../library/optparse.rst:1311 +#: ../../library/optparse.rst:1328 msgid "" "``\"choice\"`` options are a subtype of ``\"string\"`` options. The :attr:" "`~Option.choices` option attribute (a sequence of strings) defines the set " @@ -1581,59 +1601,59 @@ msgid "" "`OptionValueError` if an invalid string is given." msgstr "" -#: ../../library/optparse.rst:1321 +#: ../../library/optparse.rst:1338 msgid "Parsing arguments" msgstr "" -#: ../../library/optparse.rst:1323 +#: ../../library/optparse.rst:1340 msgid "" "The whole point of creating and populating an OptionParser is to call its :" "meth:`parse_args` method::" msgstr "" -#: ../../library/optparse.rst:1328 +#: ../../library/optparse.rst:1345 msgid "where the input parameters are" msgstr "" -#: ../../library/optparse.rst:1331 ../../library/optparse.rst:1345 -#: ../../library/optparse.rst:1664 +#: ../../library/optparse.rst:1348 ../../library/optparse.rst:1362 +#: ../../library/optparse.rst:1681 msgid "``args``" msgstr "``args``" -#: ../../library/optparse.rst:1331 +#: ../../library/optparse.rst:1348 msgid "the list of arguments to process (default: ``sys.argv[1:]``)" msgstr "" -#: ../../library/optparse.rst:1336 +#: ../../library/optparse.rst:1353 msgid "``values``" msgstr "``values``" -#: ../../library/optparse.rst:1334 +#: ../../library/optparse.rst:1351 msgid "" "an :class:`optparse.Values` object to store option arguments in (default: a " "new instance of :class:`Values`) -- if you give an existing object, the " "option defaults will not be initialized on it" msgstr "" -#: ../../library/optparse.rst:1338 +#: ../../library/optparse.rst:1355 msgid "and the return values are" msgstr "" -#: ../../library/optparse.rst:1342 +#: ../../library/optparse.rst:1359 msgid "``options``" msgstr "``options``" -#: ../../library/optparse.rst:1341 +#: ../../library/optparse.rst:1358 msgid "" "the same object that was passed in as ``values``, or the optparse.Values " "instance created by :mod:`optparse`" msgstr "" -#: ../../library/optparse.rst:1345 +#: ../../library/optparse.rst:1362 msgid "the leftover positional arguments after all options have been processed" msgstr "" -#: ../../library/optparse.rst:1347 +#: ../../library/optparse.rst:1364 msgid "" "The most common usage is to supply neither keyword argument. If you supply " "``values``, it will be modified with repeated :func:`setattr` calls (roughly " @@ -1641,7 +1661,7 @@ msgid "" "by :meth:`parse_args`." msgstr "" -#: ../../library/optparse.rst:1352 +#: ../../library/optparse.rst:1369 msgid "" "If :meth:`parse_args` encounters any errors in the argument list, it calls " "the OptionParser's :meth:`error` method with an appropriate end-user error " @@ -1649,61 +1669,61 @@ msgid "" "(the traditional Unix exit status for command-line errors)." msgstr "" -#: ../../library/optparse.rst:1361 +#: ../../library/optparse.rst:1378 msgid "Querying and manipulating your option parser" msgstr "" -#: ../../library/optparse.rst:1363 +#: ../../library/optparse.rst:1380 msgid "" "The default behavior of the option parser can be customized slightly, and " "you can also poke around your option parser and see what's there. " "OptionParser provides several methods to help you out:" msgstr "" -#: ../../library/optparse.rst:1369 +#: ../../library/optparse.rst:1386 msgid "" "Set parsing to stop on the first non-option. For example, if ``-a`` and ``-" "b`` are both simple options that take no arguments, :mod:`optparse` normally " "accepts this syntax::" msgstr "" -#: ../../library/optparse.rst:1375 +#: ../../library/optparse.rst:1392 msgid "and treats it as equivalent to ::" msgstr "" -#: ../../library/optparse.rst:1379 +#: ../../library/optparse.rst:1396 msgid "" "To disable this feature, call :meth:`disable_interspersed_args`. This " "restores traditional Unix syntax, where option parsing stops with the first " "non-option argument." msgstr "" -#: ../../library/optparse.rst:1383 +#: ../../library/optparse.rst:1400 msgid "" "Use this if you have a command processor which runs another command which " "has options of its own and you want to make sure these options don't get " "confused. For example, each command might have a different set of options." msgstr "" -#: ../../library/optparse.rst:1389 +#: ../../library/optparse.rst:1406 msgid "" "Set parsing to not stop on the first non-option, allowing interspersing " "switches with command arguments. This is the default behavior." msgstr "" -#: ../../library/optparse.rst:1394 +#: ../../library/optparse.rst:1411 msgid "" "Returns the Option instance with the option string *opt_str*, or ``None`` if " "no options have that option string." msgstr "" -#: ../../library/optparse.rst:1399 +#: ../../library/optparse.rst:1416 msgid "" "Return ``True`` if the OptionParser has an option with option string " "*opt_str* (e.g., ``-q`` or ``--verbose``)." msgstr "" -#: ../../library/optparse.rst:1404 +#: ../../library/optparse.rst:1421 msgid "" "If the :class:`OptionParser` has an option corresponding to *opt_str*, that " "option is removed. If that option provided any other option strings, all of " @@ -1711,23 +1731,23 @@ msgid "" "option belonging to this :class:`OptionParser`, raises :exc:`ValueError`." msgstr "" -#: ../../library/optparse.rst:1413 +#: ../../library/optparse.rst:1430 msgid "Conflicts between options" msgstr "" -#: ../../library/optparse.rst:1415 +#: ../../library/optparse.rst:1432 msgid "" "If you're not careful, it's easy to define options with conflicting option " "strings::" msgstr "" -#: ../../library/optparse.rst:1422 +#: ../../library/optparse.rst:1439 msgid "" "(This is particularly true if you've defined your own OptionParser subclass " "with some standard options.)" msgstr "" -#: ../../library/optparse.rst:1425 +#: ../../library/optparse.rst:1442 msgid "" "Every time you add an option, :mod:`optparse` checks for conflicts with " "existing options. If it finds any, it invokes the current conflict-handling " @@ -1735,39 +1755,39 @@ msgid "" "constructor::" msgstr "" -#: ../../library/optparse.rst:1431 +#: ../../library/optparse.rst:1448 msgid "or with a separate call::" msgstr "" -#: ../../library/optparse.rst:1435 +#: ../../library/optparse.rst:1452 msgid "The available conflict handlers are:" msgstr "" -#: ../../library/optparse.rst:1439 +#: ../../library/optparse.rst:1456 msgid "``\"error\"`` (default)" msgstr "" -#: ../../library/optparse.rst:1438 +#: ../../library/optparse.rst:1455 msgid "" "assume option conflicts are a programming error and raise :exc:" "`OptionConflictError`" msgstr "" -#: ../../library/optparse.rst:1443 +#: ../../library/optparse.rst:1460 msgid "``\"resolve\"``" msgstr "``\"resolve\"``" -#: ../../library/optparse.rst:1442 +#: ../../library/optparse.rst:1459 msgid "resolve option conflicts intelligently (see below)" msgstr "" -#: ../../library/optparse.rst:1445 +#: ../../library/optparse.rst:1462 msgid "" "As an example, let's define an :class:`OptionParser` that resolves conflicts " "intelligently and add conflicting options to it::" msgstr "" -#: ../../library/optparse.rst:1452 +#: ../../library/optparse.rst:1469 msgid "" "At this point, :mod:`optparse` detects that a previously added option is " "already using the ``-n`` option string. Since ``conflict_handler`` is " @@ -1777,7 +1797,7 @@ msgid "" "message will reflect that::" msgstr "" -#: ../../library/optparse.rst:1463 +#: ../../library/optparse.rst:1480 msgid "" "It's possible to whittle away the option strings for a previously added " "option until there are none left, and the user has no way of invoking that " @@ -1786,17 +1806,17 @@ msgid "" "Carrying on with our existing OptionParser::" msgstr "" -#: ../../library/optparse.rst:1471 +#: ../../library/optparse.rst:1488 msgid "" "At this point, the original ``-n``/``--dry-run`` option is no longer " "accessible, so :mod:`optparse` removes it, leaving this help text::" msgstr "" -#: ../../library/optparse.rst:1483 +#: ../../library/optparse.rst:1500 msgid "Cleanup" msgstr "" -#: ../../library/optparse.rst:1485 +#: ../../library/optparse.rst:1502 msgid "" "OptionParser instances have several cyclic references. This should not be a " "problem for Python's garbage collector, but you may wish to break the cyclic " @@ -1806,15 +1826,15 @@ msgid "" "OptionParser." msgstr "" -#: ../../library/optparse.rst:1496 +#: ../../library/optparse.rst:1513 msgid "Other methods" msgstr "" -#: ../../library/optparse.rst:1498 +#: ../../library/optparse.rst:1515 msgid "OptionParser supports several other public methods:" msgstr "" -#: ../../library/optparse.rst:1502 +#: ../../library/optparse.rst:1519 msgid "" "Set the usage string according to the rules described above for the " "``usage`` constructor keyword argument. Passing ``None`` sets the default " @@ -1822,7 +1842,7 @@ msgid "" "message." msgstr "" -#: ../../library/optparse.rst:1508 +#: ../../library/optparse.rst:1525 msgid "" "Print the usage message for the current program (``self.usage``) to *file* " "(default stdout). Any occurrence of the string ``%prog`` in ``self.usage`` " @@ -1830,13 +1850,13 @@ msgid "" "usage`` is empty or not defined." msgstr "" -#: ../../library/optparse.rst:1515 +#: ../../library/optparse.rst:1532 msgid "" "Same as :meth:`print_usage` but returns the usage string instead of printing " "it." msgstr "" -#: ../../library/optparse.rst:1520 +#: ../../library/optparse.rst:1537 msgid "" "Set default values for several option destinations at once. Using :meth:" "`set_defaults` is the preferred way to set default values for options, since " @@ -1845,15 +1865,15 @@ msgid "" "default, and the last one wins::" msgstr "" -#: ../../library/optparse.rst:1533 +#: ../../library/optparse.rst:1550 msgid "To avoid this confusion, use :meth:`set_defaults`::" msgstr "" -#: ../../library/optparse.rst:1545 +#: ../../library/optparse.rst:1562 msgid "Option Callbacks" msgstr "" -#: ../../library/optparse.rst:1547 +#: ../../library/optparse.rst:1564 msgid "" "When :mod:`optparse`'s built-in actions and types aren't quite enough for " "your needs, you have two choices: extend :mod:`optparse` or define a " @@ -1861,25 +1881,25 @@ msgid "" "a lot of simple cases. Quite often a simple callback is all you need." msgstr "" -#: ../../library/optparse.rst:1552 +#: ../../library/optparse.rst:1569 msgid "There are two steps to defining a callback option:" msgstr "" -#: ../../library/optparse.rst:1554 +#: ../../library/optparse.rst:1571 msgid "define the option itself using the ``\"callback\"`` action" msgstr "" -#: ../../library/optparse.rst:1556 +#: ../../library/optparse.rst:1573 msgid "" "write the callback; this is a function (or method) that takes at least four " "arguments, as described below" msgstr "" -#: ../../library/optparse.rst:1563 +#: ../../library/optparse.rst:1580 msgid "Defining a callback option" msgstr "" -#: ../../library/optparse.rst:1565 +#: ../../library/optparse.rst:1582 msgid "" "As always, the easiest way to define a callback option is by using the :meth:" "`OptionParser.add_option` method. Apart from :attr:`~Option.action`, the " @@ -1887,7 +1907,7 @@ msgid "" "call::" msgstr "" -#: ../../library/optparse.rst:1571 +#: ../../library/optparse.rst:1588 msgid "" "``callback`` is a function (or other callable object), so you must have " "already defined ``my_callback()`` when you create this callback option. In " @@ -1899,7 +1919,7 @@ msgid "" "tricky; it's covered later in this section." msgstr "" -#: ../../library/optparse.rst:1580 +#: ../../library/optparse.rst:1597 msgid "" ":mod:`optparse` always passes four particular arguments to your callback, " "and it will only pass additional arguments if you specify them via :attr:" @@ -1907,21 +1927,21 @@ msgid "" "minimal callback function signature is::" msgstr "" -#: ../../library/optparse.rst:1587 +#: ../../library/optparse.rst:1604 msgid "The four arguments to a callback are described below." msgstr "" -#: ../../library/optparse.rst:1589 +#: ../../library/optparse.rst:1606 msgid "" "There are several other option attributes that you can supply when you " "define a callback option:" msgstr "" -#: ../../library/optparse.rst:1596 +#: ../../library/optparse.rst:1613 msgid ":attr:`~Option.type`" msgstr ":attr:`~Option.type`" -#: ../../library/optparse.rst:1593 +#: ../../library/optparse.rst:1610 msgid "" "has its usual meaning: as with the ``\"store\"`` or ``\"append\"`` actions, " "it instructs :mod:`optparse` to consume one argument and convert it to :attr:" @@ -1929,11 +1949,11 @@ msgid "" "though, :mod:`optparse` passes it to your callback function." msgstr "" -#: ../../library/optparse.rst:1602 +#: ../../library/optparse.rst:1619 msgid ":attr:`~Option.nargs`" msgstr ":attr:`~Option.nargs`" -#: ../../library/optparse.rst:1599 +#: ../../library/optparse.rst:1616 msgid "" "also has its usual meaning: if it is supplied and > 1, :mod:`optparse` will " "consume :attr:`~Option.nargs` arguments, each of which must be convertible " @@ -1941,43 +1961,43 @@ msgid "" "callback." msgstr "" -#: ../../library/optparse.rst:1605 +#: ../../library/optparse.rst:1622 msgid ":attr:`~Option.callback_args`" msgstr ":attr:`~Option.callback_args`" -#: ../../library/optparse.rst:1605 +#: ../../library/optparse.rst:1622 msgid "a tuple of extra positional arguments to pass to the callback" msgstr "" -#: ../../library/optparse.rst:1609 +#: ../../library/optparse.rst:1626 msgid ":attr:`~Option.callback_kwargs`" msgstr ":attr:`~Option.callback_kwargs`" -#: ../../library/optparse.rst:1608 +#: ../../library/optparse.rst:1625 msgid "a dictionary of extra keyword arguments to pass to the callback" msgstr "" -#: ../../library/optparse.rst:1614 +#: ../../library/optparse.rst:1631 msgid "How callbacks are called" msgstr "" -#: ../../library/optparse.rst:1616 +#: ../../library/optparse.rst:1633 msgid "All callbacks are called as follows::" msgstr "" -#: ../../library/optparse.rst:1623 +#: ../../library/optparse.rst:1640 msgid "``option``" msgstr "``option``" -#: ../../library/optparse.rst:1623 +#: ../../library/optparse.rst:1640 msgid "is the Option instance that's calling the callback" msgstr "" -#: ../../library/optparse.rst:1630 +#: ../../library/optparse.rst:1647 msgid "``opt_str``" msgstr "``opt_str``" -#: ../../library/optparse.rst:1626 +#: ../../library/optparse.rst:1643 msgid "" "is the option string seen on the command-line that's triggering the " "callback. (If an abbreviated long option was used, ``opt_str`` will be the " @@ -1986,11 +2006,11 @@ msgid "" "``\"--foobar\"``.)" msgstr "" -#: ../../library/optparse.rst:1637 +#: ../../library/optparse.rst:1654 msgid "``value``" msgstr "``value``" -#: ../../library/optparse.rst:1633 +#: ../../library/optparse.rst:1650 msgid "" "is the argument to this option seen on the command-line. :mod:`optparse` " "will only expect an argument if :attr:`~Option.type` is set; the type of " @@ -2000,21 +2020,21 @@ msgid "" "of values of the appropriate type." msgstr "" -#: ../../library/optparse.rst:1660 +#: ../../library/optparse.rst:1677 msgid "``parser``" msgstr "``parser``" -#: ../../library/optparse.rst:1640 +#: ../../library/optparse.rst:1657 msgid "" "is the OptionParser instance driving the whole thing, mainly useful because " "you can access some other interesting data through its instance attributes:" msgstr "" -#: ../../library/optparse.rst:1647 +#: ../../library/optparse.rst:1664 msgid "``parser.largs``" msgstr "``parser.largs``" -#: ../../library/optparse.rst:1644 +#: ../../library/optparse.rst:1661 msgid "" "the current list of leftover arguments, ie. arguments that have been " "consumed but are neither options nor option arguments. Feel free to modify " @@ -2022,22 +2042,22 @@ msgid "" "become ``args``, the second return value of :meth:`parse_args`.)" msgstr "" -#: ../../library/optparse.rst:1653 +#: ../../library/optparse.rst:1670 msgid "``parser.rargs``" msgstr "``parser.rargs``" -#: ../../library/optparse.rst:1650 +#: ../../library/optparse.rst:1667 msgid "" "the current list of remaining arguments, ie. with ``opt_str`` and ``value`` " "(if applicable) removed, and only the arguments following them still there. " "Feel free to modify ``parser.rargs``, e.g. by consuming more arguments." msgstr "" -#: ../../library/optparse.rst:1660 +#: ../../library/optparse.rst:1677 msgid "``parser.values``" msgstr "``parser.values``" -#: ../../library/optparse.rst:1656 +#: ../../library/optparse.rst:1673 msgid "" "the object where option values are by default stored (an instance of " "optparse.OptionValues). This lets callbacks use the same mechanism as the " @@ -2046,27 +2066,27 @@ msgid "" "of any options already encountered on the command-line." msgstr "" -#: ../../library/optparse.rst:1663 +#: ../../library/optparse.rst:1680 msgid "" "is a tuple of arbitrary positional arguments supplied via the :attr:`~Option." "callback_args` option attribute." msgstr "" -#: ../../library/optparse.rst:1669 +#: ../../library/optparse.rst:1686 msgid "``kwargs``" msgstr "``kwargs``" -#: ../../library/optparse.rst:1667 +#: ../../library/optparse.rst:1684 msgid "" "is a dictionary of arbitrary keyword arguments supplied via :attr:`~Option." "callback_kwargs`." msgstr "" -#: ../../library/optparse.rst:1674 +#: ../../library/optparse.rst:1691 msgid "Raising errors in a callback" msgstr "" -#: ../../library/optparse.rst:1676 +#: ../../library/optparse.rst:1693 msgid "" "The callback function should raise :exc:`OptionValueError` if there are any " "problems with the option or its argument(s). :mod:`optparse` catches this " @@ -2076,46 +2096,46 @@ msgid "" "they did wrong." msgstr "" -#: ../../library/optparse.rst:1686 +#: ../../library/optparse.rst:1703 msgid "Callback example 1: trivial callback" msgstr "" -#: ../../library/optparse.rst:1688 +#: ../../library/optparse.rst:1705 msgid "" "Here's an example of a callback option that takes no arguments, and simply " "records that the option was seen::" msgstr "" -#: ../../library/optparse.rst:1696 +#: ../../library/optparse.rst:1713 msgid "Of course, you could do that with the ``\"store_true\"`` action." msgstr "" -#: ../../library/optparse.rst:1702 +#: ../../library/optparse.rst:1719 msgid "Callback example 2: check option order" msgstr "" -#: ../../library/optparse.rst:1704 +#: ../../library/optparse.rst:1721 msgid "" "Here's a slightly more interesting example: record the fact that ``-a`` is " "seen, but blow up if it comes after ``-b`` in the command-line. ::" msgstr "" -#: ../../library/optparse.rst:1719 +#: ../../library/optparse.rst:1736 msgid "Callback example 3: check option order (generalized)" msgstr "" -#: ../../library/optparse.rst:1721 +#: ../../library/optparse.rst:1738 msgid "" "If you want to re-use this callback for several similar options (set a flag, " "but blow up if ``-b`` has already been seen), it needs a bit of work: the " "error message and the flag that it sets must be generalized. ::" msgstr "" -#: ../../library/optparse.rst:1738 +#: ../../library/optparse.rst:1755 msgid "Callback example 4: check arbitrary condition" msgstr "" -#: ../../library/optparse.rst:1740 +#: ../../library/optparse.rst:1757 msgid "" "Of course, you could put any condition in there---you're not limited to " "checking the values of already-defined options. For example, if you have " @@ -2123,16 +2143,16 @@ msgid "" "is this::" msgstr "" -#: ../../library/optparse.rst:1753 +#: ../../library/optparse.rst:1770 msgid "" "(The definition of ``is_moon_full()`` is left as an exercise for the reader.)" msgstr "" -#: ../../library/optparse.rst:1759 +#: ../../library/optparse.rst:1776 msgid "Callback example 5: fixed arguments" msgstr "" -#: ../../library/optparse.rst:1761 +#: ../../library/optparse.rst:1778 msgid "" "Things get slightly more interesting when you define callback options that " "take a fixed number of arguments. Specifying that a callback option takes " @@ -2142,23 +2162,23 @@ msgid "" "nargs`, then the option takes :attr:`~Option.nargs` arguments." msgstr "" -#: ../../library/optparse.rst:1768 +#: ../../library/optparse.rst:1785 msgid "" "Here's an example that just emulates the standard ``\"store\"`` action::" msgstr "" -#: ../../library/optparse.rst:1777 +#: ../../library/optparse.rst:1794 msgid "" "Note that :mod:`optparse` takes care of consuming 3 arguments and converting " "them to integers for you; all you have to do is store them. (Or whatever; " "obviously you don't need a callback for this example.)" msgstr "" -#: ../../library/optparse.rst:1785 +#: ../../library/optparse.rst:1802 msgid "Callback example 6: variable arguments" msgstr "" -#: ../../library/optparse.rst:1787 +#: ../../library/optparse.rst:1804 msgid "" "Things get hairy when you want an option to take a variable number of " "arguments. For this case, you must write a callback, as :mod:`optparse` " @@ -2168,23 +2188,23 @@ msgid "" "implement the conventional rules for bare ``--`` and ``-`` arguments:" msgstr "" -#: ../../library/optparse.rst:1794 +#: ../../library/optparse.rst:1811 msgid "either ``--`` or ``-`` can be option arguments" msgstr "" -#: ../../library/optparse.rst:1796 +#: ../../library/optparse.rst:1813 msgid "" "bare ``--`` (if not the argument to some option): halt command-line " "processing and discard the ``--``" msgstr "" -#: ../../library/optparse.rst:1799 +#: ../../library/optparse.rst:1816 msgid "" "bare ``-`` (if not the argument to some option): halt command-line " "processing but keep the ``-`` (append it to ``parser.largs``)" msgstr "" -#: ../../library/optparse.rst:1802 +#: ../../library/optparse.rst:1819 msgid "" "If you want an option that takes a variable number of arguments, there are " "several subtle, tricky issues to worry about. The exact implementation you " @@ -2193,28 +2213,28 @@ msgid "" "directly)." msgstr "" -#: ../../library/optparse.rst:1808 +#: ../../library/optparse.rst:1825 msgid "" "Nevertheless, here's a stab at a callback for an option with variable " "arguments::" msgstr "" -#: ../../library/optparse.rst:1842 +#: ../../library/optparse.rst:1859 msgid "Extending :mod:`optparse`" msgstr "" -#: ../../library/optparse.rst:1844 +#: ../../library/optparse.rst:1861 msgid "" "Since the two major controlling factors in how :mod:`optparse` interprets " "command-line options are the action and type of each option, the most likely " "direction of extension is to add new actions and new types." msgstr "" -#: ../../library/optparse.rst:1852 +#: ../../library/optparse.rst:1869 msgid "Adding new types" msgstr "" -#: ../../library/optparse.rst:1854 +#: ../../library/optparse.rst:1871 msgid "" "To add new types, you need to define your own subclass of :mod:`optparse`'s :" "class:`Option` class. This class has a couple of attributes that define :" @@ -2222,19 +2242,19 @@ msgid "" "TYPE_CHECKER`." msgstr "" -#: ../../library/optparse.rst:1860 +#: ../../library/optparse.rst:1877 msgid "" "A tuple of type names; in your subclass, simply define a new tuple :attr:" "`TYPES` that builds on the standard one." msgstr "" -#: ../../library/optparse.rst:1865 +#: ../../library/optparse.rst:1882 msgid "" "A dictionary mapping type names to type-checking functions. A type-checking " "function has the following signature::" msgstr "" -#: ../../library/optparse.rst:1870 +#: ../../library/optparse.rst:1887 msgid "" "where ``option`` is an :class:`Option` instance, ``opt`` is an option string " "(e.g., ``-f``), and ``value`` is the string from the command line that must " @@ -2245,7 +2265,7 @@ msgid "" "``value`` parameter." msgstr "" -#: ../../library/optparse.rst:1878 +#: ../../library/optparse.rst:1895 msgid "" "Your type-checking function should raise :exc:`OptionValueError` if it " "encounters any problems. :exc:`OptionValueError` takes a single string " @@ -2254,7 +2274,7 @@ msgid "" "\"`` and prints everything to stderr before terminating the process." msgstr "" -#: ../../library/optparse.rst:1884 +#: ../../library/optparse.rst:1901 msgid "" "Here's a silly example that demonstrates adding a ``\"complex\"`` option " "type to parse Python-style complex numbers on the command line. (This is " @@ -2262,21 +2282,21 @@ msgid "" "support for complex numbers, but never mind.)" msgstr "" -#: ../../library/optparse.rst:1889 +#: ../../library/optparse.rst:1906 msgid "First, the necessary imports::" msgstr "" -#: ../../library/optparse.rst:1894 +#: ../../library/optparse.rst:1911 msgid "" "You need to define your type-checker first, since it's referred to later (in " "the :attr:`~Option.TYPE_CHECKER` class attribute of your Option subclass)::" msgstr "" -#: ../../library/optparse.rst:1904 +#: ../../library/optparse.rst:1921 msgid "Finally, the Option subclass::" msgstr "" -#: ../../library/optparse.rst:1911 +#: ../../library/optparse.rst:1928 msgid "" "(If we didn't make a :func:`copy` of :attr:`Option.TYPE_CHECKER`, we would " "end up modifying the :attr:`~Option.TYPE_CHECKER` attribute of :mod:" @@ -2284,46 +2304,46 @@ msgid "" "that except good manners and common sense.)" msgstr "" -#: ../../library/optparse.rst:1916 +#: ../../library/optparse.rst:1933 msgid "" "That's it! Now you can write a script that uses the new option type just " "like any other :mod:`optparse`\\ -based script, except you have to instruct " "your OptionParser to use MyOption instead of Option::" msgstr "" -#: ../../library/optparse.rst:1923 +#: ../../library/optparse.rst:1940 msgid "" "Alternately, you can build your own option list and pass it to OptionParser; " "if you don't use :meth:`add_option` in the above way, you don't need to tell " "OptionParser which option class to use::" msgstr "" -#: ../../library/optparse.rst:1934 +#: ../../library/optparse.rst:1951 msgid "Adding new actions" msgstr "" -#: ../../library/optparse.rst:1936 +#: ../../library/optparse.rst:1953 msgid "" "Adding new actions is a bit trickier, because you have to understand that :" "mod:`optparse` has a couple of classifications for actions:" msgstr "" -#: ../../library/optparse.rst:1942 +#: ../../library/optparse.rst:1959 msgid "\"store\" actions" msgstr "" -#: ../../library/optparse.rst:1940 +#: ../../library/optparse.rst:1957 msgid "" "actions that result in :mod:`optparse` storing a value to an attribute of " "the current OptionValues instance; these options require a :attr:`~Option." "dest` attribute to be supplied to the Option constructor." msgstr "" -#: ../../library/optparse.rst:1948 +#: ../../library/optparse.rst:1965 msgid "\"typed\" actions" msgstr "" -#: ../../library/optparse.rst:1945 +#: ../../library/optparse.rst:1962 msgid "" "actions that take a value from the command line and expect it to be of a " "certain type; or rather, a string that can be converted to a certain type. " @@ -2331,7 +2351,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/optparse.rst:1950 +#: ../../library/optparse.rst:1967 msgid "" "These are overlapping sets: some default \"store\" actions are " "``\"store\"``, ``\"store_const\"``, ``\"append\"``, and ``\"count\"``, while " @@ -2339,25 +2359,25 @@ msgid "" "``\"callback\"``." msgstr "" -#: ../../library/optparse.rst:1954 +#: ../../library/optparse.rst:1971 msgid "" "When you add an action, you need to categorize it by listing it in at least " "one of the following class attributes of Option (all are lists of strings):" msgstr "" -#: ../../library/optparse.rst:1959 +#: ../../library/optparse.rst:1976 msgid "All actions must be listed in ACTIONS." msgstr "" -#: ../../library/optparse.rst:1963 +#: ../../library/optparse.rst:1980 msgid "\"store\" actions are additionally listed here." msgstr "" -#: ../../library/optparse.rst:1967 +#: ../../library/optparse.rst:1984 msgid "\"typed\" actions are additionally listed here." msgstr "" -#: ../../library/optparse.rst:1971 +#: ../../library/optparse.rst:1988 msgid "" "Actions that always take a type (i.e. whose options always take a value) are " "additionally listed here. The only effect of this is that :mod:`optparse` " @@ -2365,13 +2385,13 @@ msgid "" "whose action is listed in :attr:`ALWAYS_TYPED_ACTIONS`." msgstr "" -#: ../../library/optparse.rst:1976 +#: ../../library/optparse.rst:1993 msgid "" "In order to actually implement your new action, you must override Option's :" "meth:`take_action` method and add a case that recognizes your action." msgstr "" -#: ../../library/optparse.rst:1979 +#: ../../library/optparse.rst:1996 msgid "" "For example, let's add an ``\"extend\"`` action. This is similar to the " "standard ``\"append\"`` action, but instead of taking a single value from " @@ -2381,47 +2401,47 @@ msgid "" "option of type ``\"string\"``, the command line ::" msgstr "" -#: ../../library/optparse.rst:1988 +#: ../../library/optparse.rst:2005 msgid "would result in a list ::" msgstr "" -#: ../../library/optparse.rst:1992 +#: ../../library/optparse.rst:2009 msgid "Again we define a subclass of Option::" msgstr "" -#: ../../library/optparse.rst:2009 +#: ../../library/optparse.rst:2026 msgid "Features of note:" msgstr "" -#: ../../library/optparse.rst:2011 +#: ../../library/optparse.rst:2028 msgid "" "``\"extend\"`` both expects a value on the command-line and stores that " "value somewhere, so it goes in both :attr:`~Option.STORE_ACTIONS` and :attr:" "`~Option.TYPED_ACTIONS`." msgstr "" -#: ../../library/optparse.rst:2015 +#: ../../library/optparse.rst:2032 msgid "" "to ensure that :mod:`optparse` assigns the default type of ``\"string\"`` to " "``\"extend\"`` actions, we put the ``\"extend\"`` action in :attr:`~Option." "ALWAYS_TYPED_ACTIONS` as well." msgstr "" -#: ../../library/optparse.rst:2019 +#: ../../library/optparse.rst:2036 msgid "" ":meth:`MyOption.take_action` implements just this one new action, and passes " "control back to :meth:`Option.take_action` for the standard :mod:`optparse` " "actions." msgstr "" -#: ../../library/optparse.rst:2023 +#: ../../library/optparse.rst:2040 msgid "" "``values`` is an instance of the optparse_parser.Values class, which " "provides the very useful :meth:`ensure_value` method. :meth:`ensure_value` " "is essentially :func:`getattr` with a safety valve; it is called as ::" msgstr "" -#: ../../library/optparse.rst:2029 +#: ../../library/optparse.rst:2046 msgid "" "If the ``attr`` attribute of ``values`` doesn't exist or is ``None``, then " "ensure_value() first sets it to ``value``, and then returns 'value. This is " @@ -2433,3 +2453,29 @@ msgid "" "destinations in question; they can just leave the default as ``None`` and :" "meth:`ensure_value` will take care of getting it right when it's needed." msgstr "" + +#: ../../library/optparse.rst:2057 +msgid "Exceptions" +msgstr "" + +#: ../../library/optparse.rst:2061 +msgid "" +"Raised if an :class:`Option` instance is created with invalid or " +"inconsistent arguments." +msgstr "" + +#: ../../library/optparse.rst:2066 +msgid "Raised if conflicting options are added to an :class:`OptionParser`." +msgstr "" + +#: ../../library/optparse.rst:2070 +msgid "Raised if an invalid option value is encountered on the command line." +msgstr "" + +#: ../../library/optparse.rst:2074 +msgid "Raised if an invalid option is passed on the command line." +msgstr "" + +#: ../../library/optparse.rst:2078 +msgid "Raised if an ambiguous option is passed on the command line." +msgstr "" diff --git a/library/pkgutil.po b/library/pkgutil.po index 65992f17d2..5994f9d12d 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-04-25 00:20+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,7 +114,8 @@ msgstr "" msgid "" "This is a backwards compatibility wrapper around :func:`importlib.util." "find_spec` that converts most failures to :exc:`ImportError` and only " -"returns the loader rather than the full :class:`ModuleSpec`." +"returns the loader rather than the full :class:`importlib.machinery." +"ModuleSpec`." msgstr "" #: ../../library/pkgutil.rst:87 ../../library/pkgutil.rst:104 diff --git a/library/sys.po b/library/sys.po index eca0748f39..d04f6dc979 100644 --- a/library/sys.po +++ b/library/sys.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-24 00:16+0000\n" -"PO-Revision-Date: 2018-05-23 16:12+0000\n" +"PO-Revision-Date: 2023-04-25 11:04+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,10 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.2.2\n" #: ../../library/sys.rst:2 msgid ":mod:`sys` --- System-specific parameters and functions" -msgstr "" +msgstr ":mod:`sys` --- 系統特定的參數與函式" #: ../../library/sys.rst:9 msgid "" @@ -89,6 +90,8 @@ msgid "" "See the :ref:`audit events table ` for all events raised by " "CPython, and :pep:`578` for the original design discussion." msgstr "" +"所有會被 CPython 所引發的事件請參考\\ :ref:`稽核事件總表 `、設計相關討" +"論請見 :pep:`578`。" #: ../../library/sys.rst:63 msgid "" @@ -145,6 +148,7 @@ msgid "" "For example, one auditing event is named ``os.chdir``. This event has one " "argument called *path* that will contain the requested new working directory." msgstr "" +"舉例來說,一個名為 ``os.chdir`` 的稽核事件擁有一個引數 *path*,其內容為所要求的新工作目錄。" #: ../../library/sys.rst:109 msgid "" @@ -173,6 +177,7 @@ msgid "" "See the :ref:`audit events table ` for all events raised by " "CPython." msgstr "" +"所有會被 CPython 所引發的事件請參考\\ :ref:`稽核事件總表 `。" #: ../../library/sys.rst:131 msgid "" @@ -278,6 +283,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." msgstr "" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." +"_current_exceptions``。" #: ../../library/sys.rst:225 msgid "" @@ -421,6 +428,8 @@ msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." msgstr "" +"運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js " +"v14.18.2'`` 或 ``'UNKNOWN'``。" #: ../../library/sys.rst:343 msgid ":const:`pthreads`" @@ -487,6 +496,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." msgstr "" +"引發一個附帶引數 ``hook``、``type``、``value``、``traceback`` 的\\ :ref:`稽核" +"事件 ` ``sys.excepthook``。" #: ../../library/sys.rst:388 msgid "" @@ -634,11 +645,11 @@ msgstr "" #: ../../library/sys.rst:515 ../../library/sys.rst:572 #: ../../library/sys.rst:925 msgid "attribute" -msgstr "" +msgstr "屬性" #: ../../library/sys.rst:515 msgid "flag" -msgstr "" +msgstr "旗標" #: ../../library/sys.rst:517 msgid ":const:`debug`" @@ -746,7 +757,7 @@ msgstr ":const:`dev_mode`" #: ../../library/sys.rst:530 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" -msgstr "" +msgstr ":option:`-X dev <-X>` (:ref:`Python 開發模式 `)" #: ../../library/sys.rst:531 msgid ":const:`utf8_mode`" @@ -776,19 +787,19 @@ msgstr "" #: ../../library/sys.rst:536 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." -msgstr "" +msgstr "新增 ``quiet`` 屬性,用於新的 :option:`-q` 旗標。" #: ../../library/sys.rst:539 msgid "The ``hash_randomization`` attribute." -msgstr "" +msgstr "``hash_randomization`` 屬性。" #: ../../library/sys.rst:542 msgid "Removed obsolete ``division_warning`` attribute." -msgstr "" +msgstr "移除過時的 ``division_warning`` 屬性。" #: ../../library/sys.rst:545 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." -msgstr "" +msgstr "新增 ``isolated`` 屬性,用於 :option:`-I` ``isolated`` 旗標。" #: ../../library/sys.rst:548 msgid "" @@ -799,11 +810,11 @@ msgstr "" #: ../../library/sys.rst:553 msgid "Added the ``safe_path`` attribute for :option:`-P` option." -msgstr "" +msgstr "新增 ``safe_path`` 屬性,用於 :option:`-P` 選項。" #: ../../library/sys.rst:556 msgid "Added the ``int_max_str_digits`` attribute." -msgstr "" +msgstr "新增 ``int_max_str_digits`` 屬性。" #: ../../library/sys.rst:562 msgid "" @@ -817,11 +828,11 @@ msgstr "" #: ../../library/sys.rst:572 msgid "float.h macro" -msgstr "" +msgstr "float.h macro" #: ../../library/sys.rst:572 ../../library/sys.rst:925 msgid "explanation" -msgstr "" +msgstr "解釋" #: ../../library/sys.rst:574 msgid "``epsilon``" @@ -1179,6 +1190,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." msgstr "" +"引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." +"_getframe``。" #: ../../library/sys.rst:807 msgid "" @@ -1531,6 +1544,8 @@ msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." msgstr "" +"引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." +"run_interactivehook``。" #: ../../library/sys.rst:1061 msgid "" @@ -1958,7 +1973,7 @@ msgstr "" msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." -msgstr "" +msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" #: ../../library/sys.rst:1381 ../../library/sys.rst:1462 msgid "The events have the following meaning:" @@ -2168,7 +2183,7 @@ msgstr "" msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." -msgstr "" +msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.settrace``。" #: ../../library/sys.rst:1517 msgid "" @@ -2198,12 +2213,16 @@ msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." +"set_asyncgen_hooks_firstiter``。" #: ../../library/sys.rst:1537 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." +"set_asyncgen_hooks_finalizer``。" #: ../../library/sys.rst:1539 msgid "" @@ -2414,11 +2433,11 @@ msgstr "" #: ../../library/sys.rst:1705 msgid "``'nt'``: Windows threads" -msgstr "" +msgstr "``'nt'``: Windows 執行緒" #: ../../library/sys.rst:1706 msgid "``'pthread'``: POSIX threads" -msgstr "" +msgstr "``'pthread'``: POSIX 執行緒" #: ../../library/sys.rst:1707 msgid "" @@ -2448,7 +2467,7 @@ msgstr "" #: ../../library/sys.rst:1716 msgid "``None`` if this information is unknown" -msgstr "" +msgstr "為 ``None`` 表示此資訊未知。" #: ../../library/sys.rst:1718 msgid ":const:`version`" @@ -2471,7 +2490,7 @@ msgstr "" #: ../../library/sys.rst:1735 msgid "Handle an unraisable exception." -msgstr "" +msgstr "處理一個不可被引發的例外。" #: ../../library/sys.rst:1737 msgid "" @@ -2486,23 +2505,23 @@ msgstr "" #: ../../library/sys.rst:1743 msgid "*exc_type*: Exception type." -msgstr "" +msgstr "*exc_type*: 例外型別。" #: ../../library/sys.rst:1744 msgid "*exc_value*: Exception value, can be ``None``." -msgstr "" +msgstr "*exc_value*: 例外值,可以為 ``None``。" #: ../../library/sys.rst:1745 msgid "*exc_traceback*: Exception traceback, can be ``None``." -msgstr "" +msgstr "*exc_traceback*: 例外追蹤,可以為 ``None``。" #: ../../library/sys.rst:1746 msgid "*err_msg*: Error message, can be ``None``." -msgstr "" +msgstr "*err_msg*: 錯誤訊息,可以為 ``None``。" #: ../../library/sys.rst:1747 msgid "*object*: Object causing the exception, can be ``None``." -msgstr "" +msgstr "*object*: 導致例外的物件,可以為 ``None``。" #: ../../library/sys.rst:1749 msgid "" @@ -2576,7 +2595,7 @@ msgstr "" #: ../../library/sys.rst:1800 msgid "Added named component attributes." -msgstr "" +msgstr "新增了附名的元件屬性。" #: ../../library/sys.rst:1805 msgid "" @@ -2610,7 +2629,7 @@ msgstr "" #: ../../library/sys.rst:1847 msgid "Citations" -msgstr "" +msgstr "引用" #: ../../library/sys.rst:1848 msgid "" @@ -2618,3 +2637,5 @@ msgid "" "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" "n1256.pdf\\ ." msgstr "" +"ISO/IEC 9899:1999. \"Programming languages -- C.\" 公開草案可在以下網址取" +"得 https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf\\ 。" diff --git a/using/windows.po b/using/windows.po index b6dacb657f..17adfdcee5 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-02 00:16+0000\n" +"POT-Creation-Date: 2023-04-25 00:20+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-" @@ -818,7 +818,7 @@ msgid "" "settings, and installed packages. The standard library is included as pre-" "compiled and optimized ``.pyc`` files in a ZIP, and ``python3.dll``, " "``python37.dll``, ``python.exe`` and ``pythonw.exe`` are all provided. Tcl/" -"tk (including all dependants, such as Idle), pip and the Python " +"tk (including all dependents, such as Idle), pip and the Python " "documentation are not included." msgstr ""