From eeed7ade8c47bdb821d05381f8482b951d050eaf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 7 Jul 2025 17:49:17 +0000 Subject: [PATCH 1/6] sync with cpython f39103b3 --- library/email.compat32-message.po | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 3d8265d6fc..1be28eae02 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-07-07 17:47+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -236,8 +236,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:183 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by :meth:`~email.message.EmailMessage." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by :meth:`~email.message.EmailMessage." "set_content` and the related ``make`` and ``add`` methods." msgstr "" @@ -288,8 +288,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:226 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by :meth:`~email.message.EmailMessage." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by :meth:`~email.message.EmailMessage." "get_content` and :meth:`~email.message.EmailMessage.iter_parts`." msgstr "" @@ -302,8 +302,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:238 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by :meth:`~email.message.EmailMessage." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by :meth:`~email.message.EmailMessage." "set_content`." msgstr "" @@ -337,9 +337,9 @@ msgstr "" #: ../../library/email.compat32-message.rst:267 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by the *charset* parameter of the :meth:" -"`email.emailmessage.EmailMessage.set_content` method." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by the *charset* parameter of the :meth:`email." +"message.EmailMessage.set_content` method." msgstr "" #: ../../library/email.compat32-message.rst:275 @@ -350,8 +350,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:278 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class it always returns ``None``." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"it always returns ``None``." msgstr "" #: ../../library/email.compat32-message.rst:283 @@ -618,9 +618,9 @@ msgstr "" #: ../../library/email.compat32-message.rst:488 #: ../../library/email.compat32-message.rst:526 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by the *params* property of the " -"individual header objects returned by the header access methods." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by the *params* property of the individual " +"header objects returned by the header access methods." msgstr "" #: ../../library/email.compat32-message.rst:496 @@ -739,8 +739,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:581 msgid "" -"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " -"class its functionality is replaced by the ``make_`` and ``add_`` methods." +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by the ``make_`` and ``add_`` methods." msgstr "" #: ../../library/email.compat32-message.rst:588 From 7fb29ff73e960e0ded8e971cc90d25fadbd3655a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 9 Jul 2025 00:18:51 +0000 Subject: [PATCH 2/6] sync with cpython c44070b2 --- library/argparse.po | 515 +++++++------- library/exceptions.po | 374 +++++----- whatsnew/3.11.po | 1524 ++++++++++++++++++++--------------------- 3 files changed, 1203 insertions(+), 1210 deletions(-) diff --git a/library/argparse.po b/library/argparse.po index 283ac46a94..20df5b8abd 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-07-09 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1302,33 +1302,14 @@ msgstr "" #: ../../library/argparse.rst:747 msgid "" -"Only actions that consume command-line arguments (e.g. ``'store'``, " -"``'append'`` or ``'extend'``) can be used with positional arguments." -msgstr "" - -#: ../../library/argparse.rst:752 -msgid "" "You may also specify an arbitrary action by passing an :class:`Action` " -"subclass or other object that implements the same interface. The :class:`!" -"BooleanOptionalAction` is available in :mod:`!argparse` and adds support for " -"boolean actions such as ``--foo`` and ``--no-foo``::" +"subclass (e.g. :class:`BooleanOptionalAction`) or other object that " +"implements the same interface. Only actions that consume command-line " +"arguments (e.g. ``'store'``, ``'append'``, ``'extend'``, or custom actions " +"with non-zero ``nargs``) can be used with positional arguments." msgstr "" -#: ../../library/argparse.rst:757 -msgid "" -">>> import argparse\n" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" -">>> parser.parse_args(['--no-foo'])\n" -"Namespace(foo=False)" -msgstr "" -">>> import argparse\n" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" -">>> parser.parse_args(['--no-foo'])\n" -"Namespace(foo=False)" - -#: ../../library/argparse.rst:765 +#: ../../library/argparse.rst:753 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " @@ -1337,11 +1318,11 @@ msgid "" "their registered name." msgstr "" -#: ../../library/argparse.rst:770 +#: ../../library/argparse.rst:758 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:772 +#: ../../library/argparse.rst:760 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1362,15 +1343,15 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: ../../library/argparse.rst:790 +#: ../../library/argparse.rst:778 msgid "For more details, see :class:`Action`." msgstr "更多詳情請見 :class:`Action`。" -#: ../../library/argparse.rst:796 +#: ../../library/argparse.rst:784 msgid "nargs" msgstr "nargs" -#: ../../library/argparse.rst:798 +#: ../../library/argparse.rst:786 msgid "" ":class:`ArgumentParser` objects usually associate a single command-line " "argument with a single action to be taken. The ``nargs`` keyword argument " @@ -1379,13 +1360,13 @@ msgid "" "are:" msgstr "" -#: ../../library/argparse.rst:803 +#: ../../library/argparse.rst:791 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:806 +#: ../../library/argparse.rst:794 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1399,13 +1380,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:812 +#: ../../library/argparse.rst:800 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:817 +#: ../../library/argparse.rst:805 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1415,7 +1396,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:824 +#: ../../library/argparse.rst:812 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1437,13 +1418,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:834 +#: ../../library/argparse.rst:822 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:837 +#: ../../library/argparse.rst:825 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1469,7 +1450,7 @@ msgstr "" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:851 +#: ../../library/argparse.rst:839 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1477,7 +1458,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:856 +#: ../../library/argparse.rst:844 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1493,14 +1474,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:865 +#: ../../library/argparse.rst:853 msgid "" "``'+'``. Just like ``'*'``, all command-line arguments present are gathered " "into a list. Additionally, an error message will be generated if there " "wasn't at least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:869 +#: ../../library/argparse.rst:857 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1518,7 +1499,7 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:877 +#: ../../library/argparse.rst:865 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1527,11 +1508,11 @@ msgid "" "``'store_const'``) set ``nargs=0``." msgstr "" -#: ../../library/argparse.rst:887 +#: ../../library/argparse.rst:875 msgid "const" msgstr "const" -#: ../../library/argparse.rst:889 +#: ../../library/argparse.rst:877 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1539,7 +1520,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:893 +#: ../../library/argparse.rst:881 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1549,7 +1530,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:901 +#: ../../library/argparse.rst:889 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1559,17 +1540,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:908 +#: ../../library/argparse.rst:896 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:915 +#: ../../library/argparse.rst:903 msgid "default" msgstr "default" -#: ../../library/argparse.rst:917 +#: ../../library/argparse.rst:905 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1579,7 +1560,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:924 +#: ../../library/argparse.rst:912 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1595,13 +1576,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:931 +#: ../../library/argparse.rst:919 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" -#: ../../library/argparse.rst:934 +#: ../../library/argparse.rst:922 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1613,7 +1594,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:939 +#: ../../library/argparse.rst:927 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1621,7 +1602,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:944 +#: ../../library/argparse.rst:932 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -1635,13 +1616,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:950 +#: ../../library/argparse.rst:938 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:953 +#: ../../library/argparse.rst:941 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -1657,20 +1638,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:960 +#: ../../library/argparse.rst:948 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: ../../library/argparse.rst:964 +#: ../../library/argparse.rst:952 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:967 +#: ../../library/argparse.rst:955 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -1686,11 +1667,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:978 +#: ../../library/argparse.rst:966 msgid "type" msgstr "type" -#: ../../library/argparse.rst:980 +#: ../../library/argparse.rst:968 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1699,13 +1680,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:986 +#: ../../library/argparse.rst:974 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:989 +#: ../../library/argparse.rst:977 msgid "" "The argument to ``type`` can be a callable that accepts a single string or " "the name of a registered type (see :meth:`~ArgumentParser.register`) If the " @@ -1714,11 +1695,11 @@ msgid "" "is displayed. Other exception types are not handled." msgstr "" -#: ../../library/argparse.rst:995 +#: ../../library/argparse.rst:983 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:997 +#: ../../library/argparse.rst:985 msgid "" "import argparse\n" "import pathlib\n" @@ -1744,11 +1725,11 @@ msgstr "" "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:1010 +#: ../../library/argparse.rst:998 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:1012 +#: ../../library/argparse.rst:1000 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -1766,14 +1747,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1022 +#: ../../library/argparse.rst:1010 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1026 +#: ../../library/argparse.rst:1014 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1781,7 +1762,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1031 +#: ../../library/argparse.rst:1019 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." @@ -1789,7 +1770,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1036 +#: ../../library/argparse.rst:1024 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -1799,17 +1780,17 @@ msgid "" "files." msgstr "" -#: ../../library/argparse.rst:1043 +#: ../../library/argparse.rst:1031 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1050 +#: ../../library/argparse.rst:1038 msgid "choices" msgstr "choices" -#: ../../library/argparse.rst:1052 +#: ../../library/argparse.rst:1040 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -1818,7 +1799,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1058 +#: ../../library/argparse.rst:1046 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -1838,26 +1819,26 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1067 +#: ../../library/argparse.rst:1055 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified." msgstr "" -#: ../../library/argparse.rst:1071 +#: ../../library/argparse.rst:1059 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1074 +#: ../../library/argparse.rst:1062 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1077 +#: ../../library/argparse.rst:1065 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -1865,11 +1846,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1086 +#: ../../library/argparse.rst:1074 msgid "required" msgstr "required" -#: ../../library/argparse.rst:1088 +#: ../../library/argparse.rst:1076 msgid "" "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -1877,7 +1858,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1093 +#: ../../library/argparse.rst:1081 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -1895,24 +1876,24 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1101 +#: ../../library/argparse.rst:1089 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1107 +#: ../../library/argparse.rst:1095 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1114 +#: ../../library/argparse.rst:1102 msgid "help" msgstr "help" -#: ../../library/argparse.rst:1116 +#: ../../library/argparse.rst:1104 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -1920,7 +1901,7 @@ msgid "" "each argument." msgstr "" -#: ../../library/argparse.rst:1121 +#: ../../library/argparse.rst:1109 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1929,7 +1910,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1126 +#: ../../library/argparse.rst:1114 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -1955,19 +1936,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1138 +#: ../../library/argparse.rst:1126 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1141 +#: ../../library/argparse.rst:1129 msgid "" ":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1144 +#: ../../library/argparse.rst:1132 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -1985,11 +1966,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1156 +#: ../../library/argparse.rst:1144 msgid "metavar" msgstr "metavar" -#: ../../library/argparse.rst:1158 +#: ../../library/argparse.rst:1146 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, :class:`!ArgumentParser` " @@ -2001,7 +1982,7 @@ msgid "" "command-line argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1167 +#: ../../library/argparse.rst:1155 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2033,11 +2014,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1182 +#: ../../library/argparse.rst:1170 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1184 +#: ../../library/argparse.rst:1172 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2069,21 +2050,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1199 +#: ../../library/argparse.rst:1187 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1203 +#: ../../library/argparse.rst:1191 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1207 +#: ../../library/argparse.rst:1195 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2107,11 +2088,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1222 +#: ../../library/argparse.rst:1210 msgid "dest" msgstr "dest" -#: ../../library/argparse.rst:1224 +#: ../../library/argparse.rst:1212 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2121,7 +2102,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1231 +#: ../../library/argparse.rst:1219 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2133,7 +2114,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1236 +#: ../../library/argparse.rst:1224 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2145,7 +2126,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1245 +#: ../../library/argparse.rst:1233 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2163,11 +2144,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1253 +#: ../../library/argparse.rst:1241 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1255 +#: ../../library/argparse.rst:1243 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2179,11 +2160,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1264 +#: ../../library/argparse.rst:1252 msgid "deprecated" msgstr "deprecated" -#: ../../library/argparse.rst:1266 +#: ../../library/argparse.rst:1254 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2194,7 +2175,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1276 +#: ../../library/argparse.rst:1264 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='snake.py')\n" @@ -2214,11 +2195,11 @@ msgstr "" "snake.py: warning: option '--legs' is deprecated\n" "Namespace(legs=4)" -#: ../../library/argparse.rst:1289 +#: ../../library/argparse.rst:1277 msgid "Action classes" msgstr "Action 類別" -#: ../../library/argparse.rst:1291 +#: ../../library/argparse.rst:1279 msgid "" ":class:`!Action` classes implement the Action API, a callable which returns " "a callable which processes arguments from the command-line. Any object which " @@ -2226,7 +2207,7 @@ msgid "" "`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1300 +#: ../../library/argparse.rst:1288 msgid "" ":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " "the information needed to parse a single argument from one or more strings " @@ -2235,7 +2216,7 @@ msgid "" "`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1306 +#: ../../library/argparse.rst:1294 msgid "" "Instances of :class:`!Action` (or return value of any callable to the " "``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" @@ -2244,46 +2225,46 @@ msgid "" "is to call :meth:`!Action.__init__`." msgstr "" -#: ../../library/argparse.rst:1314 +#: ../../library/argparse.rst:1302 msgid "" ":class:`!Action` instances should be callable, so subclasses must override " "the :meth:`!__call__` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1317 +#: ../../library/argparse.rst:1305 msgid "" "*parser* - The :class:`ArgumentParser` object which contains this action." msgstr "" -#: ../../library/argparse.rst:1319 +#: ../../library/argparse.rst:1307 msgid "" "*namespace* - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1323 +#: ../../library/argparse.rst:1311 msgid "" "*values* - The associated command-line arguments, with any type conversions " "applied. Type conversions are specified with the type_ keyword argument to :" "meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1327 +#: ../../library/argparse.rst:1315 msgid "" "*option_string* - The option string that was used to invoke this action. The " "``option_string`` argument is optional, and will be absent if the action is " "associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1331 +#: ../../library/argparse.rst:1319 msgid "" "The :meth:`!__call__` method may perform arbitrary actions, but will " "typically set attributes on the ``namespace`` based on ``dest`` and " "``values``." msgstr "" -#: ../../library/argparse.rst:1336 +#: ../../library/argparse.rst:1324 msgid "" ":class:`!Action` subclasses can define a :meth:`!format_usage` method that " "takes no argument and return a string which will be used when printing the " @@ -2291,47 +2272,69 @@ msgid "" "will be used." msgstr "" -#: ../../library/argparse.rst:1342 +#: ../../library/argparse.rst:1330 +msgid "" +"A subclass of :class:`Action` for handling boolean flags with positive and " +"negative options. Adding a single argument such as ``--foo`` automatically " +"creates both ``--foo`` and ``--no-foo`` options, storing ``True`` and " +"``False`` respectively::" +msgstr "" + +#: ../../library/argparse.rst:1335 +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" +">>> parser.parse_args(['--no-foo'])\n" +"Namespace(foo=False)" +msgstr "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" +">>> parser.parse_args(['--no-foo'])\n" +"Namespace(foo=False)" + +#: ../../library/argparse.rst:1345 msgid "The parse_args() method" msgstr "parse_args() 方法" -#: ../../library/argparse.rst:1346 +#: ../../library/argparse.rst:1349 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1349 +#: ../../library/argparse.rst:1352 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:`!" "add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1353 +#: ../../library/argparse.rst:1356 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1356 +#: ../../library/argparse.rst:1359 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1361 +#: ../../library/argparse.rst:1364 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1363 +#: ../../library/argparse.rst:1366 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1367 +#: ../../library/argparse.rst:1370 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2349,14 +2352,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1375 +#: ../../library/argparse.rst:1378 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1379 +#: ../../library/argparse.rst:1382 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2364,13 +2367,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1382 +#: ../../library/argparse.rst:1385 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1385 +#: ../../library/argparse.rst:1388 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2378,13 +2381,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1388 +#: ../../library/argparse.rst:1391 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1391 +#: ../../library/argparse.rst:1394 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2400,11 +2403,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1400 +#: ../../library/argparse.rst:1403 msgid "Invalid arguments" msgstr "無效引數" -#: ../../library/argparse.rst:1402 +#: ../../library/argparse.rst:1405 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2412,7 +2415,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1407 +#: ../../library/argparse.rst:1410 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2452,11 +2455,11 @@ msgstr "" "usage: PROG [-h] [--foo FOO] [bar]\n" "PROG: error: extra arguments found: badger" -#: ../../library/argparse.rst:1428 +#: ../../library/argparse.rst:1431 msgid "Arguments containing ``-``" msgstr "包含 ``-`` 的引數" -#: ../../library/argparse.rst:1430 +#: ../../library/argparse.rst:1433 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2468,7 +2471,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1438 +#: ../../library/argparse.rst:1441 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2501,7 +2504,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1468 +#: ../../library/argparse.rst:1471 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2509,7 +2512,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1473 +#: ../../library/argparse.rst:1476 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2517,24 +2520,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1476 +#: ../../library/argparse.rst:1479 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1482 +#: ../../library/argparse.rst:1485 msgid "Argument abbreviations (prefix matching)" msgstr "引數縮寫 (前綴匹配)" -#: ../../library/argparse.rst:1484 +#: ../../library/argparse.rst:1487 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1488 +#: ../../library/argparse.rst:1491 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2558,17 +2561,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1499 +#: ../../library/argparse.rst:1502 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1505 +#: ../../library/argparse.rst:1508 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1507 +#: ../../library/argparse.rst:1510 msgid "" "Sometimes it may be useful to have an :class:`ArgumentParser` parse " "arguments other than those of :data:`sys.argv`. This can be accomplished by " @@ -2576,7 +2579,7 @@ msgid "" "useful for testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1512 +#: ../../library/argparse.rst:1515 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2602,24 +2605,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1527 +#: ../../library/argparse.rst:1530 msgid "The Namespace object" msgstr "命名空間物件" -#: ../../library/argparse.rst:1531 +#: ../../library/argparse.rst:1534 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1534 +#: ../../library/argparse.rst:1537 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1538 +#: ../../library/argparse.rst:1541 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2633,14 +2636,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1544 +#: ../../library/argparse.rst:1547 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1548 +#: ../../library/argparse.rst:1551 msgid "" ">>> class C:\n" "... pass\n" @@ -2662,15 +2665,15 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1560 +#: ../../library/argparse.rst:1563 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1563 +#: ../../library/argparse.rst:1566 msgid "Sub-commands" msgstr "子命令" -#: ../../library/argparse.rst:1570 +#: ../../library/argparse.rst:1573 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " @@ -2685,69 +2688,69 @@ msgid "" "returns an :class:`!ArgumentParser` object that can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1582 +#: ../../library/argparse.rst:1585 msgid "Description of parameters:" msgstr "參數的解釋:" -#: ../../library/argparse.rst:1584 +#: ../../library/argparse.rst:1587 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1588 +#: ../../library/argparse.rst:1591 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1591 +#: ../../library/argparse.rst:1594 msgid "" "*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1595 +#: ../../library/argparse.rst:1598 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" -#: ../../library/argparse.rst:1598 +#: ../../library/argparse.rst:1601 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1601 +#: ../../library/argparse.rst:1604 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1604 +#: ../../library/argparse.rst:1607 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1607 +#: ../../library/argparse.rst:1610 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1609 +#: ../../library/argparse.rst:1612 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1612 +#: ../../library/argparse.rst:1615 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1614 +#: ../../library/argparse.rst:1617 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2770,7 +2773,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1633 +#: ../../library/argparse.rst:1636 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -2780,7 +2783,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1640 +#: ../../library/argparse.rst:1643 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -2789,7 +2792,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1648 +#: ../../library/argparse.rst:1651 msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" @@ -2847,14 +2850,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1676 +#: ../../library/argparse.rst:1679 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1680 +#: ../../library/argparse.rst:1683 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -2890,7 +2893,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1697 +#: ../../library/argparse.rst:1700 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -2898,7 +2901,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1702 +#: ../../library/argparse.rst:1705 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -2914,13 +2917,13 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1709 +#: ../../library/argparse.rst:1712 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1723 +#: ../../library/argparse.rst:1726 msgid "" "One particularly effective way of handling subcommands is to combine the use " "of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " @@ -2928,7 +2931,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1728 +#: ../../library/argparse.rst:1731 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -2963,7 +2966,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1760 +#: ../../library/argparse.rst:1763 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -2973,7 +2976,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1767 +#: ../../library/argparse.rst:1770 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -2993,15 +2996,15 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1776 +#: ../../library/argparse.rst:1779 msgid "New *required* keyword-only parameter." msgstr "" -#: ../../library/argparse.rst:1781 +#: ../../library/argparse.rst:1784 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1785 +#: ../../library/argparse.rst:1788 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -3010,7 +3013,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1791 +#: ../../library/argparse.rst:1794 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -3028,14 +3031,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1797 +#: ../../library/argparse.rst:1800 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1801 +#: ../../library/argparse.rst:1804 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -3047,15 +3050,15 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1806 +#: ../../library/argparse.rst:1809 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1811 +#: ../../library/argparse.rst:1814 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1816 +#: ../../library/argparse.rst:1819 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3064,7 +3067,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1822 +#: ../../library/argparse.rst:1825 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3088,7 +3091,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1833 +#: ../../library/argparse.rst:1836 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3099,7 +3102,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:1841 +#: ../../library/argparse.rst:1844 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3137,7 +3140,7 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1859 +#: ../../library/argparse.rst:1862 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -3146,13 +3149,13 @@ msgid "" "rather than the entire parser." msgstr "" -#: ../../library/argparse.rst:1864 +#: ../../library/argparse.rst:1867 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1867 +#: ../../library/argparse.rst:1870 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3160,18 +3163,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:1875 +#: ../../library/argparse.rst:1878 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1879 +#: ../../library/argparse.rst:1882 msgid "" "Create a mutually exclusive group. :mod:`!argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1883 +#: ../../library/argparse.rst:1886 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3197,14 +3200,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:1895 +#: ../../library/argparse.rst:1898 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:1899 +#: ../../library/argparse.rst:1902 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3222,7 +3225,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:1907 +#: ../../library/argparse.rst:1910 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3230,7 +3233,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:1913 +#: ../../library/argparse.rst:1916 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3266,7 +3269,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1930 +#: ../../library/argparse.rst:1933 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3274,11 +3277,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:1938 +#: ../../library/argparse.rst:1941 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:1942 +#: ../../library/argparse.rst:1945 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3287,7 +3290,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:1948 +#: ../../library/argparse.rst:1951 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3301,12 +3304,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:1954 +#: ../../library/argparse.rst:1957 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:1956 +#: ../../library/argparse.rst:1959 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3320,20 +3323,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:1962 +#: ../../library/argparse.rst:1965 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:1968 +#: ../../library/argparse.rst:1971 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:1972 +#: ../../library/argparse.rst:1975 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3345,54 +3348,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:1979 +#: ../../library/argparse.rst:1982 msgid "Printing help" msgstr "印出幫助訊息" -#: ../../library/argparse.rst:1981 +#: ../../library/argparse.rst:1984 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:1987 +#: ../../library/argparse.rst:1990 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:1993 +#: ../../library/argparse.rst:1996 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:1997 +#: ../../library/argparse.rst:2000 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:2002 +#: ../../library/argparse.rst:2005 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:2007 +#: ../../library/argparse.rst:2010 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:2012 +#: ../../library/argparse.rst:2015 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2016 +#: ../../library/argparse.rst:2019 msgid "" "Sometimes a script only needs to handle a specific set of command-line " "arguments, leaving any unrecognized arguments for another script or program. " @@ -3400,7 +3403,7 @@ msgid "" "useful." msgstr "" -#: ../../library/argparse.rst:2021 +#: ../../library/argparse.rst:2024 msgid "" "This method works similarly to :meth:`~ArgumentParser.parse_args`, but it " "does not raise an error for extra, unrecognized arguments. Instead, it " @@ -3408,7 +3411,7 @@ msgid "" "populated namespace and the list of any unrecognized arguments." msgstr "" -#: ../../library/argparse.rst:2028 +#: ../../library/argparse.rst:2031 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3422,7 +3425,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2035 +#: ../../library/argparse.rst:2038 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3430,11 +3433,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2042 +#: ../../library/argparse.rst:2045 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2046 +#: ../../library/argparse.rst:2049 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3442,20 +3445,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2051 +#: ../../library/argparse.rst:2054 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2055 +#: ../../library/argparse.rst:2058 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2058 +#: ../../library/argparse.rst:2061 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3465,18 +3468,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2064 +#: ../../library/argparse.rst:2067 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2068 +#: ../../library/argparse.rst:2071 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2072 +#: ../../library/argparse.rst:2075 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3490,17 +3493,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2080 +#: ../../library/argparse.rst:2083 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2085 +#: ../../library/argparse.rst:2088 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2090 +#: ../../library/argparse.rst:2093 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3508,7 +3511,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2095 +#: ../../library/argparse.rst:2098 msgid "" "These parsers do not support all the :mod:`!argparse` features, and will " "raise exceptions if unsupported features are used. In particular, " @@ -3516,7 +3519,7 @@ msgid "" "positionals are not supported." msgstr "" -#: ../../library/argparse.rst:2100 +#: ../../library/argparse.rst:2103 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3524,7 +3527,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2106 +#: ../../library/argparse.rst:2109 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3544,7 +3547,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2115 +#: ../../library/argparse.rst:2118 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3552,11 +3555,11 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2124 +#: ../../library/argparse.rst:2127 msgid "Registering custom types or actions" msgstr "" -#: ../../library/argparse.rst:2128 +#: ../../library/argparse.rst:2131 msgid "" "Sometimes it's desirable to use a custom string in error messages to provide " "more user-friendly output. In these cases, :meth:`!register` can be used to " @@ -3564,7 +3567,7 @@ msgid "" "the type by their registered name instead of their callable name." msgstr "" -#: ../../library/argparse.rst:2133 +#: ../../library/argparse.rst:2136 msgid "" "The :meth:`!register` method accepts three arguments - a *registry_name*, " "specifying the internal registry where the object will be stored (e.g., " @@ -3572,12 +3575,12 @@ msgid "" "be registered, and object, the callable to be registered." msgstr "" -#: ../../library/argparse.rst:2138 +#: ../../library/argparse.rst:2141 msgid "" "The following example shows how to register a custom type with a parser::" msgstr "" -#: ../../library/argparse.rst:2140 +#: ../../library/argparse.rst:2143 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -3593,42 +3596,42 @@ msgid "" "PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" msgstr "" -#: ../../library/argparse.rst:2152 +#: ../../library/argparse.rst:2155 msgid "Exceptions" msgstr "例外" -#: ../../library/argparse.rst:2156 +#: ../../library/argparse.rst:2159 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2158 +#: ../../library/argparse.rst:2161 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2163 +#: ../../library/argparse.rst:2166 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:2167 +#: ../../library/argparse.rst:2170 msgid "Guides and Tutorials" msgstr "" -#: ../../library/argparse.rst:815 +#: ../../library/argparse.rst:803 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:815 ../../library/argparse.rst:849 -#: ../../library/argparse.rst:863 +#: ../../library/argparse.rst:803 ../../library/argparse.rst:837 +#: ../../library/argparse.rst:851 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:849 +#: ../../library/argparse.rst:837 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:863 +#: ../../library/argparse.rst:851 msgid "+ (plus)" msgstr "+ (加號)" diff --git a/library/exceptions.po b/library/exceptions.po index 484c10cf19..04681fe841 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-07-09 00:17+0000\n" "PO-Revision-Date: 2024-12-20 16:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -324,35 +324,41 @@ msgstr "" "件根本不支援屬性參照或屬性賦值的時候,:exc:`TypeError` 會被引發。)" #: ../../library/exceptions.rst:207 +#, fuzzy msgid "" -"The :attr:`name` and :attr:`obj` attributes can be set using keyword-only " -"arguments to the constructor. When set they represent the name of the " -"attribute that was attempted to be accessed and the object that was accessed " -"for said attribute, respectively." -msgstr "" -":attr:`name` 和 :attr:`obj` 屬性可以使用建構函式的僅限關鍵字 (keyword-only) " -"引數來設定。當被設定的時候,它們分別代表被嘗試存取的屬性名稱以及被以該屬性存" -"取的物件。" +"The optional *name* and *obj* keyword-only arguments set the corresponding " +"attributes:" +msgstr "可選的僅限關鍵字引數 *name* 和 *path* 設定對應的屬性:" #: ../../library/exceptions.rst:212 +#, fuzzy +msgid "The name of the attribute that was attempted to be accessed." +msgstr "嘗試引入 (import) 的模組名稱。" + +#: ../../library/exceptions.rst:216 +msgid "The object that was accessed for the named attribute." +msgstr "" + +#: ../../library/exceptions.rst:218 msgid "Added the :attr:`name` and :attr:`obj` attributes." msgstr "新增 :attr:`name` 與 :attr:`obj` 屬性。" -#: ../../library/exceptions.rst:217 +#: ../../library/exceptions.rst:223 +#, fuzzy msgid "" "Raised when the :func:`input` function hits an end-of-file condition (EOF) " -"without reading any data. (N.B.: the :meth:`io.IOBase.read` and :meth:`io." +"without reading any data. (Note: the :meth:`!io.IOBase.read` and :meth:`io." "IOBase.readline` methods return an empty string when they hit EOF.)" msgstr "" "當 :func:`input` 函式在沒有讀到任何資料而到達檔案結尾 (end-of-file, EOF) 條件" "的時候被引發。(注意::meth:`io.IOBase.read` 和 :meth:`io.IOBase.readline` 方" "法當達到 EOF 時會回傳空字串。)" -#: ../../library/exceptions.rst:224 +#: ../../library/exceptions.rst:230 msgid "Not currently used." msgstr "目前沒有被使用。" -#: ../../library/exceptions.rst:229 +#: ../../library/exceptions.rst:235 msgid "" "Raised when a :term:`generator` or :term:`coroutine` is closed; see :meth:" "`generator.close` and :meth:`coroutine.close`. It directly inherits from :" @@ -363,7 +369,7 @@ msgstr "" "`generator.close` 和 :meth:`coroutine.close`。此例外直接繼承自 :exc:" "`BaseException` 而不是 :exc:`Exception`,因為技術上來說這不是一個錯誤。" -#: ../../library/exceptions.rst:237 +#: ../../library/exceptions.rst:243 msgid "" "Raised when the :keyword:`import` statement has troubles trying to load a " "module. Also raised when the \"from list\" in ``from ... import`` has a " @@ -372,25 +378,25 @@ msgstr "" "當 :keyword:`import` 陳述式嘗試載入模組遇到問題的時候會被引發。當 ``from ... " "import`` 裡的 \"from list\" 包含找不到的名稱時也會被引發。" -#: ../../library/exceptions.rst:241 +#: ../../library/exceptions.rst:247 msgid "" "The optional *name* and *path* keyword-only arguments set the corresponding " "attributes:" msgstr "可選的僅限關鍵字引數 *name* 和 *path* 設定對應的屬性:" -#: ../../library/exceptions.rst:246 +#: ../../library/exceptions.rst:252 msgid "The name of the module that was attempted to be imported." msgstr "嘗試引入 (import) 的模組名稱。" -#: ../../library/exceptions.rst:250 +#: ../../library/exceptions.rst:256 msgid "The path to any file which triggered the exception." msgstr "觸發此例外的任何檔案的路徑。" -#: ../../library/exceptions.rst:252 +#: ../../library/exceptions.rst:258 msgid "Added the :attr:`name` and :attr:`path` attributes." msgstr "新增 :attr:`name` 與 :attr:`path` 屬性。" -#: ../../library/exceptions.rst:257 +#: ../../library/exceptions.rst:263 msgid "" "A subclass of :exc:`ImportError` which is raised by :keyword:`import` when a " "module could not be located. It is also raised when ``None`` is found in :" @@ -399,7 +405,7 @@ msgstr "" ":exc:`ImportError` 的子類別,當模組不能被定位的時候會被 :keyword:`import` 所" "引發。當在 :data:`sys.modules` 裡找到 ``None`` 時也會被引發。" -#: ../../library/exceptions.rst:266 +#: ../../library/exceptions.rst:272 msgid "" "Raised when a sequence subscript is out of range. (Slice indices are " "silently truncated to fall in the allowed range; if an index is not an " @@ -408,13 +414,13 @@ msgstr "" "當序列的索引超出範圍的時候會被引發。(切片索引 (slice indices) 會默默地被截短" "使其能落在允許的範圍內;如果索引不是整數,:exc:`TypeError` 會被引發。)" -#: ../../library/exceptions.rst:275 +#: ../../library/exceptions.rst:281 msgid "" "Raised when a mapping (dictionary) key is not found in the set of existing " "keys." msgstr "當對映(字典)的鍵無法在已存在的鍵的集合中被找到時會被引發。" -#: ../../library/exceptions.rst:282 +#: ../../library/exceptions.rst:288 msgid "" "Raised when the user hits the interrupt key (normally :kbd:`Control-C` or :" "kbd:`Delete`). During execution, a check for interrupts is made regularly. " @@ -427,7 +433,7 @@ msgstr "" "exc:`BaseException` 以防止意外地被捕捉 :exc:`Exception` 的程式碼所捕捉,而因" "此讓直譯器無法結束。" -#: ../../library/exceptions.rst:290 +#: ../../library/exceptions.rst:296 msgid "" "Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " "it can be raised at unpredictable points, it may, in some circumstances, " @@ -440,7 +446,7 @@ msgstr "" "exc:`KeyboardInterrupt` 越快結束程式越好,或者完全避免引發它。(參考 :ref:" "`handlers-and-exceptions`。)" -#: ../../library/exceptions.rst:300 +#: ../../library/exceptions.rst:306 msgid "" "Raised when an operation runs out of memory but the situation may still be " "rescued (by deleting some objects). The associated value is a string " @@ -456,7 +462,7 @@ msgstr "" "整地從該情況中修復;僅管如此,它還是引發例外以讓堆疊回溯可以被印出,以防原因" "出在失控的程式。" -#: ../../library/exceptions.rst:311 +#: ../../library/exceptions.rst:317 msgid "" "Raised when a local or global name is not found. This applies only to " "unqualified names. The associated value is an error message that includes " @@ -465,20 +471,21 @@ msgstr "" "當找不到本地或全域的名稱時會被引發。這只應用在不合格的名稱 (unqualified " "name) 上。關聯值是一個錯誤訊息,包含那個無法被找到的名稱。" -#: ../../library/exceptions.rst:315 -msgid "" -"The :attr:`name` attribute can be set using a keyword-only argument to the " -"constructor. When set it represent the name of the variable that was " -"attempted to be accessed." -msgstr "" -":attr:`name` 屬性可以使用僅限關鍵字引數來設定到建構函式。當被設定的時候它代表" -"被嘗試存取的變數名稱。" +#: ../../library/exceptions.rst:321 +#, fuzzy +msgid "The optional *name* keyword-only argument sets the attribute:" +msgstr "可選的僅限關鍵字引數 *name* 和 *path* 設定對應的屬性:" + +#: ../../library/exceptions.rst:325 +#, fuzzy +msgid "The name of the variable that was attempted to be accessed." +msgstr "嘗試引入 (import) 的模組名稱。" -#: ../../library/exceptions.rst:319 +#: ../../library/exceptions.rst:327 msgid "Added the :attr:`name` attribute." msgstr "新增 :attr:`name` 屬性。" -#: ../../library/exceptions.rst:325 +#: ../../library/exceptions.rst:333 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " @@ -489,7 +496,7 @@ msgstr "" "生類別覆寫該方法時應該要引發此例外,或者當類別正在開發中,可用此例外表示還需" "要加入真正的實作。" -#: ../../library/exceptions.rst:332 +#: ../../library/exceptions.rst:340 msgid "" "It should not be used to indicate that an operator or method is not meant to " "be supported at all -- in that case either leave the operator / method " @@ -498,7 +505,7 @@ msgstr "" "此例外不應該用來表示根本沒有要支援的運算子或方法 ── 在這個情況下可以讓該運算" "子或方法保持未定義,或者如果是子類別的話將其設成 :data:`None`。" -#: ../../library/exceptions.rst:338 +#: ../../library/exceptions.rst:346 msgid "" ":exc:`!NotImplementedError` and :data:`!NotImplemented` are not " "interchangeable. This exception should only be used as described above; see :" @@ -508,7 +515,7 @@ msgstr "" "外只能用在上面描述的情況;參考 :data:`NotImplemented` 裡關於內建常數正確使用" "方法的細節。" -#: ../../library/exceptions.rst:349 +#: ../../library/exceptions.rst:357 msgid "" "This exception is raised when a system function returns a system-related " "error, including I/O failures such as \"file not found\" or \"disk " @@ -517,7 +524,7 @@ msgstr "" "當系統函式回傳系統相關錯誤,包含像\"找不到檔案\"或\"硬碟已滿\"的 I/O 失敗會引" "發此例外(而非不合法的引數或其他次要的錯誤)。" -#: ../../library/exceptions.rst:353 +#: ../../library/exceptions.rst:361 msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " @@ -529,7 +536,7 @@ msgstr "" "const:`None`。為了向後相容,如果傳入三個引數,:attr:`~BaseException.args` 屬" "性只會是包含建構函式前兩個引數的雙元素元組。" -#: ../../library/exceptions.rst:359 +#: ../../library/exceptions.rst:367 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -542,11 +549,11 @@ msgstr "" "個行為只發生在直接建構 :exc:`OSError` 或透過別名,且產生子類別的時候不會被繼" "承。" -#: ../../library/exceptions.rst:367 +#: ../../library/exceptions.rst:375 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "從 C 變數 :c:data:`errno` 而來的數值錯誤代碼。" -#: ../../library/exceptions.rst:371 +#: ../../library/exceptions.rst:379 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " @@ -555,7 +562,7 @@ msgstr "" "在 Windows 下,這會提供你原生的 Windows 錯誤代碼。而 :attr:`.errno` 屬性是一" "個該原生錯誤代碼對於 POSIX 來說的近似翻譯。" -#: ../../library/exceptions.rst:375 +#: ../../library/exceptions.rst:383 msgid "" "Under Windows, if the *winerror* constructor argument is an integer, the :" "attr:`.errno` attribute is determined from the Windows error code, and the " @@ -566,16 +573,17 @@ msgstr "" "據該 Windows 錯誤代碼來決定,且 *errno* 引數會被忽略。在其他平台上," "*winerror* 引數會被忽略,而 :attr:`winerror` 屬性會不存在。" -#: ../../library/exceptions.rst:383 +#: ../../library/exceptions.rst:391 +#, fuzzy msgid "" "The corresponding error message, as provided by the operating system. It is " -"formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" -"`FormatMessage` under Windows." +"formatted by the C functions :c:func:`!perror` under POSIX, and :c:func:`!" +"FormatMessage` under Windows." msgstr "" "作業系統提供的對應錯誤訊息。在 POSIX 下會使用 C 函式 :c:func:`perror` 做格式" "化,而在 Windows 下會使用 :c:func:`FormatMessage`。" -#: ../../library/exceptions.rst:391 +#: ../../library/exceptions.rst:399 msgid "" "For exceptions that involve a file system path (such as :func:`open` or :" "func:`os.unlink`), :attr:`filename` is the file name passed to the function. " @@ -587,17 +595,18 @@ msgstr "" "`filename` 是傳入函式的檔案名稱。對於包含兩個檔案系統路徑的函式(像是 :func:" "`os.rename`),:attr:`filename2` 對應到傳入函式的第二個檔案名稱。" -#: ../../library/exceptions.rst:398 +#: ../../library/exceptions.rst:406 +#, fuzzy msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." -"error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" -"`OSError`, and the constructor may return a subclass." +"error`, :exc:`select.error` and :exc:`!mmap.error` have been merged into :" +"exc:`OSError`, and the constructor may return a subclass." msgstr "" ":exc:`EnvironmentError`、:exc:`IOError`、:exc:`WindowsError`、:exc:`socket." "error`、:exc:`select.error` 及 :exc:`mmap.error` 已合併進 :exc:`OSError`,而" "建構函式可能會回傳子類別。" -#: ../../library/exceptions.rst:404 +#: ../../library/exceptions.rst:412 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " "function, instead of the name encoded to or decoded from the :term:" @@ -608,7 +617,7 @@ msgstr "" "和錯誤處理函式 `\\ 編碼或解碼過的名" "稱。並且新增 *filename2* 建構函式引數與屬性。" -#: ../../library/exceptions.rst:413 +#: ../../library/exceptions.rst:421 msgid "" "Raised when the result of an arithmetic operation is too large to be " "represented. This cannot occur for integers (which would rather raise :exc:" @@ -622,7 +631,7 @@ msgstr "" "有時候會因為整數在要求範圍之外而引發。因為在 C 裡面缺乏浮點數例外處理的標準" "化,大部分的浮點數運算都沒有被檢查。" -#: ../../library/exceptions.rst:423 +#: ../../library/exceptions.rst:431 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when an " "operation is blocked during interpreter shutdown also known as :term:`Python " @@ -632,7 +641,7 @@ msgstr "" "`Python 最終化 (Python finalization) `)期間被阻塞會引" "發此例外。" -#: ../../library/exceptions.rst:427 +#: ../../library/exceptions.rst:435 msgid "" "Examples of operations which can be blocked with a :exc:" "`PythonFinalizationError` during the Python finalization:" @@ -640,23 +649,23 @@ msgstr "" "在 Python 最終化期間,能夠以 :exc:`PythonFinalizationError` 被阻塞的操作範" "例:" -#: ../../library/exceptions.rst:430 +#: ../../library/exceptions.rst:438 msgid "Creating a new Python thread." msgstr "建立新的 Python 執行緒。" -#: ../../library/exceptions.rst:431 +#: ../../library/exceptions.rst:439 msgid ":func:`os.fork`." msgstr ":func:`os.fork`。" -#: ../../library/exceptions.rst:433 +#: ../../library/exceptions.rst:441 msgid "See also the :func:`sys.is_finalizing` function." msgstr "也可以參閱 :func:`sys.is_finalizing` 函式。" -#: ../../library/exceptions.rst:435 ../../library/exceptions.rst:445 +#: ../../library/exceptions.rst:443 ../../library/exceptions.rst:453 msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "在之前,會引發一般的 :exc:`RuntimeError`。" -#: ../../library/exceptions.rst:441 +#: ../../library/exceptions.rst:449 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " "interpreter detects that the maximum recursion depth (see :func:`sys." @@ -665,7 +674,7 @@ msgstr "" "此例外衍生自 :exc:`RuntimeError`。當直譯器偵測到超過最大的遞迴深度(參考 :" "func:`sys.getrecursionlimit`)時會引發此例外。" -#: ../../library/exceptions.rst:451 +#: ../../library/exceptions.rst:459 msgid "" "This exception is raised when a weak reference proxy, created by the :func:" "`weakref.proxy` function, is used to access an attribute of the referent " @@ -676,7 +685,7 @@ msgstr "" "用來存取已經被垃圾回收 (garbage collected) 的參照物屬性時會引發此例外。更多關" "於弱參照的資訊參考 :mod:`weakref` 模組。" -#: ../../library/exceptions.rst:459 +#: ../../library/exceptions.rst:467 msgid "" "Raised when an error is detected that doesn't fall in any of the other " "categories. The associated value is a string indicating what precisely went " @@ -685,7 +694,7 @@ msgstr "" "當偵測到一個不屬於任何其他種類的錯誤時會引發此例外。關聯值是一個表示確切什麼" "地方出錯的字串。" -#: ../../library/exceptions.rst:466 +#: ../../library/exceptions.rst:474 msgid "" "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" "`~iterator.__next__` method to signal that there are no further items " @@ -694,7 +703,7 @@ msgstr "" "會被內建函式 :func:`next` 及 :term:`iterator` 的 :meth:`~iterator.__next__` " "方法引發,用來表示疊代器沒有更多項目可以產生。" -#: ../../library/exceptions.rst:472 +#: ../../library/exceptions.rst:480 msgid "" "The exception object has a single attribute :attr:`!value`, which is given " "as an argument when constructing the exception, and defaults to :const:" @@ -703,7 +712,7 @@ msgstr "" "此例外物件有單一屬性 :attr:`!value`,當建構此例外時會以引數給定,預設為 :" "const:`None`。" -#: ../../library/exceptions.rst:476 +#: ../../library/exceptions.rst:484 msgid "" "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" "`StopIteration` instance is raised, and the value returned by the function " @@ -713,7 +722,7 @@ msgstr "" "`StopIteration` 實例會被引發,而該函式的回傳值會被用來當作此例外建構函式的 :" "attr:`value` 參數。" -#: ../../library/exceptions.rst:481 +#: ../../library/exceptions.rst:489 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " @@ -722,13 +731,13 @@ msgstr "" "如果產生器程式直接或間接引發 :exc:`StopIteration`,則其會被轉換成 :exc:" "`RuntimeError`\\ (保留 :exc:`StopIteration` 作為新例外的成因)。" -#: ../../library/exceptions.rst:485 +#: ../../library/exceptions.rst:493 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." msgstr "新增 ``value`` 屬性且產生器函式可以用它來回傳值。" -#: ../../library/exceptions.rst:489 +#: ../../library/exceptions.rst:497 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." @@ -736,7 +745,7 @@ msgstr "" "透過 ``from __future__ import generator_stop`` 引入 RuntimeError 的轉換,參" "考 :pep:`479`。" -#: ../../library/exceptions.rst:493 +#: ../../library/exceptions.rst:501 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." @@ -744,7 +753,7 @@ msgstr "" "預設對所有程式啟用 :pep:`479`:在產生器引發的 :exc:`StopIteration` 錯誤會轉換" "成 :exc:`RuntimeError`。" -#: ../../library/exceptions.rst:499 +#: ../../library/exceptions.rst:507 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." @@ -752,7 +761,7 @@ msgstr "" "此例外必須被 :term:`asynchronous iterator` 物件的 :meth:`~object.__anext__` " "方法引發來停止疊代。" -#: ../../library/exceptions.rst:506 +#: ../../library/exceptions.rst:514 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" @@ -763,7 +772,7 @@ msgstr "" "呼叫內建函式 :func:`compile`、:func:`exec` 或 :func:`eval` 的時候,或者在讀取" "初始腳本或標準輸入(也包含互動式)的時候。" -#: ../../library/exceptions.rst:512 +#: ../../library/exceptions.rst:520 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." @@ -771,18 +780,18 @@ msgstr "" "例外實例的 :func:`str` 只回傳錯誤訊息。Details 是個元組,其成員也能夠以分開的" "屬性取得。" -#: ../../library/exceptions.rst:517 +#: ../../library/exceptions.rst:525 msgid "The name of the file the syntax error occurred in." msgstr "發生語法錯誤所在的檔案名稱。" -#: ../../library/exceptions.rst:521 +#: ../../library/exceptions.rst:529 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" "發生錯誤所在檔案的列號。這是以 1 開始的索引:檔案第一列的 ``lineno`` 是 1。" -#: ../../library/exceptions.rst:526 +#: ../../library/exceptions.rst:534 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." @@ -790,11 +799,11 @@ msgstr "" "發生錯誤所在該列的欄號 (column)。這是以 1 開始的索引:該列第一個字元的 " "``offset`` 是 1。" -#: ../../library/exceptions.rst:531 +#: ../../library/exceptions.rst:539 msgid "The source code text involved in the error." msgstr "涉及該錯誤的原始程式碼文字。" -#: ../../library/exceptions.rst:535 +#: ../../library/exceptions.rst:543 msgid "" "Which line number in the file the error occurred ends in. This is 1-indexed: " "the first line in the file has a ``lineno`` of 1." @@ -802,7 +811,7 @@ msgstr "" "發生錯誤所在檔案的結束列號。這是以 1 開始的索引:檔案第一列的 ``lineno`` 是 " "1。" -#: ../../library/exceptions.rst:540 +#: ../../library/exceptions.rst:548 msgid "" "The column in the end line where the error occurred finishes. This is 1-" "indexed: the first character in the line has an ``offset`` of 1." @@ -810,7 +819,7 @@ msgstr "" "發生錯誤所在該結束列的欄號。這是以 1 開始的索引:該列第一個字元的 ``offset`` " "是 1。" -#: ../../library/exceptions.rst:543 +#: ../../library/exceptions.rst:551 msgid "" "For errors in f-string fields, the message is prefixed by \"f-string: \" and " "the offsets are offsets in a text constructed from the replacement " @@ -821,18 +830,18 @@ msgstr "" "(offset) 是從替代表達式建構的文字的偏移量。例如編譯 f'Bad {a b} field' 會得到" "這個 args 屬性:('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))。" -#: ../../library/exceptions.rst:548 +#: ../../library/exceptions.rst:556 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." msgstr "新增 :attr:`end_lineno` 與 :attr:`end_offset` 屬性。" -#: ../../library/exceptions.rst:553 +#: ../../library/exceptions.rst:561 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" "與不正確的縮排有關的語法錯誤的基礎類別。這是 :exc:`SyntaxError` 的子類別。" -#: ../../library/exceptions.rst:559 +#: ../../library/exceptions.rst:567 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." @@ -840,7 +849,7 @@ msgstr "" "當縮排包含製表符號 (tab) 和空白的不一致用法時會引發此例外。這是 :exc:" "`IndentationError` 的子類別。" -#: ../../library/exceptions.rst:565 +#: ../../library/exceptions.rst:573 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " @@ -853,7 +862,7 @@ msgstr "" "`CPython` 中,這可能是因為錯誤地使用 Python 的 C API,例如回傳一個 ``NULL`` " "值而沒有設定例外。" -#: ../../library/exceptions.rst:571 +#: ../../library/exceptions.rst:579 msgid "" "If you're confident that this exception wasn't your fault, or the fault of a " "package you're using, you should report this to the author or maintainer of " @@ -868,7 +877,8 @@ msgstr "" "互動式 Python 會話的開頭被印出)、確切的錯誤訊息(該例外的關聯值)及如果可能" "的話,觸發此錯誤的程式來源。" -#: ../../library/exceptions.rst:582 +#: ../../library/exceptions.rst:590 +#, fuzzy msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -877,7 +887,7 @@ msgid "" "it is not handled, the Python interpreter exits; no stack traceback is " "printed. The constructor accepts the same optional argument passed to :func:" "`sys.exit`. If the value is an integer, it specifies the system exit status " -"(passed to C's :c:func:`exit` function); if it is ``None``, the exit status " +"(passed to C's :c:func:`!exit` function); if it is ``None``, the exit status " "is zero; if it has another type (such as a string), the object's value is " "printed and the exit status is one." msgstr "" @@ -889,7 +899,7 @@ msgstr "" "``None``,結束狀態會是 0;如果它是其他型別(例如字串),則物件的值會被印出而" "結束狀態是 1。" -#: ../../library/exceptions.rst:593 +#: ../../library/exceptions.rst:601 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -903,13 +913,13 @@ msgstr "" "風險下執行腳本。如果在絕對有必要立即結束的情況(例如在子行程呼叫完 :func:`os." "fork` 之後 )可以使用 :func:`os._exit` 函式。" -#: ../../library/exceptions.rst:602 +#: ../../library/exceptions.rst:610 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "傳入建構函式的結束狀態或錯誤訊息。(預設是 ``None``。 )" -#: ../../library/exceptions.rst:608 +#: ../../library/exceptions.rst:616 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " @@ -918,7 +928,7 @@ msgstr "" "當一個操作或函式被用在不適合的型別的物件時會引發此例外。關聯值是一個字串,提" "供關於不相符型別的細節。" -#: ../../library/exceptions.rst:611 +#: ../../library/exceptions.rst:619 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -929,7 +939,7 @@ msgstr "" "這樣做。如果一個物件有意要支援某個給定的操作但尚未提供實作,該引發的正確例外" "是 :exc:`NotImplementedError`。" -#: ../../library/exceptions.rst:616 +#: ../../library/exceptions.rst:624 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -940,7 +950,7 @@ msgstr "" "導致 :exc:`TypeError`,但傳入帶有錯誤值的引數(例如超出預期範圍的數值)應該要" "導致 :exc:`ValueError`。" -#: ../../library/exceptions.rst:623 +#: ../../library/exceptions.rst:631 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" @@ -949,7 +959,7 @@ msgstr "" "當在函式或方法裡引用某個區域變數,但該變數尚未被繫結到任何值的時候會引發此例" "外。這是 :exc:`NameError` 的子類別。" -#: ../../library/exceptions.rst:630 +#: ../../library/exceptions.rst:638 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." @@ -957,7 +967,7 @@ msgstr "" "當 Unicode 相關的編碼或解碼錯誤發生時會引發此例外。這是 :exc:`ValueError` 的" "子類別。" -#: ../../library/exceptions.rst:633 +#: ../../library/exceptions.rst:641 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " @@ -966,27 +976,27 @@ msgstr "" ":exc:`UnicodeError` 有屬性描述編碼或解碼錯誤。例如 ``err.object[err.start:" "err.end]`` 會提供讓編解碼器失敗的具體無效輸入。" -#: ../../library/exceptions.rst:639 +#: ../../library/exceptions.rst:647 msgid "The name of the encoding that raised the error." msgstr "引發錯誤的編碼名稱。" -#: ../../library/exceptions.rst:643 +#: ../../library/exceptions.rst:651 msgid "A string describing the specific codec error." msgstr "描述特定編解碼器錯誤的字串。" -#: ../../library/exceptions.rst:647 +#: ../../library/exceptions.rst:655 msgid "The object the codec was attempting to encode or decode." msgstr "編解碼器嘗試編碼或解碼的物件。" -#: ../../library/exceptions.rst:651 +#: ../../library/exceptions.rst:659 msgid "The first index of invalid data in :attr:`object`." msgstr "在 :attr:`object` 中無效資料的開始索引。" -#: ../../library/exceptions.rst:655 +#: ../../library/exceptions.rst:663 msgid "The index after the last invalid data in :attr:`object`." msgstr "在 :attr:`object` 中最後的無效資料後的索引。" -#: ../../library/exceptions.rst:660 +#: ../../library/exceptions.rst:668 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." @@ -994,7 +1004,7 @@ msgstr "" "在編碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:666 +#: ../../library/exceptions.rst:674 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." @@ -1002,7 +1012,7 @@ msgstr "" "在解碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:672 +#: ../../library/exceptions.rst:680 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." @@ -1010,7 +1020,7 @@ msgstr "" "在轉譯當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:678 +#: ../../library/exceptions.rst:686 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " @@ -1019,7 +1029,7 @@ msgstr "" "當一個操作或函式收到引數是正確型別但是不適合的值,且該情況無法被更精確的例外" "例如 :exc:`IndexError` 所描述時會引發此例外。" -#: ../../library/exceptions.rst:685 +#: ../../library/exceptions.rst:693 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " @@ -1028,7 +1038,7 @@ msgstr "" "當除法或模數運算 (modulo operation) 的第二個引數是 0 的時候會引發此例外。關聯" "值是一個字串,表示運算元及運算的類型。" -#: ../../library/exceptions.rst:690 +#: ../../library/exceptions.rst:698 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." @@ -1036,21 +1046,21 @@ msgstr "" "以下例外是為了相容於之前版本而保留;從 Python 3.3 開始,它們是 :exc:" "`OSError` 的別名。" -#: ../../library/exceptions.rst:699 +#: ../../library/exceptions.rst:707 msgid "Only available on Windows." msgstr "僅限於在 Windows 中使用。" -#: ../../library/exceptions.rst:703 +#: ../../library/exceptions.rst:711 msgid "OS exceptions" msgstr "作業系統例外" -#: ../../library/exceptions.rst:705 +#: ../../library/exceptions.rst:713 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "以下的例外是 :exc:`OSError` 的子類別,它們根據系統錯誤代碼來引發。" -#: ../../library/exceptions.rst:710 +#: ../../library/exceptions.rst:718 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1061,14 +1071,14 @@ msgstr "" "到 :c:data:`errno` :py:const:`~errno.EAGAIN`、:py:const:`~errno.EALREADY`、:" "py:const:`~errno.EWOULDBLOCK` 及 :py:const:`~errno.EINPROGRESS`。" -#: ../../library/exceptions.rst:715 +#: ../../library/exceptions.rst:723 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" "除了 :exc:`OSError` 的那些屬性之外,:exc:`BlockingIOError` 有多一個屬性:" -#: ../../library/exceptions.rst:720 +#: ../../library/exceptions.rst:728 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " @@ -1077,7 +1087,7 @@ msgstr "" "一個整數,內容為在其阻塞之前,已寫進串流的字元數。當使用 :mod:`io` 模組裡的緩" "衝 I/O 類別時這個屬性是可用的。" -#: ../../library/exceptions.rst:726 +#: ../../library/exceptions.rst:734 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` :py:const:`~errno.ECHILD`." @@ -1085,11 +1095,11 @@ msgstr "" "當子行程上的操作失敗時會引發此例外。對應到 :c:data:`errno` :py:const:`~errno." "ECHILD`。" -#: ../../library/exceptions.rst:731 +#: ../../library/exceptions.rst:739 msgid "A base class for connection-related issues." msgstr "連線相關問題的基礎類別。" -#: ../../library/exceptions.rst:733 +#: ../../library/exceptions.rst:741 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." @@ -1097,7 +1107,7 @@ msgstr "" "子類別有 :exc:`BrokenPipeError`、:exc:`ConnectionAbortedError`、:exc:" "`ConnectionRefusedError` 及 :exc:`ConnectionResetError`。" -#: ../../library/exceptions.rst:738 +#: ../../library/exceptions.rst:746 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " @@ -1108,7 +1118,7 @@ msgstr "" "會引發此例外,或者當嘗試寫入已關閉寫入的 socket 時也會引發。對應到 :c:data:" "`errno` :py:const:`~errno.EPIPE` 及 :py:const:`~errno.ESHUTDOWN`。" -#: ../../library/exceptions.rst:745 +#: ../../library/exceptions.rst:753 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1117,7 +1127,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線的嘗試被對等端點 (peer) 中斷時會引" "發此例外。對應到 :c:data:`errno` :py:const:`~errno.ECONNABORTED`。" -#: ../../library/exceptions.rst:751 +#: ../../library/exceptions.rst:759 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1126,7 +1136,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線的嘗試被對等端點拒絕時會引發此例" "外。對應到 :c:data:`errno` :py:const:`~errno.ECONNREFUSED`。" -#: ../../library/exceptions.rst:757 +#: ../../library/exceptions.rst:765 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." @@ -1134,7 +1144,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線被對等端點重置時會引發此例外。對應" "到 :c:data:`errno` :py:const:`~errno.ECONNRESET`。" -#: ../../library/exceptions.rst:763 +#: ../../library/exceptions.rst:771 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." @@ -1142,7 +1152,7 @@ msgstr "" "當嘗試建立已存在的檔案或目錄時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.EEXIST`。" -#: ../../library/exceptions.rst:768 +#: ../../library/exceptions.rst:776 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` :py:const:`~errno.ENOENT`." @@ -1150,7 +1160,7 @@ msgstr "" "當請求不存在的檔案或目錄時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.ENOENT`。" -#: ../../library/exceptions.rst:773 +#: ../../library/exceptions.rst:781 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." @@ -1158,7 +1168,7 @@ msgstr "" "當系統呼叫被傳入的信號中斷時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.EINTR`。" -#: ../../library/exceptions.rst:776 +#: ../../library/exceptions.rst:784 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " @@ -1167,7 +1177,7 @@ msgstr "" "現在當 syscall 被信號中斷時 Python 會重試系統呼叫而不會引發 :exc:" "`InterruptedError`,除非信號處理器引發例外(理由可參考 :pep:`475`)。" -#: ../../library/exceptions.rst:783 +#: ../../library/exceptions.rst:791 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." @@ -1175,7 +1185,7 @@ msgstr "" "當在目錄上請求檔案操作(例如 :func:`os.remove`)時會引發此例外。對應到 :c:" "data:`errno` :py:const:`~errno.EISDIR`。" -#: ../../library/exceptions.rst:789 +#: ../../library/exceptions.rst:797 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " @@ -1187,7 +1197,7 @@ msgstr "" "外。在大多數的 POSIX 平台上,如果嘗試操作開啟或遍歷一個當作目錄的非目錄檔案也" "會引發此例外。對應到 :c:data:`errno` :py:const:`~errno.ENOTDIR`。" -#: ../../library/exceptions.rst:797 +#: ../../library/exceptions.rst:805 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" @@ -1198,14 +1208,14 @@ msgstr "" "到 :c:data:`errno` :py:const:`~errno.EACCES`、:py:const:`~errno.EPERM` 及 :" "py:const:`~errno.ENOTCAPABLE`。" -#: ../../library/exceptions.rst:802 +#: ../../library/exceptions.rst:810 msgid "" "WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" "`PermissionError`." msgstr "" "WASI 的 :py:const:`~errno.ENOTCAPABLE` 現在對應到 :exc:`PermissionError`。" -#: ../../library/exceptions.rst:808 +#: ../../library/exceptions.rst:816 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" "py:const:`~errno.ESRCH`." @@ -1213,7 +1223,7 @@ msgstr "" "當給定的行程不存在時會引發此例外。對應到 :c:data:`errno` :py:const:`~errno." "ESRCH`。" -#: ../../library/exceptions.rst:813 +#: ../../library/exceptions.rst:821 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` :py:const:`~errno.ETIMEDOUT`." @@ -1221,40 +1231,40 @@ msgstr "" "當系統函式在系統層級超時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.ETIMEDOUT`。" -#: ../../library/exceptions.rst:816 +#: ../../library/exceptions.rst:824 msgid "All the above :exc:`OSError` subclasses were added." msgstr "加入以上所有的 :exc:`OSError` 子類別。" -#: ../../library/exceptions.rst:822 +#: ../../library/exceptions.rst:830 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr ":pep:`3151` — 改寫作業系統與 IO 例外階層" -#: ../../library/exceptions.rst:828 +#: ../../library/exceptions.rst:836 msgid "Warnings" msgstr "警告" -#: ../../library/exceptions.rst:830 +#: ../../library/exceptions.rst:838 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" "以下的例外是當作警告的種類使用;更多細節參考 :ref:`warning-categories` 文件。" -#: ../../library/exceptions.rst:835 +#: ../../library/exceptions.rst:843 msgid "Base class for warning categories." msgstr "警告種類的基礎類別。" -#: ../../library/exceptions.rst:840 +#: ../../library/exceptions.rst:848 msgid "Base class for warnings generated by user code." msgstr "使用者程式碼產生的警告的基礎類別。" -#: ../../library/exceptions.rst:845 +#: ../../library/exceptions.rst:853 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "關於已棄用功能的警告的基礎類別,且當那些警告是針對其他 Python 開發者。" -#: ../../library/exceptions.rst:848 +#: ../../library/exceptions.rst:856 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " @@ -1263,17 +1273,17 @@ msgstr "" "會被預設的警告過濾器忽略,在 ``__main__`` 模組裡除外 (:pep:`565`)。啟用 :ref:" "`Python 開發模式 `\\ 會顯示此警告。" -#: ../../library/exceptions.rst:852 ../../library/exceptions.rst:868 +#: ../../library/exceptions.rst:860 ../../library/exceptions.rst:876 msgid "The deprecation policy is described in :pep:`387`." msgstr "棄用原則描述在 :pep:`387` 裡。" -#: ../../library/exceptions.rst:857 +#: ../../library/exceptions.rst:865 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "關於過時且預期未來要被棄用,但目前尚未被棄用的功能的警告的基礎類別。" -#: ../../library/exceptions.rst:861 +#: ../../library/exceptions.rst:869 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " @@ -1282,8 +1292,8 @@ msgstr "" "因為發出關於可能即將被棄用的警告是不尋常的,此類別很少被使用,而對已經被棄用" "的情況會優先使用 :exc:`DeprecationWarning`。" -#: ../../library/exceptions.rst:865 ../../library/exceptions.rst:891 -#: ../../library/exceptions.rst:918 +#: ../../library/exceptions.rst:873 ../../library/exceptions.rst:899 +#: ../../library/exceptions.rst:926 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." @@ -1291,15 +1301,15 @@ msgstr "" "會被預設的警告過濾器忽略。啟用 :ref:`Python 開發模式 `\\ 會顯示此警" "告。" -#: ../../library/exceptions.rst:873 +#: ../../library/exceptions.rst:881 msgid "Base class for warnings about dubious syntax." msgstr "關於可疑語法的警告的基礎類別。" -#: ../../library/exceptions.rst:878 +#: ../../library/exceptions.rst:886 msgid "Base class for warnings about dubious runtime behavior." msgstr "關於可疑執行環境行為的警告的基礎類別。" -#: ../../library/exceptions.rst:883 +#: ../../library/exceptions.rst:891 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." @@ -1307,36 +1317,36 @@ msgstr "" "關於已棄用功能的警告的基礎類別,且當那些警告是針對以 Python 寫的應用程式的終" "端使用者。" -#: ../../library/exceptions.rst:889 +#: ../../library/exceptions.rst:897 msgid "Base class for warnings about probable mistakes in module imports." msgstr "關於在模組引入的可能錯誤的警告的基礎類別。" -#: ../../library/exceptions.rst:897 +#: ../../library/exceptions.rst:905 msgid "Base class for warnings related to Unicode." msgstr "Unicode 相關警告的基礎類別。" -#: ../../library/exceptions.rst:902 +#: ../../library/exceptions.rst:910 msgid "Base class for warnings related to encodings." msgstr "編碼相關警告的基礎類別。" -#: ../../library/exceptions.rst:904 +#: ../../library/exceptions.rst:912 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節參考\\ :ref:`io-encoding-warning`。" -#: ../../library/exceptions.rst:911 +#: ../../library/exceptions.rst:919 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr ":class:`bytes` 及 :class:`bytearray` 相關警告的基礎類別。" -#: ../../library/exceptions.rst:916 +#: ../../library/exceptions.rst:924 msgid "Base class for warnings related to resource usage." msgstr "資源用法相關警告的基礎類別。" -#: ../../library/exceptions.rst:927 +#: ../../library/exceptions.rst:935 msgid "Exception groups" msgstr "例外群組" -#: ../../library/exceptions.rst:929 +#: ../../library/exceptions.rst:937 msgid "" "The following are used when it is necessary to raise multiple unrelated " "exceptions. They are part of the exception hierarchy so they can be handled " @@ -1348,7 +1358,7 @@ msgstr "" "所有其他例外一樣使用 :keyword:`except` 來處理。此外,它們會以包含的例外型別為" "基礎來比對其子群組而被 :keyword:`except*` 辨認出來。" -#: ../../library/exceptions.rst:938 +#: ../../library/exceptions.rst:946 msgid "" "Both of these exception types wrap the exceptions in the sequence ``excs``. " "The ``msg`` parameter must be a string. The difference between the two " @@ -1364,7 +1374,7 @@ msgstr "" "`Exception` 的子類別。這個設計使得 ``except Exception`` 可以捕捉 :exc:" "`ExceptionGroup` 但不能捕捉 :exc:`BaseExceptionGroup`。" -#: ../../library/exceptions.rst:946 +#: ../../library/exceptions.rst:954 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1377,17 +1387,17 @@ msgstr "" "使用來讓這樣的選擇自動化。另一方面來說,如果任何包含的例外不是 :exc:" "`Exception` 的子類別,:exc:`ExceptionGroup` 建構函式會引發 :exc:`TypeError`。" -#: ../../library/exceptions.rst:955 +#: ../../library/exceptions.rst:963 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "建構函式的 ``msg`` 引數。這是一個唯讀的屬性。" -#: ../../library/exceptions.rst:959 +#: ../../library/exceptions.rst:967 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "指定給建構函式 ``excs`` 序列中的例外組成的元組。這是一個唯讀的屬性。" -#: ../../library/exceptions.rst:964 +#: ../../library/exceptions.rst:972 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." @@ -1395,7 +1405,7 @@ msgstr "" "回傳只包含從現有群組比對到 *condition* 的例外的例外群組,或者當結果為空時回" "傳 ``None``。" -#: ../../library/exceptions.rst:967 +#: ../../library/exceptions.rst:975 msgid "" "The condition can be an exception type or tuple of exception types, in which " "case each exception is checked for a match using the same check that is used " @@ -1408,7 +1418,7 @@ msgstr "" "物件(除了型別物件之外),其接受一個例外作為單一引數,而如果該例外應該在子群" "組中就回傳 true。" -#: ../../library/exceptions.rst:973 +#: ../../library/exceptions.rst:981 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`~BaseException." @@ -1421,7 +1431,7 @@ msgstr "" "__context__` 及 :attr:`~BaseException.__notes__` 欄位的值也一樣。空的巢狀群組" "會從結果裡排除。" -#: ../../library/exceptions.rst:980 +#: ../../library/exceptions.rst:988 msgid "" "The condition is checked for all exceptions in the nested exception group, " "including the top-level and any nested exception groups. If the condition is " @@ -1430,11 +1440,11 @@ msgstr "" "條件會對巢狀例外群組裡的所有例外做檢查,包括頂層及任何巢狀的例外群組。如果條" "件對這樣的例外群組為 true,它會被完整包含在結果裡。" -#: ../../library/exceptions.rst:984 +#: ../../library/exceptions.rst:992 msgid "``condition`` can be any callable which is not a type object." msgstr "``condition`` 可以是任何不是型別物件的可呼叫物件。" -#: ../../library/exceptions.rst:989 +#: ../../library/exceptions.rst:997 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" @@ -1443,13 +1453,13 @@ msgstr "" "像 :meth:`subgroup` 一樣,但回傳一對 ``(match, rest)``,其中 ``match`` 是 " "``subgroup(condition)`` 而 ``rest`` 是剩下沒有比對到的部分。" -#: ../../library/exceptions.rst:995 +#: ../../library/exceptions.rst:1003 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "回傳有相同 :attr:`message` 但將例外包裝在 ``excs`` 的例外群組。" -#: ../../library/exceptions.rst:998 +#: ../../library/exceptions.rst:1006 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`, which are used in " "various contexts to break up an exception group. A subclass needs to " @@ -1460,7 +1470,7 @@ msgstr "" "組。子類別需要覆寫它來讓 :meth:`subgroup` 及 :meth:`split` 回傳子類別而不是 :" "exc:`ExceptionGroup` 的實例。" -#: ../../library/exceptions.rst:1004 +#: ../../library/exceptions.rst:1012 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`~BaseException." "__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." @@ -1473,7 +1483,7 @@ msgstr "" "`~BaseException.__context__` 和 :attr:`~BaseException.__notes__` 欄位到 :" "meth:`derive` 所回傳的例外群組上,因此這些欄位不需要被 :meth:`derive` 更新。" -#: ../../library/exceptions.rst:1011 +#: ../../library/exceptions.rst:1019 msgid "" ">>> class MyGroup(ExceptionGroup):\n" "... def derive(self, excs):\n" @@ -1527,7 +1537,7 @@ msgstr "" ">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" "True" -#: ../../library/exceptions.rst:1037 +#: ../../library/exceptions.rst:1045 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " "subclasses that need a different constructor signature need to override that " @@ -1539,7 +1549,7 @@ msgstr "" "建構函式簽名的子類別需要覆寫它而不是 :meth:`~object.__init__`。例如下面定義了" "一個例外群組子類別接受 exit_code 並從中建構群組的訊息。: ::" -#: ../../library/exceptions.rst:1043 +#: ../../library/exceptions.rst:1051 msgid "" "class Errors(ExceptionGroup):\n" " def __new__(cls, errors, exit_code):\n" @@ -1559,7 +1569,7 @@ msgstr "" " def derive(self, excs):\n" " return Errors(excs, self.exit_code)" -#: ../../library/exceptions.rst:1052 +#: ../../library/exceptions.rst:1060 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" @@ -1568,15 +1578,15 @@ msgstr "" "像 :exc:`ExceptionGroup` 一樣,任何 :exc:`BaseExceptionGroup` 的子類別且也" "是 :exc:`Exception` 的子類別只能包裝 :exc:`Exception` 的實例。" -#: ../../library/exceptions.rst:1060 +#: ../../library/exceptions.rst:1068 msgid "Exception hierarchy" msgstr "例外階層" -#: ../../library/exceptions.rst:1062 +#: ../../library/exceptions.rst:1070 msgid "The class hierarchy for built-in exceptions is:" msgstr "內建例外的類別階層如下:" -#: ../../library/exceptions.rst:1064 +#: ../../library/exceptions.rst:1072 msgid "" "BaseException\n" " ├── BaseExceptionGroup\n" @@ -1757,10 +1767,28 @@ msgstr "__suppress_context__(例外屬性)" msgid "assert" msgstr "assert" -#: ../../library/exceptions.rst:347 +#: ../../library/exceptions.rst:355 msgid "module" msgstr "module(模組)" -#: ../../library/exceptions.rst:347 +#: ../../library/exceptions.rst:355 msgid "errno" msgstr "errno" + +#~ msgid "" +#~ "The :attr:`name` and :attr:`obj` attributes can be set using keyword-only " +#~ "arguments to the constructor. When set they represent the name of the " +#~ "attribute that was attempted to be accessed and the object that was " +#~ "accessed for said attribute, respectively." +#~ msgstr "" +#~ ":attr:`name` 和 :attr:`obj` 屬性可以使用建構函式的僅限關鍵字 (keyword-" +#~ "only) 引數來設定。當被設定的時候,它們分別代表被嘗試存取的屬性名稱以及被以" +#~ "該屬性存取的物件。" + +#~ msgid "" +#~ "The :attr:`name` attribute can be set using a keyword-only argument to " +#~ "the constructor. When set it represent the name of the variable that was " +#~ "attempted to be accessed." +#~ msgstr "" +#~ ":attr:`name` 屬性可以使用僅限關鍵字引數來設定到建構函式。當被設定的時候它" +#~ "代表被嘗試存取的變數名稱。" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 270fd31027..11ecea8f5f 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-07-09 00:17+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,8 +33,8 @@ msgstr "Pablo Galindo Salgado" #: ../../whatsnew/3.11.rst:47 msgid "" "This article explains the new features in Python 3.11, compared to 3.10. " -"Python 3.11 was released on October 24, 2022. For full details, see " -"the :ref:`changelog `." +"Python 3.11 was released on October 24, 2022. For full details, see the :ref:" +"`changelog `." msgstr "" "此文章解釋了 Python 3.11 和 3.10 相比多了哪些新功能。Python 3.11 於 2022 年 " "10 月 24 日發布。完整細節請見 :ref:`changelog`。" @@ -46,8 +46,8 @@ msgstr "發布重點摘要" #: ../../whatsnew/3.11.rst:60 msgid "" "Python 3.11 is between 10-60% faster than Python 3.10. On average, we " -"measured a 1.25x speedup on the standard benchmark suite. " -"See :ref:`whatsnew311-faster-cpython` for details." +"measured a 1.25x speedup on the standard benchmark suite. See :ref:" +"`whatsnew311-faster-cpython` for details." msgstr "" "Python 3.11 比 Python 3.10 快了 10-60%。我們使用了標準基準量測套裝軟體 " "(benchmark suite) 測得平均加速了 1.25x。細節請見\\ :ref:`whatsnew311-faster-" @@ -244,13 +244,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:159 msgid "" "Additionally, the information used by the enhanced traceback feature is made " -"available via a general API, that can be used to " -"correlate :term:`bytecode` :ref:`instructions ` with source code " -"location. This information can be retrieved using:" +"available via a general API, that can be used to correlate :term:`bytecode` :" +"ref:`instructions ` with source code location. This information " +"can be retrieved using:" msgstr "" -"此外,強化回溯特性所使用的資訊可以透過一般的 API 來取得,以用來" -"使 :term:`bytecode` :ref:`指示 (instruction) `\\ 與原始碼位置相互" -"關聯。此項資訊可以用以下方式取得:" +"此外,強化回溯特性所使用的資訊可以透過一般的 API 來取得,以用來使 :term:" +"`bytecode` :ref:`指示 (instruction) `\\ 與原始碼位置相互關聯。此項" +"資訊可以用以下方式取得:" #: ../../whatsnew/3.11.rst:164 msgid "The :meth:`codeobject.co_positions` method in Python." @@ -265,8 +265,8 @@ msgid "" "See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan " "Taskaya and Ammar Askar in :issue:`43950`.)" msgstr "" -"詳情請見 :pep:`657`。(由 Pablo Galindo、Batuhan Taskaya 與 Ammar Askar " -"於 :issue:`43950` 中所貢獻。)" +"詳情請見 :pep:`657`。(由 Pablo Galindo、Batuhan Taskaya 與 Ammar Askar 於 :" +"issue:`43950` 中所貢獻。)" #: ../../whatsnew/3.11.rst:171 msgid "" @@ -274,8 +274,8 @@ msgid "" "may result in a small increase in interpreter memory usage and disk usage " "for compiled Python files. To avoid storing the extra information and " "deactivate printing the extra traceback information, use the :option:`-X " -"no_debug_ranges <-X>` command line option or " -"the :envvar:`PYTHONNODEBUGRANGES` environment variable." +"no_debug_ranges <-X>` command line option or the :envvar:" +"`PYTHONNODEBUGRANGES` environment variable." msgstr "" "這個特性必須要將欄的位置 (column position) 儲存於 :ref:`codeobjects`,這可能" "會導致直譯器用於編譯 Python 檔案的記憶體使用量與硬碟使用量增加。為了避免儲存" @@ -289,16 +289,16 @@ msgstr "PEP 654:例外群組與 ``except*``" #: ../../whatsnew/3.11.rst:185 msgid "" ":pep:`654` introduces language features that enable a program to raise and " -"handle multiple unrelated exceptions simultaneously. The builtin " -"types :exc:`ExceptionGroup` and :exc:`BaseExceptionGroup` make it possible " -"to group exceptions and raise them together, and the new :keyword:`except* " +"handle multiple unrelated exceptions simultaneously. The builtin types :exc:" +"`ExceptionGroup` and :exc:`BaseExceptionGroup` make it possible to group " +"exceptions and raise them together, and the new :keyword:`except* " "` syntax generalizes :keyword:`except` to match subgroups of " "exception groups." msgstr "" ":pep:`654` 引入了新的的語言特性,可讓程式同時引發並處理多個相互無關的例外。內" "建型別 :exc:`ExceptionGroup` 和 :exc:`BaseExceptionGroup` 使得程式可為多個例" -"外組成群組並同時引發,新的 :keyword:`except* ` 語法也" -"將 :keyword:`except` 泛用化、能夠比對例外群組的子群組。" +"外組成群組並同時引發,新的 :keyword:`except* ` 語法也將 :" +"keyword:`except` 泛用化、能夠比對例外群組的子群組。" #: ../../whatsnew/3.11.rst:192 msgid "See :pep:`654` for more details." @@ -346,33 +346,33 @@ msgstr "Windows ``py.exe`` 啟動程式 (launcher) 的改進" #: ../../whatsnew/3.11.rst:219 msgid "" "The copy of the :ref:`launcher` included with Python 3.11 has been " -"significantly updated. It now supports company/tag syntax as defined " -"in :pep:`514` using the :samp:`-V:{}/{}` argument instead of " -"the limited :samp:`-{}.{}`. This allows launching " -"distributions other than ``PythonCore``, the one hosted on `python.org " -"`_." +"significantly updated. It now supports company/tag syntax as defined in :pep:" +"`514` using the :samp:`-V:{}/{}` argument instead of the " +"limited :samp:`-{}.{}`. This allows launching distributions " +"other than ``PythonCore``, the one hosted on `python.org `_." msgstr "" -"Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支" -"援 :pep:`514` 所定義的公司/標籤 (tag) 語法,可用 :samp:`-V:{}/" -"{}` 引數來取代受限的 :samp:`-{}.{}`。這允許了 `python.org " -"`_ 上的 ``PythonCore`` 以外的發行版本發布。" +"Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支援 :pep:" +"`514` 所定義的公司/標籤 (tag) 語法,可用 :samp:`-V:{}/{}` 引數" +"來取代受限的 :samp:`-{}.{}`。這允許了 `python.org `_ 上的 ``PythonCore`` 以外的發行版本發布。" #: ../../whatsnew/3.11.rst:225 msgid "" "When using ``-V:`` selectors, either company or tag can be omitted, but all " "installs will be searched. For example, ``-V:OtherPython/`` will select the " -"\"best\" tag registered for ``OtherPython``, while ``-V:3.11`` or ``-V:/" -"3.11`` will select the \"best\" distribution with tag ``3.11``." +"\"best\" tag registered for ``OtherPython``, while ``-V:3.11`` or ``-" +"V:/3.11`` will select the \"best\" distribution with tag ``3.11``." msgstr "" -"使用 ``-V:`` 選擇器時,可以省略公司或標籤,但會搜尋所有安裝。例如,``-" -"V:OtherPython/`` 將選擇 ``OtherPython`` 註冊的「最佳」標籤,而 ``-V:3.11`` " -"或 ``-V:/3.11`` 將選擇帶有 ``3.11`` 標籤的「最佳」發行版。" +"使用 ``-V:`` 選擇器時,可以省略公司或標籤,但會搜尋所有安裝。例如,``-V:" +"OtherPython/`` 將選擇 ``OtherPython`` 註冊的「最佳」標籤,而 ``-V:3.11`` 或 " +"``-V:/3.11`` 將選擇帶有 ``3.11`` 標籤的「最佳」發行版。" #: ../../whatsnew/3.11.rst:230 msgid "" -"When using the legacy :samp:`-{}`, :samp:`-{}.{}" -"`, :samp:`-{}-{}` or :samp:`-{}.{}-{}" -"` arguments, all existing behaviour should be preserved from past versions, " +"When using the legacy :samp:`-{}`, :samp:`-{}.{}`, :" +"samp:`-{}-{}` or :samp:`-{}.{}-{}` " +"arguments, all existing behaviour should be preserved from past versions, " "and only releases from ``PythonCore`` will be selected. However, the ``-64`` " "suffix now implies \"not 32-bit\" (not necessarily x86-64), as there are " "multiple supported 64-bit platforms. 32-bit runtimes are detected by " @@ -393,8 +393,8 @@ msgstr "型別提示相關的新特性" #: ../../whatsnew/3.11.rst:246 msgid "" -"This section covers major changes affecting :pep:`484` type hints and " -"the :mod:`typing` module." +"This section covers major changes affecting :pep:`484` type hints and the :" +"mod:`typing` module." msgstr "" "這個部分涵蓋影響 :pep:`484` 型別提示 (type hints) 與 :mod:`typing` 模組的重大" "變更。" @@ -406,10 +406,10 @@ msgstr "PEP 646:可變參數泛型 (variadic generics)" #: ../../whatsnew/3.11.rst:255 msgid "" ":pep:`484` previously introduced :data:`~typing.TypeVar`, enabling creation " -"of generics parameterised with a single type. :pep:`646` " -"adds :data:`~typing.TypeVarTuple`, enabling parameterisation with an " -"*arbitrary* number of types. In other words, a :data:`~typing.TypeVarTuple` " -"is a *variadic* type variable, enabling *variadic* generics." +"of generics parameterised with a single type. :pep:`646` adds :data:`~typing." +"TypeVarTuple`, enabling parameterisation with an *arbitrary* number of " +"types. In other words, a :data:`~typing.TypeVarTuple` is a *variadic* type " +"variable, enabling *variadic* generics." msgstr "" ":pep:`484` 先前引入了 :data:`~typing.TypeVar`,開啟了帶有單一型別的泛型參數" "化。:pep:`646` 新增 :data:`~typing.TypeVarTuple`,開啟了帶有\\ *任意*\\ 數量" @@ -450,9 +450,9 @@ msgstr "PEP 655:標記獨立 ``TypedDict`` 項目為必要或不必要" #: ../../whatsnew/3.11.rst:280 msgid "" ":data:`~typing.Required` and :data:`~typing.NotRequired` provide a " -"straightforward way to mark whether individual items in " -"a :class:`~typing.TypedDict` must be present. Previously, this was only " -"possible using inheritance." +"straightforward way to mark whether individual items in a :class:`~typing." +"TypedDict` must be present. Previously, this was only possible using " +"inheritance." msgstr "" ":data:`~typing.Required` 與 :data:`~typing.NotRequired` 提供了標記一個獨立項" "目在 :class:`~typing.TypedDict` 中是否必須存在的直覺方法。在這之前,這只有透" @@ -524,9 +524,9 @@ msgstr "" #: ../../whatsnew/3.11.rst:322 msgid "" -"Common use cases include alternative constructors provided " -"as :func:`classmethod `\\s, and :meth:`~object.__enter__` " -"methods that return ``self``::" +"Common use cases include alternative constructors provided as :func:" +"`classmethod `\\s, and :meth:`~object.__enter__` methods that " +"return ``self``::" msgstr "" "常見用例包括作為 :func:`classmethod ` 的替代建構函式和會回傳 " "``self`` 的 :meth:`~object.__enter__` 方法: ::" @@ -644,8 +644,8 @@ msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " "``@dataclass_transform()`` tells a static type checker that the decorated " -"object performs runtime \"magic\" that transforms a class, giving " -"it :func:`dataclass `-like behaviors." +"object performs runtime \"magic\" that transforms a class, giving it :func:" +"`dataclass `-like behaviors." msgstr "" ":data:`~typing.dataclass_transform` 可以用來裝飾一個類別、元類別 " "(metaclass)、或是一個本身就是裝飾器的函式。``@dataclass_transform()`` 的存在" @@ -732,51 +732,51 @@ msgstr "" #: ../../whatsnew/3.11.rst:447 msgid "" -"A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` " -"in :keyword:`with` statements and :meth:`contextlib.ExitStack.enter_context` " -"for objects that do not support the :term:`context manager` protocol, and " -"in :keyword:`async with` statements " -"and :meth:`contextlib.AsyncExitStack.enter_async_context` for objects not " -"supporting the :term:`asynchronous context manager` protocol. (Contributed " -"by Serhiy Storchaka in :issue:`12022` and :issue:`44471`.)" +"A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` in :" +"keyword:`with` statements and :meth:`contextlib.ExitStack.enter_context` for " +"objects that do not support the :term:`context manager` protocol, and in :" +"keyword:`async with` statements and :meth:`contextlib.AsyncExitStack." +"enter_async_context` for objects not supporting the :term:`asynchronous " +"context manager` protocol. (Contributed by Serhiy Storchaka in :issue:" +"`12022` and :issue:`44471`.)" msgstr "" "現在在不支援 :term:`context manager` 協定的物件上使用 :keyword:`with` 陳述式" "和 :meth:`contextlib.ExitStack.enter_context` 或在不支援 :term:`asynchronous " -"context manager` 協定的物件上使用 :keyword:`async with` 陳述式" -"和 :meth:`contextlib.AsyncExitStack.enter_async_context`,會引" -"發 :exc:`TypeError` 而不是 :exc:`AttributeError`。(由 Serhiy Storchaka " -"在 :issue:`12022` 和 :issue:`44471` 中貢獻。)" +"context manager` 協定的物件上使用 :keyword:`async with` 陳述式和 :meth:" +"`contextlib.AsyncExitStack.enter_async_context`,會引發 :exc:`TypeError` 而不" +"是 :exc:`AttributeError`。(由 Serhiy Storchaka 在 :issue:`12022` 和 :issue:" +"`44471` 中貢獻。)" #: ../../whatsnew/3.11.rst:455 msgid "" "Added :meth:`object.__getstate__`, which provides the default implementation " "of the :meth:`!__getstate__` method. :mod:`copy`\\ing and :mod:`pickle`\\ing " -"instances of subclasses of builtin " -"types :class:`bytearray`, :class:`set`, :class:`frozenset`, :class:`collections.OrderedDict`, :class:`collections.deque`, :class:`weakref.WeakSet`, " -"and :class:`datetime.tzinfo` now copies and pickles instance attributes " -"implemented as :term:`slots <__slots__>`. This change has an unintended side " -"effect: It trips up a small minority of existing Python projects not " -"expecting :meth:`object.__getstate__` to exist. See the later comments " -"on :gh:`70766` for discussions of what workarounds such code may need. " -"(Contributed by Serhiy Storchaka in :issue:`26579`.)" +"instances of subclasses of builtin types :class:`bytearray`, :class:`set`, :" +"class:`frozenset`, :class:`collections.OrderedDict`, :class:`collections." +"deque`, :class:`weakref.WeakSet`, and :class:`datetime.tzinfo` now copies " +"and pickles instance attributes implemented as :term:`slots <__slots__>`. " +"This change has an unintended side effect: It trips up a small minority of " +"existing Python projects not expecting :meth:`object.__getstate__` to exist. " +"See the later comments on :gh:`70766` for discussions of what workarounds " +"such code may need. (Contributed by Serhiy Storchaka in :issue:`26579`.)" msgstr "" #: ../../whatsnew/3.11.rst:470 msgid "" "Added a :option:`-P` command line option and a :envvar:`PYTHONSAFEPATH` " -"environment variable, which disable the automatic prepending " -"to :data:`sys.path` of the script's directory when running a script, or the " -"current directory when using :option:`-c` and :option:`-m`. This ensures " -"only stdlib and installed modules are picked up by :keyword:`import`, and " -"avoids unintentionally or maliciously shadowing modules with those in a " -"local (and typically user-writable) directory. (Contributed by Victor " -"Stinner in :gh:`57684`.)" +"environment variable, which disable the automatic prepending to :data:`sys." +"path` of the script's directory when running a script, or the current " +"directory when using :option:`-c` and :option:`-m`. This ensures only stdlib " +"and installed modules are picked up by :keyword:`import`, and avoids " +"unintentionally or maliciously shadowing modules with those in a local (and " +"typically user-writable) directory. (Contributed by Victor Stinner in :gh:" +"`57684`.)" msgstr "" "新增了一個 :option:`-P` 命令列選項和一個 :envvar:`PYTHONSAFEPATH` 環境變數," "它們禁用了當使用 :option:`-c` 和 :option:`-m` 以在運行腳本或目前目錄時自動添" -"加到腳本目錄的 :data:`sys.path`。這確保只有 stdlib 和已安裝的模組會" -"被 :keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可" -"寫入的)目錄中的模組重疊。(由 Victor Stinner 在 :gh:`57684` 中貢獻。)" +"加到腳本目錄的 :data:`sys.path`。這確保只有 stdlib 和已安裝的模組會被 :" +"keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可寫入" +"的)目錄中的模組重疊。(由 Victor Stinner 在 :gh:`57684` 中貢獻。)" #: ../../whatsnew/3.11.rst:481 msgid "" @@ -797,10 +797,10 @@ msgid "" "Thomas Grainger in :gh:`91181`.)" msgstr "" ":data:`sys.path` 不再接受位元組。支援已在 Python 3.2 和 3.6 之間的某個時間停" -"止,直到 Python 3.10.0 發布後才引起人們的注意。此外,由於混合使" -"用 :class:`str` 和 :class:`bytes` 鍵時 :option:`-b` " -"和 :data:`sys.path_importer_cache` 會出現的交互作用,恢復這項支援會出現問題。" -"(由 Thomas Grainger 在 :gh:`91181` 中貢獻。)" +"止,直到 Python 3.10.0 發布後才引起人們的注意。此外,由於混合使用 :class:" +"`str` 和 :class:`bytes` 鍵時 :option:`-b` 和 :data:`sys.path_importer_cache` " +"會出現的交互作用,恢復這項支援會出現問題。(由 Thomas Grainger 在 :gh:" +"`91181` 中貢獻。)" #: ../../whatsnew/3.11.rst:497 msgid "Other CPython Implementation Changes" @@ -808,15 +808,15 @@ msgstr "其他 CPython 實作更動" #: ../../whatsnew/3.11.rst:499 msgid "" -"The special methods :meth:`~object.__complex__` for :class:`complex` " -"and :meth:`~object.__bytes__` for :class:`bytes` are implemented to support " -"the :class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` " -"protocols. (Contributed by Mark Dickinson and Donghee Na in :issue:`24234`.)" +"The special methods :meth:`~object.__complex__` for :class:`complex` and :" +"meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :" +"class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` protocols. " +"(Contributed by Mark Dickinson and Donghee Na in :issue:`24234`.)" msgstr "" "為支援 :class:`typing.SupportsComplex` 與 :class:`typing.SupportsBytes` 協" -"定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方" -"法 :meth:`~object.__complex__` 與 :meth:`~object.__bytes__`。(由 Mark " -"Dickinson 和 Donghee Na 於 :issue:`24234` 中所貢獻。)" +"定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方法 :meth:`~object." +"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Donghee Na " +"於 :issue:`24234` 中所貢獻。)" #: ../../whatsnew/3.11.rst:504 msgid "" @@ -830,16 +830,16 @@ msgstr "" "新增 ``siphash13`` 以作為內部的雜湊演算法,它有與 ``siphash24`` 相似的安全特" "性,但是在處理較長的輸入時會更快一些。現在是 :class:`str`、:class:`bytes` 和" "一些其他型別的 :func:`hash` 預設演算法。:pep:`552` :ref:`基於雜湊的 .pyc 檔" -"案 ` 現在也使用 ``siphash13``。(由 Inada Naoki " -"於 :issue:`29410` 中貢獻。)" +"案 ` 現在也使用 ``siphash13``。(由 Inada Naoki 於 :issue:" +"`29410` 中貢獻。)" #: ../../whatsnew/3.11.rst:513 msgid "" "When an active exception is re-raised by a :keyword:`raise` statement with " -"no parameters, the traceback attached to this exception is now always " -"``sys.exc_info()[1].__traceback__``. This means that changes made to the " -"traceback in the current :keyword:`except` clause are reflected in the re-" -"raised exception. (Contributed by Irit Katriel in :issue:`45711`.)" +"no parameters, the traceback attached to this exception is now always ``sys." +"exc_info()[1].__traceback__``. This means that changes made to the traceback " +"in the current :keyword:`except` clause are reflected in the re-raised " +"exception. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" "當一個仍有效的例外被 :keyword:`raise` 陳述式在沒有參數的情況下重新引發,被附" "於該例外的追蹤資訊現在都會是 ``sys.exc_info()[1].__traceback__``。這代表對於" @@ -876,10 +876,9 @@ msgid "" "initialize :data:`sys.path`. Otherwise, initialization will recalculate the " "path and replace any values added to ``module_search_paths``." msgstr "" -"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始" -"化 :data:`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須" -"被設為 1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` " -"的值。" +"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始化 :data:" +"`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " +"1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" #: ../../whatsnew/3.11.rst:536 msgid "" @@ -890,9 +889,9 @@ msgid "" "help-all`. (Contributed by Éric Araujo in :issue:`46142`.)" msgstr "" ":option:`--help` 選項的輸出現在會在 50 列、80 欄的大小之內,:ref:`Python 環境" -"變數 `\\ 和 :option:`-X` 選項的資訊現在能夠分別透" -"過 :option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-" -"all` 一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)" +"變數 `\\ 和 :option:`-X` 選項的資訊現在能夠分別透過 :" +"option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-all` " +"一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)" #: ../../whatsnew/3.11.rst:543 msgid "" @@ -908,11 +907,11 @@ msgid "" msgstr "" "在除 2(binary、二進制)、4、8(octal、八進制)、16(hexadecimal、十六進制)" "或 32 以外的基數中,例如以 10(decimal、十進制)為基數,進行 :class:`int` " -"和 :class:`str` 之間的轉換且字串形式的位數超過限制,現在會引" -"發 :exc:`ValueError`,以避免由於演算法複雜性而導致的潛在阻斷服務攻擊 (denial " -"of service attacks)。這是針對 :cve:`2020-10735` 的緩解措施,可以透過環境變" -"數、命令列旗標或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉" -"換長度限制 ` 文件。預設限制為字串形式的 4300 位數字。" +"和 :class:`str` 之間的轉換且字串形式的位數超過限制,現在會引發 :exc:" +"`ValueError`,以避免由於演算法複雜性而導致的潛在阻斷服務攻擊 (denial of " +"service attacks)。這是針對 :cve:`2020-10735` 的緩解措施,可以透過環境變數、命" +"令列旗標或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉換長度" +"限制 ` 文件。預設限制為字串形式的 4300 位數字。" #: ../../whatsnew/3.11.rst:557 msgid "New Modules" @@ -946,9 +945,9 @@ msgstr "asyncio" msgid "" "Added the :class:`~asyncio.TaskGroup` class, an :ref:`asynchronous context " "manager ` holding a group of tasks that will wait " -"for all of them upon exit. For new code this is recommended over " -"using :func:`~asyncio.create_task` and :func:`~asyncio.gather` directly. " -"(Contributed by Yury Selivanov and others in :gh:`90908`.)" +"for all of them upon exit. For new code this is recommended over using :func:" +"`~asyncio.create_task` and :func:`~asyncio.gather` directly. (Contributed by " +"Yury Selivanov and others in :gh:`90908`.)" msgstr "" "添加了 :class:`~asyncio.TaskGroup` 類別,為一個會持有任務群組並在退出時等待全" "部完成的\\ :ref:`非同步情境管理器 (asynchronous context manager) ` (the default " -"for :func:`format`, :meth:`str.format` and :term:`f-string`\\s) to always " -"produce the same result as :meth:`Enum.__str__() `: for " -"enums inheriting from :class:`~enum.ReprEnum` it will be the member's value; " -"for all other enums it will be the enum and member name (e.g. ``Color.RED``)." +"Changed :meth:`Enum.__format__() ` (the default for :" +"func:`format`, :meth:`str.format` and :term:`f-string`\\s) to always produce " +"the same result as :meth:`Enum.__str__() `: for enums " +"inheriting from :class:`~enum.ReprEnum` it will be the member's value; for " +"all other enums it will be the enum and member name (e.g. ``Color.RED``)." msgstr "" -"改變了 :meth:`Enum.__format__() ` " -"(被 :func:`format`、:meth:`str.format` 和 :term:`f-string` 預設使用),以使" -"其與 :meth:`enum.Enum.__str__ ` 產生相同結果:對於繼承" -"自 :class:`~enum.ReprEnum` 的列舉,這會是成員之值;而其他的列舉會是列舉與成員" -"名稱(例如 ``Color.RED``)。" +"改變了 :meth:`Enum.__format__() ` (被 :func:" +"`format`、:meth:`str.format` 和 :term:`f-string` 預設使用),以使其與 :meth:" +"`enum.Enum.__str__ ` 產生相同結果:對於繼承自 :class:" +"`~enum.ReprEnum` 的列舉,這會是成員之值;而其他的列舉會是列舉與成員名稱(例" +"如 ``Color.RED``)。" #: ../../whatsnew/3.11.rst:678 msgid "" -"Added a new *boundary* class parameter to :class:`~enum.Flag` enums and " -"the :class:`~enum.FlagBoundary` enum with its options, to control how to " -"handle out-of-range flag values." +"Added a new *boundary* class parameter to :class:`~enum.Flag` enums and the :" +"class:`~enum.FlagBoundary` enum with its options, to control how to handle " +"out-of-range flag values." msgstr "" -"新增 *boundary* 類別參數與其選項到 :class:`~enum.Flag` 列舉" -"和 :class:`~enum.FlagBoundary` 列舉以控制處理超出範圍旗標數值的方法。" +"新增 *boundary* 類別參數與其選項到 :class:`~enum.Flag` 列舉和 :class:`~enum." +"FlagBoundary` 列舉以控制處理超出範圍旗標數值的方法。" #: ../../whatsnew/3.11.rst:682 msgid "" -"Added the :func:`~enum.verify` enum decorator and " -"the :class:`~enum.EnumCheck` enum with its options, to check enum classes " -"against several specific constraints." +"Added the :func:`~enum.verify` enum decorator and the :class:`~enum." +"EnumCheck` enum with its options, to check enum classes against several " +"specific constraints." msgstr "" "新增了 :func:`~enum.verify` 列舉裝飾器和 :class:`~enum.EnumCheck` 列舉及其選" "項,以根據幾個特定限制檢查列舉類別。" @@ -1156,35 +1151,34 @@ msgstr "" #: ../../whatsnew/3.11.rst:689 msgid "" -"Added the :func:`~enum.property` decorator, which works " -"like :func:`property` except for enums. Use this instead " -"of :func:`types.DynamicClassAttribute`." +"Added the :func:`~enum.property` decorator, which works like :func:" +"`property` except for enums. Use this instead of :func:`types." +"DynamicClassAttribute`." msgstr "" "新增 :func:`~enum.property` 裝飾器,它的作用類似 :func:`property` 但是是用於" "列舉,用以替代 :func:`types.DynamicClassAttribute`。" #: ../../whatsnew/3.11.rst:693 msgid "" -"Added the :func:`~enum.global_enum` enum decorator, which " -"adjusts :meth:`~object.__repr__` and :meth:`~object.__str__` to show values " -"as members of their module rather than the enum class. For example, " -"``'re.ASCII'`` for the :const:`~re.ASCII` member of :class:`re.RegexFlag` " -"rather than ``'RegexFlag.ASCII'``." +"Added the :func:`~enum.global_enum` enum decorator, which adjusts :meth:" +"`~object.__repr__` and :meth:`~object.__str__` to show values as members of " +"their module rather than the enum class. For example, ``'re.ASCII'`` for " +"the :const:`~re.ASCII` member of :class:`re.RegexFlag` rather than " +"``'RegexFlag.ASCII'``." msgstr "" "新增 :func:`~enum.global_enum` 列舉裝飾器,用來調整 :meth:`~object.__repr__` " -"和 :meth:`~object.__str__` 以模組成員形式而非列舉類別來顯示值。例" -"如,:class:`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 " +"和 :meth:`~object.__str__` 以模組成員形式而非列舉類別來顯示值。例如,:class:" +"`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 " "``'RegexFlag.ASCII'``。" #: ../../whatsnew/3.11.rst:699 msgid "" -"Enhanced :class:`~enum.Flag` to support :func:`len`, iteration " -"and :keyword:`in`/:keyword:`not in` on its members. For example, the " -"following now works: ``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, " -"AFlag.TWO)``" +"Enhanced :class:`~enum.Flag` to support :func:`len`, iteration and :keyword:" +"`in`/:keyword:`not in` on its members. For example, the following now works: " +"``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" msgstr "" -"強化 :class:`~enum.Flag` 以支援使用 :func:`len`、疊代 (iteration) " -"和 :keyword:`in`/:keyword:`not in` 於其成員。例如,以下程式現在能夠作用了:" +"強化 :class:`~enum.Flag` 以支援使用 :func:`len`、疊代 (iteration) 和 :" +"keyword:`in`/:keyword:`not in` 於其成員。例如,以下程式現在能夠作用了:" "``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" #: ../../whatsnew/3.11.rst:704 @@ -1193,9 +1187,9 @@ msgid "" "defined before :meth:`~object.__init_subclass__` is called; :func:`dir` now " "includes methods, etc., from mixed-in data types." msgstr "" -"更改了 :class:`~enum.Enum` 和 :class:`~enum.Flag` 以在呼" -"叫 :meth:`~object.__init_subclass__` 之前就定義成員;:func:`dir` 現在包括來自" -"混合資料型別的方法。" +"更改了 :class:`~enum.Enum` 和 :class:`~enum.Flag` 以在呼叫 :meth:`~object." +"__init_subclass__` 之前就定義成員;:func:`dir` 現在包括來自混合資料型別的方" +"法。" #: ../../whatsnew/3.11.rst:709 msgid "" @@ -1248,11 +1242,11 @@ msgstr "functools" #: ../../whatsnew/3.11.rst:743 msgid "" -":func:`functools.singledispatch` now supports :data:`types.UnionType` " -"and :data:`typing.Union` as annotations to the dispatch argument.::" +":func:`functools.singledispatch` now supports :data:`types.UnionType` and :" +"data:`typing.Union` as annotations to the dispatch argument.::" msgstr "" -":func:`functools.singledispatch` 現在支援 :data:`types.UnionType` " -"和 :data:`typing.Union` 作為調度 (dispatch) 引數的標註。 ::" +":func:`functools.singledispatch` 現在支援 :data:`types.UnionType` 和 :data:" +"`typing.Union` 作為調度 (dispatch) 引數的標註。 ::" #: ../../whatsnew/3.11.rst:746 msgid "" @@ -1311,14 +1305,13 @@ msgstr "gzip" #: ../../whatsnew/3.11.rst:776 msgid "" "The :func:`gzip.compress` function is now faster when used with the " -"**mtime=0** argument as it delegates the compression entirely to a " -"single :func:`zlib.compress` operation. There is one side effect of this " -"change: The gzip file header contains an \"OS\" byte in its header. That was " -"traditionally always set to a value of 255 representing \"unknown\" by " -"the :mod:`gzip` module. Now, when using :func:`~gzip.compress` with " -"**mtime=0**, it may be set to a different value by the underlying zlib C " -"library Python was linked against. (See :gh:`112346` for details on the side " -"effect.)" +"**mtime=0** argument as it delegates the compression entirely to a single :" +"func:`zlib.compress` operation. There is one side effect of this change: The " +"gzip file header contains an \"OS\" byte in its header. That was " +"traditionally always set to a value of 255 representing \"unknown\" by the :" +"mod:`gzip` module. Now, when using :func:`~gzip.compress` with **mtime=0**, " +"it may be set to a different value by the underlying zlib C library Python " +"was linked against. (See :gh:`112346` for details on the side effect.)" msgstr "" #: ../../whatsnew/3.11.rst:789 @@ -1372,8 +1365,8 @@ msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" msgstr "" -"當帶有輸入與輸出地儲存 Shell 時,也會包含提示字元。(由 Terry Jan Reedy " -"於 :gh:`95191` 中所貢獻。)" +"當帶有輸入與輸出地儲存 Shell 時,也會包含提示字元。(由 Terry Jan Reedy 於 :" +"gh:`95191` 中所貢獻。)" #: ../../whatsnew/3.11.rst:822 msgid "inspect" @@ -1392,12 +1385,11 @@ msgstr "" #: ../../whatsnew/3.11.rst:828 msgid "" "Add :func:`~inspect.ismethodwrapper` for checking if the type of an object " -"is a :class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik " -"in :issue:`29418`.)" +"is a :class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik in :" +"issue:`29418`.)" msgstr "" -"新增 :func:`inspect.ismethodwrapper`,用來檢查一個物件的型別是否" -"為 :class:`~types.MethodWrapperType`。(由 Hakan Çelik 於 :issue:`29418` 中所" -"貢獻。)" +"新增 :func:`inspect.ismethodwrapper`,用來檢查一個物件的型別是否為 :class:" +"`~types.MethodWrapperType`。(由 Hakan Çelik 於 :issue:`29418` 中所貢獻。)" #: ../../whatsnew/3.11.rst:832 msgid "" @@ -1407,10 +1399,10 @@ msgid "" "interfaces) that includes the extended :pep:`657` position information (end " "line number, column and end column). The affected functions are:" msgstr "" -"更改 :mod:`inspect` 模組中與幀相關的函式以回傳新" -"的 :class:`~inspect.FrameInfo` 和 :class:`~inspect.Traceback` 類別實例(向後" -"相容之前類似於 :term:`named tuple` 的介面),包括擴充的 :pep:`657` 位置資訊" -"(結束行號、欄和結束欄)。受影響的功能是:" +"更改 :mod:`inspect` 模組中與幀相關的函式以回傳新的 :class:`~inspect." +"FrameInfo` 和 :class:`~inspect.Traceback` 類別實例(向後相容之前類似於 :term:" +"`named tuple` 的介面),包括擴充的 :pep:`657` 位置資訊(結束行號、欄和結束" +"欄)。受影響的功能是:" #: ../../whatsnew/3.11.rst:838 msgid ":func:`inspect.getframeinfo`" @@ -1443,8 +1435,8 @@ msgstr "locale" #: ../../whatsnew/3.11.rst:852 msgid "" "Add :func:`locale.getencoding` to get the current locale encoding. It is " -"similar to ``locale.getpreferredencoding(False)`` but ignores " -"the :ref:`Python UTF-8 Mode `." +"similar to ``locale.getpreferredencoding(False)`` but ignores the :ref:" +"`Python UTF-8 Mode `." msgstr "" "新增 :func:`locale.getencoding` 以取得目前的區域編碼 (locale encoding)。和 " "``locale.getpreferredencoding(False)`` 類似但不考慮 :ref:`Python UTF-8 模式 " @@ -1457,9 +1449,9 @@ msgstr "logging" #: ../../whatsnew/3.11.rst:862 msgid "" "Added :func:`~logging.getLevelNamesMapping` to return a mapping from logging " -"level names (e.g. ``'CRITICAL'``) to the values of their " -"corresponding :ref:`levels` (e.g. ``50``, by default). (Contributed by " -"Andrei Kulakovin in :gh:`88024`.)" +"level names (e.g. ``'CRITICAL'``) to the values of their corresponding :ref:" +"`levels` (e.g. ``50``, by default). (Contributed by Andrei Kulakovin in :gh:" +"`88024`.)" msgstr "" "新增 :func:`~logging.getLevelNamesMapping` 以回傳一個日誌級別名稱(例如 " "``'CRITICAL'``)指到對應的 :ref:`levels` 數值(例如,預設為 ``50``)的對映。" @@ -1467,19 +1459,17 @@ msgstr "" #: ../../whatsnew/3.11.rst:867 msgid "" -"Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method " -"to :class:`~logging.handlers.SysLogHandler`, to " -"match :meth:`SocketHandler.createSocket() " -"`. It is called automatically " -"during handler initialization and when emitting an event, if there is no " -"active socket. (Contributed by Kirill Pinchuk in :gh:`88457`.)" +"Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method to :" +"class:`~logging.handlers.SysLogHandler`, to match :meth:`SocketHandler." +"createSocket() `. It is called " +"automatically during handler initialization and when emitting an event, if " +"there is no active socket. (Contributed by Kirill Pinchuk in :gh:`88457`.)" msgstr "" -"添加了一個 :meth:`~logging.handlers.SysLogHandler.createSocket` 方法" -"到 :class:`~logging.handlers.SysLogHandler`,以匹" -"配 :meth:`SocketHandler.createSocket() " -"` 。如果沒有已啟用的 socket,它" -"會在處理程式初始化期間和發出一個事件時自動呼叫。(由 Kirill Pinchuk " -"在 :gh:`88457` 中貢獻。)" +"添加了一個 :meth:`~logging.handlers.SysLogHandler.createSocket` 方法到 :" +"class:`~logging.handlers.SysLogHandler`,以匹配 :meth:`SocketHandler." +"createSocket() ` 。如果沒有已啟" +"用的 socket,它會在處理程式初始化期間和發出一個事件時自動呼叫。(由 Kirill " +"Pinchuk 在 :gh:`88457` 中貢獻。)" #: ../../whatsnew/3.11.rst:879 msgid "math" @@ -1490,29 +1480,29 @@ msgid "" "Add :func:`math.exp2`: return 2 raised to the power of x. (Contributed by " "Gideon Mitchell in :issue:`45917`.)" msgstr "" -"新增 :func:`math.exp2`:回傳 2 的 x 次方。(由 Gideon Mitchell " -"於 :issue:`45917` 中所貢獻。)" +"新增 :func:`math.exp2`:回傳 2 的 x 次方。(由 Gideon Mitchell 於 :issue:" +"`45917` 中所貢獻。)" #: ../../whatsnew/3.11.rst:884 msgid "" "Add :func:`math.cbrt`: return the cube root of x. (Contributed by Ajith " "Ramachandran in :issue:`44357`.)" msgstr "" -"新增 :func:`math.cbrt`:回傳 x 的立方根。(由 Ajith Ramachandran " -"於 :issue:`44357` 中所貢獻。)" +"新增 :func:`math.cbrt`:回傳 x 的立方根。(由 Ajith Ramachandran 於 :issue:" +"`44357` 中所貢獻。)" #: ../../whatsnew/3.11.rst:887 msgid "" "The behaviour of two :func:`math.pow` corner cases was changed, for " -"consistency with the IEEE 754 specification. The operations ``math.pow(0.0, " -"-math.inf)`` and ``math.pow(-0.0, -math.inf)`` now return ``inf``. " -"Previously they raised :exc:`ValueError`. (Contributed by Mark Dickinson " -"in :issue:`44339`.)" +"consistency with the IEEE 754 specification. The operations ``math.pow(0.0, -" +"math.inf)`` and ``math.pow(-0.0, -math.inf)`` now return ``inf``. Previously " +"they raised :exc:`ValueError`. (Contributed by Mark Dickinson in :issue:" +"`44339`.)" msgstr "" "為了與 IEEE 754 規範保持一致,更改了兩個 :func:`math.pow` 邊角案例 (corner " "case) 的行為。``math.pow(0.0, -math.inf)`` 和 ``math.pow(-0.0, -math.inf)`` " -"現在回傳 ``inf``,之前它們會引發 :exc:`ValueError`。(由 Mark Dickinson " -"在 :issue:`44339` 中貢獻。)" +"現在回傳 ``inf``,之前它們會引發 :exc:`ValueError`。(由 Mark Dickinson 在 :" +"issue:`44339` 中貢獻。)" #: ../../whatsnew/3.11.rst:893 msgid "" @@ -1528,9 +1518,9 @@ msgstr "operator" #: ../../whatsnew/3.11.rst:902 msgid "" -"A new function ``operator.call`` has been added, such that " -"``operator.call(obj, *args, **kwargs) == obj(*args, **kwargs)``. " -"(Contributed by Antony Lee in :issue:`44019`.)" +"A new function ``operator.call`` has been added, such that ``operator." +"call(obj, *args, **kwargs) == obj(*args, **kwargs)``. (Contributed by Antony " +"Lee in :issue:`44019`.)" msgstr "" "新增 ``operator.call`` 函式,使得 ``operator.call(obj, *args, **kwargs) == " "obj(*args, **kwargs)``。(由 Antony Lee 於 :issue:`44019` 中所貢獻。)" @@ -1542,8 +1532,8 @@ msgstr "os" #: ../../whatsnew/3.11.rst:912 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " -"``CryptGenRandom()`` which is deprecated. (Contributed by Donghee Na " -"in :issue:`44611`.)" +"``CryptGenRandom()`` which is deprecated. (Contributed by Donghee Na in :" +"issue:`44611`.)" msgstr "" "在 Windows 上,:func:`os.urandom` 現在使用 ``BCryptGenRandom()`` 以取代被棄用" "的 ``CryptGenRandom()``。(由 Donghee Na 於 :issue:`44611` 中所貢獻。)" @@ -1555,9 +1545,9 @@ msgstr "pathlib" #: ../../whatsnew/3.11.rst:922 msgid "" ":meth:`~pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` return only " -"directories if *pattern* ends with a pathname components " -"separator: :data:`~os.sep` or :data:`~os.altsep`. (Contributed by Eisuke " -"Kawasima in :issue:`22276` and :issue:`33392`.)" +"directories if *pattern* ends with a pathname components separator: :data:" +"`~os.sep` or :data:`~os.altsep`. (Contributed by Eisuke Kawasima in :issue:" +"`22276` and :issue:`33392`.)" msgstr "" "如果 *pattern* 以路徑名稱元件分隔符號 :data:`~os.sep` 或 :data:`~os.altsep` " "結尾,:meth:`~pathlib.Path.glob` 和 :meth:`~pathlib.Path.rglob` 只回傳目錄。" @@ -1575,8 +1565,8 @@ msgid "" msgstr "" "現在規則運算式 (regular expression) 是有支援原子性群組 (atomic grouping) " "(``(?>...)``) 和佔有性量詞 (possessive quantifier) (``*+``, ``++``, ``?+``, " -"``{m,n}+``) 的。(由 Jeffrey C. Jacobs 和 Serhiy Storchaka " -"在 :issue:`433030` 中貢獻。)" +"``{m,n}+``) 的。(由 Jeffrey C. Jacobs 和 Serhiy Storchaka 在 :issue:" +"`433030` 中貢獻。)" #: ../../whatsnew/3.11.rst:941 msgid "shutil" @@ -1587,8 +1577,8 @@ msgid "" "Add optional parameter *dir_fd* in :func:`shutil.rmtree`. (Contributed by " "Serhiy Storchaka in :issue:`46245`.)" msgstr "" -"新增 :func:`shutil.rmtree` 的可選參數 *dir_fd*。(由 Serhiy Storchaka " -"於 :issue:`46245` 中所貢獻。)" +"新增 :func:`shutil.rmtree` 的可選參數 *dir_fd*。(由 Serhiy Storchaka 於 :" +"issue:`46245` 中所貢獻。)" #: ../../whatsnew/3.11.rst:950 msgid "socket" @@ -1596,8 +1586,8 @@ msgstr "socket" #: ../../whatsnew/3.11.rst:952 msgid "" -"Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner " -"in :issue:`30512`.)" +"Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner in :issue:" +"`30512`.)" msgstr "" "新增 NetBSD 對於 CAN Socket 的支援。(由 Thomas Klausner 於 :issue:`30512` 中" "所貢獻。)" @@ -1609,8 +1599,8 @@ msgid "" "raising the last error. (Contributed by Irit Katriel in :issue:`29980`.)" msgstr "" "當連接失敗時,:meth:`~socket.create_connection` 有個選項可以引發一個包含所有" -"錯誤的 :exc:`ExceptionGroup`,而非只引發最後一個錯誤。(由 Irit Katriel " -"於 :issue:`29980` 中貢獻。)" +"錯誤的 :exc:`ExceptionGroup`,而非只引發最後一個錯誤。(由 Irit Katriel 於 :" +"issue:`29980` 中貢獻。)" #: ../../whatsnew/3.11.rst:964 msgid "sqlite3" @@ -1618,49 +1608,48 @@ msgstr "sqlite3" #: ../../whatsnew/3.11.rst:966 msgid "" -"You can now disable the authorizer by passing :const:`None` " -"to :meth:`~sqlite3.Connection.set_authorizer`. (Contributed by Erlend E. " -"Aasland in :issue:`44491`.)" +"You can now disable the authorizer by passing :const:`None` to :meth:" +"`~sqlite3.Connection.set_authorizer`. (Contributed by Erlend E. Aasland in :" +"issue:`44491`.)" msgstr "" -"現在可以透過將 :const:`None` 傳遞" -"給 :meth:`~sqlite3.Connection.set_authorizer` 來停用 authorizer。(由 " -"Erlend E. Aasland 於 :issue:`44491` 中貢獻。)" +"現在可以透過將 :const:`None` 傳遞給 :meth:`~sqlite3.Connection." +"set_authorizer` 來停用 authorizer。(由 Erlend E. Aasland 於 :issue:`44491` " +"中貢獻。)" #: ../../whatsnew/3.11.rst:970 msgid "" "Collation name :meth:`~sqlite3.Connection.create_collation` can now contain " -"any Unicode character. Collation names with invalid characters now " -"raise :exc:`UnicodeEncodeError` instead of :exc:`sqlite3.ProgrammingError`. " +"any Unicode character. Collation names with invalid characters now raise :" +"exc:`UnicodeEncodeError` instead of :exc:`sqlite3.ProgrammingError`. " "(Contributed by Erlend E. Aasland in :issue:`44688`.)" msgstr "" "定序 (collation) 名稱 :meth:`~sqlite3.Connection.create_collation` 現在可以包" -"含任何 Unicode 字元。帶有無效字元的定序名稱現在會引" -"發 :exc:`UnicodeEncodeError` 而不是 :exc:`sqlite3.ProgrammingError`。(由 " -"Erlend E. Aasland 在 :issue:`44688` 中貢獻。)" +"含任何 Unicode 字元。帶有無效字元的定序名稱現在會引發 :exc:" +"`UnicodeEncodeError` 而不是 :exc:`sqlite3.ProgrammingError`。(由 Erlend E. " +"Aasland 在 :issue:`44688` 中貢獻。)" #: ../../whatsnew/3.11.rst:975 msgid "" -":mod:`sqlite3` exceptions now include the SQLite extended error code " -"as :attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name " -"as :attr:`~sqlite3.Error.sqlite_errorname`. (Contributed by Aviv Palivoda, " -"Daniel Shahaf, and Erlend E. Aasland in :issue:`16379` and :issue:`24139`.)" +":mod:`sqlite3` exceptions now include the SQLite extended error code as :" +"attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name as :attr:" +"`~sqlite3.Error.sqlite_errorname`. (Contributed by Aviv Palivoda, Daniel " +"Shahaf, and Erlend E. Aasland in :issue:`16379` and :issue:`24139`.)" msgstr "" -":mod:`sqlite3` 例外現在包含 SQLite 擴充錯誤碼和 SQLite 錯誤名稱(分別" -"為 :attr:`~sqlite3.Error.sqlite_errorcode` " -"和 :attr:`~sqlite3.Error.sqlite_errorname`)。(由 Aviv Palivoda、Daniel " -"Shahaf 和 Erlend E. Aasland 在 :issue:`16379` 和 :issue:`24139` 中貢獻。)" +":mod:`sqlite3` 例外現在包含 SQLite 擴充錯誤碼和 SQLite 錯誤名稱(分別為 :" +"attr:`~sqlite3.Error.sqlite_errorcode` 和 :attr:`~sqlite3.Error." +"sqlite_errorname`)。(由 Aviv Palivoda、Daniel Shahaf 和 Erlend E. Aasland " +"在 :issue:`16379` 和 :issue:`24139` 中貢獻。)" #: ../../whatsnew/3.11.rst:981 msgid "" -"Add :meth:`~sqlite3.Connection.setlimit` " -"and :meth:`~sqlite3.Connection.getlimit` to :class:`sqlite3.Connection` for " -"setting and getting SQLite limits by connection basis. (Contributed by " -"Erlend E. Aasland in :issue:`45243`.)" +"Add :meth:`~sqlite3.Connection.setlimit` and :meth:`~sqlite3.Connection." +"getlimit` to :class:`sqlite3.Connection` for setting and getting SQLite " +"limits by connection basis. (Contributed by Erlend E. Aasland in :issue:" +"`45243`.)" msgstr "" -"將 :meth:`~sqlite3.Connection.setlimit` " -"和 :meth:`~sqlite3.Connection.getlimit` 新增到 :class:`sqlite3.Connection` 以" -"根據連線來設定和取得 SQLite 限制。(由 Erlend E. Aasland 在 :issue:`45243` 中" -"貢獻。)" +"將 :meth:`~sqlite3.Connection.setlimit` 和 :meth:`~sqlite3.Connection." +"getlimit` 新增到 :class:`sqlite3.Connection` 以根據連線來設定和取得 SQLite 限" +"制。(由 Erlend E. Aasland 在 :issue:`45243` 中貢獻。)" #: ../../whatsnew/3.11.rst:986 msgid "" @@ -1691,43 +1680,40 @@ msgid "" "(Contributed by Erlend E. Aasland in :issue:`44092`.)" msgstr "" "跨越不同回滾 (rollback) 的拿取動作不再引發 :exc:`~sqlite3.InterfaceError`,我" -"們將其留給 SQLite 函式庫來處理這些情況。(由 Erlend E. Aasland " -"在 :issue:`44092` 中貢獻。)" +"們將其留給 SQLite 函式庫來處理這些情況。(由 Erlend E. Aasland 在 :issue:" +"`44092` 中貢獻。)" #: ../../whatsnew/3.11.rst:1000 msgid "" -"Add :meth:`~sqlite3.Connection.serialize` " -"and :meth:`~sqlite3.Connection.deserialize` to :class:`sqlite3.Connection` " -"for serializing and deserializing databases. (Contributed by Erlend E. " -"Aasland in :issue:`41930`.)" +"Add :meth:`~sqlite3.Connection.serialize` and :meth:`~sqlite3.Connection." +"deserialize` to :class:`sqlite3.Connection` for serializing and " +"deserializing databases. (Contributed by Erlend E. Aasland in :issue:" +"`41930`.)" msgstr "" -"將 :meth:`~sqlite3.Connection.serialize` " -"和 :meth:`~sqlite3.Connection.deserialize` 新增" -"到 :class:`sqlite3.Connection` 以用於序列化和反序列化資料庫。(由 Erlend E. " -"Aasland 在 :issue:`41930` 中貢獻。)" +"將 :meth:`~sqlite3.Connection.serialize` 和 :meth:`~sqlite3.Connection." +"deserialize` 新增到 :class:`sqlite3.Connection` 以用於序列化和反序列化資料" +"庫。(由 Erlend E. Aasland 在 :issue:`41930` 中貢獻。)" #: ../../whatsnew/3.11.rst:1005 msgid "" -"Add :meth:`~sqlite3.Connection.create_window_function` " -"to :class:`sqlite3.Connection` for creating aggregate window functions. " -"(Contributed by Erlend E. Aasland in :issue:`34916`.)" +"Add :meth:`~sqlite3.Connection.create_window_function` to :class:`sqlite3." +"Connection` for creating aggregate window functions. (Contributed by Erlend " +"E. Aasland in :issue:`34916`.)" msgstr "" -"於 :class:`sqlite3.Connection` 加" -"入 :meth:`~sqlite3.Connection.create_window_function` 已建立聚合視窗函式 " -"(aggregate window function)。(由 Erlend E. Aasland 於 :issue:`34916` 中貢" -"獻。)" +"於 :class:`sqlite3.Connection` 加入 :meth:`~sqlite3.Connection." +"create_window_function` 已建立聚合視窗函式 (aggregate window function)。(由 " +"Erlend E. Aasland 於 :issue:`34916` 中貢獻。)" #: ../../whatsnew/3.11.rst:1009 msgid "" -"Add :meth:`~sqlite3.Connection.blobopen` " -"to :class:`sqlite3.Connection`. :class:`sqlite3.Blob` allows incremental I/O " -"operations on blobs. (Contributed by Aviv Palivoda and Erlend E. Aasland " -"in :issue:`24905`.)" +"Add :meth:`~sqlite3.Connection.blobopen` to :class:`sqlite3.Connection`. :" +"class:`sqlite3.Blob` allows incremental I/O operations on blobs. " +"(Contributed by Aviv Palivoda and Erlend E. Aasland in :issue:`24905`.)" msgstr "" -"在 :class:`sqlite3.Connection` 新" -"增 :meth:`~sqlite3.Connection.blobopen`。 :class:`sqlite3.Blob` 允許對 blob " -"進行增量 I/O 操作 (incremental I/O operations)。(由 Aviv Palivoda 和 Erlend " -"E. Aasland 在 :issue:`24905` 中貢獻。)" +"在 :class:`sqlite3.Connection` 新增 :meth:`~sqlite3.Connection.blobopen`。 :" +"class:`sqlite3.Blob` 允許對 blob 進行增量 I/O 操作 (incremental I/O " +"operations)。(由 Aviv Palivoda 和 Erlend E. Aasland 在 :issue:`24905` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:1017 msgid "string" @@ -1735,15 +1721,15 @@ msgstr "string" #: ../../whatsnew/3.11.rst:1019 msgid "" -"Add :meth:`~string.Template.get_identifiers` " -"and :meth:`~string.Template.is_valid` to :class:`string.Template`, which " -"respectively return all valid placeholders, and whether any invalid " -"placeholders are present. (Contributed by Ben Kehoe in :gh:`90465`.)" +"Add :meth:`~string.Template.get_identifiers` and :meth:`~string.Template." +"is_valid` to :class:`string.Template`, which respectively return all valid " +"placeholders, and whether any invalid placeholders are present. (Contributed " +"by Ben Kehoe in :gh:`90465`.)" msgstr "" -"新增 :meth:`~string.Template.get_identifiers` " -"和 :meth:`~string.Template.is_valid` 於 :class:`string.Template`,分別能夠回" -"傳所有合格的預留位置 (placeholder) 與是否有任何不合格的預留位置存在。(由 " -"Ben Kehoe 於 :gh:`90465` 中貢獻。)" +"新增 :meth:`~string.Template.get_identifiers` 和 :meth:`~string.Template." +"is_valid` 於 :class:`string.Template`,分別能夠回傳所有合格的預留位置 " +"(placeholder) 與是否有任何不合格的預留位置存在。(由 Ben Kehoe 於 :gh:" +"`90465` 中貢獻。)" #: ../../whatsnew/3.11.rst:1029 msgid "sys" @@ -1754,8 +1740,8 @@ msgid "" ":func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields from " "the ``value`` (the exception instance), so when an exception is modified " "while it is being handled, the changes are reflected in the results of " -"subsequent calls to :func:`!exc_info`. (Contributed by Irit Katriel " -"in :issue:`45711`.)" +"subsequent calls to :func:`!exc_info`. (Contributed by Irit Katriel in :" +"issue:`45711`.)" msgstr "" ":func:`sys.exc_info` 現在從 ``value``\\ (例外實例)衍生出 ``type`` 和 " "``traceback`` 欄位,因此當例外在處理過程中被修改時,變更會反映在 :func:`!" @@ -1764,20 +1750,20 @@ msgstr "" #: ../../whatsnew/3.11.rst:1037 msgid "" "Add :func:`sys.exception` which returns the active exception instance " -"(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel " -"in :issue:`46328`.)" +"(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel in :" +"issue:`46328`.)" msgstr "" -"新增會回傳活躍例外實例 (active exception instance) " -"的 :func:`sys.exception`\\ (等價於 ``sys.exc_info()[1]``\\ )。(由 Irit " -"Katriel 於 :issue:`46328` 中所貢獻。)" +"新增會回傳活躍例外實例 (active exception instance) 的 :func:`sys." +"exception`\\ (等價於 ``sys.exc_info()[1]``\\ )。(由 Irit Katriel 於 :" +"issue:`46328` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1041 msgid "" "Add the :data:`sys.flags.safe_path ` flag. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" -"新增 :data:`sys.flags.safe_path ` 旗標。(由 Victor Stinner " -"於 :gh:`57684` 中所貢獻。)" +"新增 :data:`sys.flags.safe_path ` 旗標。(由 Victor Stinner 於 :" +"gh:`57684` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1048 msgid "sysconfig" @@ -1813,13 +1799,13 @@ msgid "" ":class:`~tempfile.SpooledTemporaryFile` objects now fully implement the " "methods of :class:`io.BufferedIOBase` or :class:`io.TextIOBase` (depending " "on file mode). This lets them work correctly with APIs that expect file-like " -"objects, such as compression modules. (Contributed by Carey Metcalfe " -"in :gh:`70363`.)" +"objects, such as compression modules. (Contributed by Carey Metcalfe in :gh:" +"`70363`.)" msgstr "" -":class:`~tempfile.SpooledTemporaryFile` 物件現在完整實作" -"了 :class:`io.BufferedIOBase` 或 :class:`io.TextIOBase` 的方法(取決於檔案模" -"式),這使它們能夠正確地使用需要類檔案物件的 API,例如壓縮模組。(由 Carey " -"Metcalfe 在 :gh:`70363` 中貢獻。)" +":class:`~tempfile.SpooledTemporaryFile` 物件現在完整實作了 :class:`io." +"BufferedIOBase` 或 :class:`io.TextIOBase` 的方法(取決於檔案模式),這使它們" +"能夠正確地使用需要類檔案物件的 API,例如壓縮模組。(由 Carey Metcalfe 在 :gh:" +"`70363` 中貢獻。)" #: ../../whatsnew/3.11.rst:1080 msgid "threading" @@ -1831,13 +1817,13 @@ msgid "" "(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses " "the monotonic clock (:const:`time.CLOCK_MONOTONIC`) for the timeout, rather " "than using the system clock (:const:`time.CLOCK_REALTIME`), to not be " -"affected by system clock changes. (Contributed by Victor Stinner " -"in :issue:`41710`.)" +"affected by system clock changes. (Contributed by Victor Stinner in :issue:" +"`41710`.)" msgstr "" "在 Unix 上,如果 ``sem_clockwait()`` 函式在 C 函式庫(glibc 2.30 與其更新的版" -"本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 " -"(:const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 " -"(:const:`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner " +"本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 (:" +"const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:" +"const:`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner " "在 :issue:`41710` 中貢獻。)" #: ../../whatsnew/3.11.rst:1093 @@ -1853,10 +1839,9 @@ msgid "" "Benjamin Szőke and Victor Stinner in :issue:`21302`.)" msgstr "" "在 Unix 上,如果可用的話,:func:`time.sleep` 現在會使用 " -"``clock_nanosleep()`` 或 ``nanosleep()`` 函式,其解析度為 1 納秒" -"(10\\ :sup:`-9` 秒),而不是使用解析度為 1 微秒(10\\ :sup:`-6` 秒)的 " -"``select()``。(由 Benjamin Szőke 和 Victor Stinner 在 :issue:`21302` 中貢" -"獻。)" +"``clock_nanosleep()`` 或 ``nanosleep()`` 函式,其解析度為 1 納秒(10\\ :sup:" +"`-9` 秒),而不是使用解析度為 1 微秒(10\\ :sup:`-6` 秒)的 ``select()``。" +"(由 Benjamin Szőke 和 Victor Stinner 在 :issue:`21302` 中貢獻。)" #: ../../whatsnew/3.11.rst:1101 msgid "" @@ -1865,15 +1850,15 @@ msgid "" "hardware/drivers/kernel/high-resolution-timers>`_ which has a resolution of " "100 nanoseconds (10\\ :sup:`-7` seconds). Previously, it had a resolution of " "1 millisecond (10\\ :sup:`-3` seconds). (Contributed by Benjamin Szőke, " -"Donghee Na, Eryk Sun and Victor Stinner in :issue:`21302` " -"and :issue:`45429`.)" +"Donghee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:" +"`45429`.)" msgstr "" "在 Windows 8.1 或更新的平台上,:func:`time.sleep` 現在使用了一個基於\\ `高解" "析度計時器 `_\\ 的可等待 (waitable) 計時器,解析度為 100 奈秒" "(即 10\\ :sup:`-7` 秒)。在這之前,它只有 1 微秒(10\\ :sup:`-3` 秒) 的解析" -"度。(由 Benjamin Szőke、Donghee Na、Eryk Sun 和 Victor Stinner " -"於 :issue:`21302` 與 :issue:`45429` 中貢獻。)" +"度。(由 Benjamin Szőke、Donghee Na、Eryk Sun 和 Victor Stinner 於 :issue:" +"`21302` 與 :issue:`45429` 中貢獻。)" #: ../../whatsnew/3.11.rst:1112 msgid "tkinter" @@ -1904,13 +1889,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:1129 msgid "" -"Add :func:`traceback.TracebackException.print`, which prints the " -"formatted :exc:`~traceback.TracebackException` instance to a file. " -"(Contributed by Irit Katriel in :issue:`33809`.)" +"Add :func:`traceback.TracebackException.print`, which prints the formatted :" +"exc:`~traceback.TracebackException` instance to a file. (Contributed by Irit " +"Katriel in :issue:`33809`.)" msgstr "" -"新增 :func:`traceback.TracebackException.print`,它會印出格式化" -"的 :exc:`~traceback.TracebackException` 實例至一個檔案。(由 Irit Katriel " -"在 :issue:`33809` 中貢獻。)" +"新增 :func:`traceback.TracebackException.print`,它會印出格式化的 :exc:" +"`~traceback.TracebackException` 實例至一個檔案。(由 Irit Katriel 在 :issue:" +"`33809` 中貢獻。)" #: ../../whatsnew/3.11.rst:1137 msgid "typing" @@ -1922,16 +1907,14 @@ msgstr "重大變更請見 :ref:`new-feat-related-type-hints-311`。" #: ../../whatsnew/3.11.rst:1141 msgid "" -"Add :func:`typing.assert_never` " -"and :class:`typing.Never`. :func:`typing.assert_never` is useful for asking " -"a type checker to confirm that a line of code is not reachable. At runtime, " -"it raises an :exc:`AssertionError`. (Contributed by Jelle Zijlstra " -"in :gh:`90633`.)" +"Add :func:`typing.assert_never` and :class:`typing.Never`. :func:`typing." +"assert_never` is useful for asking a type checker to confirm that a line of " +"code is not reachable. At runtime, it raises an :exc:`AssertionError`. " +"(Contributed by Jelle Zijlstra in :gh:`90633`.)" msgstr "" -"新增 :func:`typing.assert_never` " -"和 :class:`typing.Never`。 :func:`typing.assert_never` 可用於要型別檢查器確認" -"某行程式碼是否不可觸及。在執行環境,它會引發 :exc:`AssertionError`。(由 " -"Jelle Zijlstra 在 :gh:`90633` 中貢獻。)" +"新增 :func:`typing.assert_never` 和 :class:`typing.Never`。 :func:`typing." +"assert_never` 可用於要型別檢查器確認某行程式碼是否不可觸及。在執行環境,它會" +"引發 :exc:`AssertionError`。(由 Jelle Zijlstra 在 :gh:`90633` 中貢獻。)" #: ../../whatsnew/3.11.rst:1147 msgid "" @@ -1959,16 +1942,16 @@ msgid "" ":data:`typing.TypedDict` types can now be generic. (Contributed by Samodya " "Abeysiriwardane in :gh:`89026`.)" msgstr "" -":data:`typing.TypedDict` 型別現可為泛型。(由 Samodya Abeysiriwardane " -"於 :gh:`89026` 中所貢獻。)" +":data:`typing.TypedDict` 型別現可為泛型。(由 Samodya Abeysiriwardane 於 :gh:" +"`89026` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1160 msgid "" ":class:`~typing.NamedTuple` types can now be generic. (Contributed by Serhiy " "Storchaka in :issue:`43923`.)" msgstr "" -":class:`~typing.NamedTuple` 型別現可為泛型。(由 Serhiy Storchaka " -"於 :issue:`43923` 中所貢獻。)" +":class:`~typing.NamedTuple` 型別現可為泛型。(由 Serhiy Storchaka 於 :issue:" +"`43923` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1163 msgid "" @@ -1991,8 +1974,8 @@ msgstr "" msgid "" "The :func:`typing.get_overloads` function can be used for introspecting the " "overloads of a function. :func:`typing.clear_overloads` can be used to clear " -"all registered overloads of a function. (Contributed by Jelle Zijlstra " -"in :gh:`89263`.)" +"all registered overloads of a function. (Contributed by Jelle Zijlstra in :" +"gh:`89263`.)" msgstr "" ":func:`typing.get_overloads` 函式可用於自我檢查 (introspect) 一個函式的過載 " "(overload)。:func:`typing.clear_overloads` 可用於清除一個函式的所有已註冊過" @@ -2031,28 +2014,28 @@ msgid "" "references in :ref:`PEP 585 generic aliases `. " "(Contributed by Niklas Rosenstein in :gh:`85542`.)" msgstr "" -"作為\\ :ref:`PEP 585 泛化別名 `\\ 中的前向參" -"照,:func:`typing.get_type_hints` 現支援了為字串求值 (evaluate)。(由 Niklas " +"作為\\ :ref:`PEP 585 泛化別名 `\\ 中的前向參照,:func:" +"`typing.get_type_hints` 現支援了為字串求值 (evaluate)。(由 Niklas " "Rosenstein 在 :gh:`85542` 中貢獻。)" #: ../../whatsnew/3.11.rst:1192 msgid "" ":func:`typing.get_type_hints` no longer adds :data:`~typing.Optional` to " -"parameters with ``None`` as a default. (Contributed by Nikita Sobolev " -"in :gh:`90353`.)" +"parameters with ``None`` as a default. (Contributed by Nikita Sobolev in :gh:" +"`90353`.)" msgstr "" ":func:`typing.get_type_hints` 不再將 :data:`~typing.Optional` 新增到預設為 " "``None`` 的參數中。(由 Nikita Sobolev 在 :gh:`90353` 中貢獻。)" #: ../../whatsnew/3.11.rst:1196 msgid "" -":func:`typing.get_type_hints` now supports evaluating bare " -"stringified :data:`~typing.ClassVar` annotations. (Contributed by Gregory " -"Beauregard in :gh:`90711`.)" +":func:`typing.get_type_hints` now supports evaluating bare stringified :data:" +"`~typing.ClassVar` annotations. (Contributed by Gregory Beauregard in :gh:" +"`90711`.)" msgstr "" ":func:`typing.get_type_hints` 現在支援為無修飾 (bare) 字串化 (stringified) " -"的 :data:`~typing.ClassVar` 標註來求值。(由 Gregory Beauregard " -"在 :gh:`90711` 中貢獻。)" +"的 :data:`~typing.ClassVar` 標註來求值。(由 Gregory Beauregard 在 :gh:" +"`90711` 中貢獻。)" #: ../../whatsnew/3.11.rst:1200 msgid "" @@ -2081,21 +2064,17 @@ msgstr "unittest" #: ../../whatsnew/3.11.rst:1219 msgid "" -"Added methods :meth:`~unittest.TestCase.enterContext` " -"and :meth:`~unittest.TestCase.enterClassContext` of " -"class :class:`~unittest.TestCase`, " -"method :meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` of " -"class :class:`~unittest.IsolatedAsyncioTestCase` and " -"function :func:`unittest.enterModuleContext`. (Contributed by Serhiy " -"Storchaka in :issue:`45046`.)" -msgstr "" -"新增 :class:`~unittest.TestCase` 類別" -"的 :meth:`~unittest.TestCase.enterContext` " -"與 :meth:`~unittest.TestCase.enterClassContext` 方" -"法、 :class:`~unittest.IsolatedAsyncioTestCase` 類別 " -"的 :meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` 方" -"法、:func:`unittest.enterModuleContext` 函式。(由 Serhiy Storchaka " -"於 :issue:`45046` 貢獻。)" +"Added methods :meth:`~unittest.TestCase.enterContext` and :meth:`~unittest." +"TestCase.enterClassContext` of class :class:`~unittest.TestCase`, method :" +"meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` of class :class:" +"`~unittest.IsolatedAsyncioTestCase` and function :func:`unittest." +"enterModuleContext`. (Contributed by Serhiy Storchaka in :issue:`45046`.)" +msgstr "" +"新增 :class:`~unittest.TestCase` 類別的 :meth:`~unittest.TestCase." +"enterContext` 與 :meth:`~unittest.TestCase.enterClassContext` 方法、 :class:" +"`~unittest.IsolatedAsyncioTestCase` 類別 的 :meth:`~unittest." +"IsolatedAsyncioTestCase.enterAsyncContext` 方法、:func:`unittest." +"enterModuleContext` 函式。(由 Serhiy Storchaka 於 :issue:`45046` 貢獻。)" #: ../../whatsnew/3.11.rst:1231 msgid "venv" @@ -2109,8 +2088,8 @@ msgid "" "installation scheme is the default. That means that downstream distributors " "can change the default sysconfig install scheme without changing behavior of " "virtual environments. Third party code that also creates new virtual " -"environments should do the same. (Contributed by Miro Hrončok " -"in :issue:`45413`.)" +"environments should do the same. (Contributed by Miro Hrončok in :issue:" +"`45413`.)" msgstr "" "建立新的 Python 虛擬環境時,*venv* :ref:`sysconfig 安裝方案 " "`\\ 會被用於確定環境內的路徑。當 Python 在虛擬環境中運行" @@ -2124,10 +2103,10 @@ msgstr "warnings" #: ../../whatsnew/3.11.rst:1249 msgid "" -":func:`warnings.catch_warnings` now accepts arguments " -"for :func:`warnings.simplefilter`, providing a more concise way to locally " -"ignore warnings or convert them to errors. (Contributed by Zac Hatfield-" -"Dodds in :issue:`47074`.)" +":func:`warnings.catch_warnings` now accepts arguments for :func:`warnings." +"simplefilter`, providing a more concise way to locally ignore warnings or " +"convert them to errors. (Contributed by Zac Hatfield-Dodds in :issue:" +"`47074`.)" msgstr "" ":func:`warnings.catch_warnings` 現在接受 :func:`warnings.simplefilter` 的引" "數,提供了一種更簡潔的方法來在本地端忽略警告或將它們轉換為錯誤。(由 Zac " @@ -2139,8 +2118,8 @@ msgstr "zipfile" #: ../../whatsnew/3.11.rst:1259 msgid "" -"Added support for specifying member name encoding for reading metadata in " -"a :class:`~zipfile.ZipFile`'s directory and file headers. (Contributed by " +"Added support for specifying member name encoding for reading metadata in a :" +"class:`~zipfile.ZipFile`'s directory and file headers. (Contributed by " "Stephen J. Turnbull and Serhiy Storchaka in :issue:`28080`.)" msgstr "" "新增了對指定成員名稱編碼的支援,以便在 :class:`~zipfile.ZipFile` 的目錄和檔案" @@ -2157,13 +2136,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:1267 msgid "" -"Added :attr:`~zipfile.Path.stem`, :attr:`~zipfile.Path.suffix` " -"and :attr:`~zipfile.Path.suffixes` to :class:`zipfile.Path`. (Contributed by " -"Miguel Brito in :gh:`88261`.)" +"Added :attr:`~zipfile.Path.stem`, :attr:`~zipfile.Path.suffix` and :attr:" +"`~zipfile.Path.suffixes` to :class:`zipfile.Path`. (Contributed by Miguel " +"Brito in :gh:`88261`.)" msgstr "" -"於 :class:`zipfile.Path` 新" -"增 :attr:`~zipfile.Path.stem`、:attr:`~zipfile.Path.suffix` " -"和 :attr:`~zipfile.Path.suffixes`。(由 Miguel Brito 於 :gh:`88261` 貢獻。)" +"於 :class:`zipfile.Path` 新增 :attr:`~zipfile.Path.stem`、:attr:`~zipfile." +"Path.suffix` 和 :attr:`~zipfile.Path.suffixes`。(由 Miguel Brito 於 :gh:" +"`88261` 貢獻。)" #: ../../whatsnew/3.11.rst:1275 msgid "Optimizations" @@ -2171,9 +2150,8 @@ msgstr "最佳化" #: ../../whatsnew/3.11.rst:1277 msgid "" -"This section covers specific optimizations independent of " -"the :ref:`whatsnew311-faster-cpython` project, which is covered in its own " -"section." +"This section covers specific optimizations independent of the :ref:" +"`whatsnew311-faster-cpython` project, which is covered in its own section." msgstr "" "這個部分會涵蓋到特定的最佳化,但獨立於擁有自己一個說明的\\ :ref:`whatsnew311-" "faster-cpython` 計畫。" @@ -2194,8 +2172,8 @@ msgstr "" msgid "" "Integer division (``//``) is better tuned for optimization by compilers. It " "is now around 20% faster on x86-64 when dividing an :class:`int` by a value " -"smaller than ``2**30``. (Contributed by Gregory P. Smith and Tim Peters " -"in :gh:`90564`.)" +"smaller than ``2**30``. (Contributed by Gregory P. Smith and Tim Peters in :" +"gh:`90564`.)" msgstr "" "整數除法 (``//``) 為了編譯器最佳化而被調校過。現在將 :class:`int` 除以小於 " "``2**30`` 的值時,在 x86-64 上快了大約 20%。(由 Gregory P. Smith 和 Tim " @@ -2210,22 +2188,22 @@ msgstr "" "於 :gh:`68264` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1294 +#, fuzzy msgid "" -"Resizing lists is streamlined for the common case, speeding " -"up :meth:`list.append` by ≈15% and simple :term:`list comprehension`\\s by " -"up to 20-30% (Contributed by Dennis Sweeney in :gh:`91165`.)" +"Resizing lists is streamlined for the common case, speeding up :meth:`!list." +"append` by ≈15% and simple :term:`list comprehension`\\s by up to 20-30% " +"(Contributed by Dennis Sweeney in :gh:`91165`.)" msgstr "" "調整 list 大小在常見情況下增進了效能,為 :meth:`list.append` 加快了約 15% 並" -"為簡單的 :term:`list comprehension` 加快了高達 20-30%(由 Dennis Sweeney " -"在 :gh:`91165` 中貢獻。)" +"為簡單的 :term:`list comprehension` 加快了高達 20-30%(由 Dennis Sweeney 在 :" +"gh:`91165` 中貢獻。)" #: ../../whatsnew/3.11.rst:1299 msgid "" "Dictionaries don't store hash values when all keys are Unicode objects, " -"decreasing :class:`dict` size. For example, " -"``sys.getsizeof(dict.fromkeys(\"abcdefg\"))`` is reduced from 352 bytes to " -"272 bytes (23% smaller) on 64-bit platforms. (Contributed by Inada Naoki " -"in :issue:`46845`.)" +"decreasing :class:`dict` size. For example, ``sys.getsizeof(dict." +"fromkeys(\"abcdefg\"))`` is reduced from 352 bytes to 272 bytes (23% " +"smaller) on 64-bit platforms. (Contributed by Inada Naoki in :issue:`46845`.)" msgstr "" "當所有鍵都是 Unicode 物件時,字典不儲存雜湊值,減少了 :class:`dict` 的大小。" "例如,``sys.getsizeof(dict.fromkeys(\"abcdefg\"))`` 在 64-bit 平台上從 352 位" @@ -2239,8 +2217,8 @@ msgid "" "for a ≈60 MiB file. (Contributed by msoxzw in :gh:`91487`.)" msgstr "" "使用 :class:`asyncio.DatagramProtocol` 以透過 UDP 傳輸大文件時,現在速度提高" -"了幾個數量級,傳輸 ≈60 MiB 檔案的速度提高了 100 多倍。(由 msoxzw " -"在 :gh:`91487` 中貢獻。)" +"了幾個數量級,傳輸 ≈60 MiB 檔案的速度提高了 100 多倍。(由 msoxzw 在 :gh:" +"`91487` 中貢獻。)" #: ../../whatsnew/3.11.rst:1310 msgid "" @@ -2249,22 +2227,21 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`37295`.)" msgstr "" ":mod:`math` 函式 :func:`~math.comb` 和 :func:`~math.perm` 針對較大引數現在快" -"了 ≈10 倍(對於更大的 *k* 有更大的加速)。(由 Serhiy Storchaka " -"在 :issue:`37295` 中貢獻。)" +"了 ≈10 倍(對於更大的 *k* 有更大的加速)。(由 Serhiy Storchaka 在 :issue:" +"`37295` 中貢獻。)" #: ../../whatsnew/3.11.rst:1314 msgid "" -"The :mod:`statistics` " -"functions :func:`~statistics.mean`, :func:`~statistics.variance` " -"and :func:`~statistics.stdev` now consume iterators in one pass rather than " -"converting them to a :class:`list` first. This is twice as fast and can save " -"substantial memory. (Contributed by Raymond Hettinger in :gh:`90415`.)" +"The :mod:`statistics` functions :func:`~statistics.mean`, :func:`~statistics." +"variance` and :func:`~statistics.stdev` now consume iterators in one pass " +"rather than converting them to a :class:`list` first. This is twice as fast " +"and can save substantial memory. (Contributed by Raymond Hettinger in :gh:" +"`90415`.)" msgstr "" -":mod:`statistics` 函" -"式 :func:`~statistics.mean`、:func:`~statistics.variance` " -"和 :func:`~statistics.stdev` 現在會一次性的消耗疊代器,而不是先將它們轉換" -"為 :class:`list`,這讓速度提升為兩倍並可以節省大量記憶體空間。(由 Raymond " -"Hettinger 在 :gh:`90415` 中貢獻。)" +":mod:`statistics` 函式 :func:`~statistics.mean`、:func:`~statistics." +"variance` 和 :func:`~statistics.stdev` 現在會一次性的消耗疊代器,而不是先將它" +"們轉換為 :class:`list`,這讓速度提升為兩倍並可以節省大量記憶體空間。(由 " +"Raymond Hettinger 在 :gh:`90415` 中貢獻。)" #: ../../whatsnew/3.11.rst:1320 msgid "" @@ -2297,9 +2274,9 @@ msgid "" "startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " "this project are listed separately under :ref:`whatsnew311-optimizations`." msgstr "" -"此計畫專注在 Python 的 :ref:`whatsnew311-faster-startup` " -"和 :ref:`whatsnew311-faster-runtime`。不在此專案內的最佳化被獨立列出" -"在 :ref:`whatsnew311-optimizations`。" +"此計畫專注在 Python 的 :ref:`whatsnew311-faster-startup` 和 :ref:" +"`whatsnew311-faster-runtime`。不在此專案內的最佳化被獨立列出在 :ref:" +"`whatsnew311-optimizations`。" #: ../../whatsnew/3.11.rst:1346 msgid "Faster Startup" @@ -2332,9 +2309,9 @@ msgid "" "statically allocated by the interpreter. This reduces the steps in module " "execution process to:" msgstr "" -"在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的" -"\\ :ref:`程式碼物件 `\\ (和位元組碼)是由直譯器靜態分配的。這將" -"模組執行過程中的步驟減少為:" +"在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的\\ :" +"ref:`程式碼物件 `\\ (和位元組碼)是由直譯器靜態分配的。這將模組" +"執行過程中的步驟減少為:" #: ../../whatsnew/3.11.rst:1367 msgid "Statically allocated code object -> Evaluate" @@ -2390,10 +2367,10 @@ msgstr "" #: ../../whatsnew/3.11.rst:1396 msgid "" "Old-style :ref:`frame objects ` are now created only when " -"requested by debuggers or by Python introspection functions such " -"as :func:`sys._getframe` and :func:`inspect.currentframe`. For most user " -"code, no frame objects are created at all. As a result, nearly all Python " -"functions calls have sped up significantly. We measured a 3-7% speedup in " +"requested by debuggers or by Python introspection functions such as :func:" +"`sys._getframe` and :func:`inspect.currentframe`. For most user code, no " +"frame objects are created at all. As a result, nearly all Python functions " +"calls have sped up significantly. We measured a 3-7% speedup in " "pyperformance." msgstr "" "舊式\\ :ref:`幀物件 `\\ 現在僅在除錯器或 Python 自我檢查函式" @@ -2433,14 +2410,13 @@ msgid "" "Most Python function calls now consume no C stack space, speeding them up. " "In simple recursive functions like fibonacci or factorial, we observed a " "1.7x speedup. This also means recursive functions can recurse significantly " -"deeper (if the user increases the recursion limit " -"with :func:`sys.setrecursionlimit`). We measured a 1-3% improvement in " -"pyperformance." +"deeper (if the user increases the recursion limit with :func:`sys." +"setrecursionlimit`). We measured a 1-3% improvement in pyperformance." msgstr "" "現在大多數 Python 函式的呼叫因為不會佔用 C 堆疊空間而被加速。在斐波那契 " "(fibonacci) 或階乘等簡單遞迴函式中,觀察到 1.7 倍的加速。這也意味著遞迴函式可" -"以遞迴得更深(如果使用者有增加\\ :func:`遞迴限制 " -"`\\ )。我們在 pyperformance 測得 1-3% 的改進。" +"以遞迴得更深(如果使用者有增加\\ :func:`遞迴限制 `\\ )。我們在 pyperformance 測得 1-3% 的改進。" #: ../../whatsnew/3.11.rst:1427 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" @@ -2468,8 +2444,8 @@ msgid "" "more specialized one. This specialized operation uses fast paths available " "only to those use cases/types, which generally outperform their generic " "counterparts. This also brings in another concept called *inline caching*, " -"where Python caches the results of expensive operations directly in " -"the :term:`bytecode`." +"where Python caches the results of expensive operations directly in the :" +"term:`bytecode`." msgstr "" "在執行環境,Python 將嘗試在執行中的程式碼內尋找常用模式和型別穩定,然後 " "Python 將用更特化的操作替換目前操作。這種特化操作運用了僅適用於那些用例/型別" @@ -2501,13 +2477,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:1457 msgid "" -"(PEP written by Mark Shannon, with ideas inspired by Stefan Brunthaler. " -"See :pep:`659` for more information. Implementation by Mark Shannon and " -"Brandt Bucher, with additional help from Irit Katriel and Dennis Sweeney.)" +"(PEP written by Mark Shannon, with ideas inspired by Stefan Brunthaler. See :" +"pep:`659` for more information. Implementation by Mark Shannon and Brandt " +"Bucher, with additional help from Irit Katriel and Dennis Sweeney.)" msgstr "" -"(PEP 由 Mark Shannon 撰寫、概念啟發自 Stefan Brunthaler。詳情請" -"見 :pep:`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis " -"Sweeney 亦提供了額外的幫助。)" +"(PEP 由 Mark Shannon 撰寫、概念啟發自 Stefan Brunthaler。詳情請見 :pep:" +"`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis Sweeney " +"亦提供了額外的幫助。)" #: ../../whatsnew/3.11.rst:1465 msgid "Operation" @@ -2547,9 +2523,9 @@ msgstr "``x * x``" #: ../../whatsnew/3.11.rst:1468 msgid "" -"Binary add, multiply and subtract for common types such " -"as :class:`int`, :class:`float` and :class:`str` take custom fast paths for " -"their underlying types." +"Binary add, multiply and subtract for common types such as :class:`int`, :" +"class:`float` and :class:`str` take custom fast paths for their underlying " +"types." msgstr "" "常見型別如 :class:`int`、:class:`float` 與 :class:`str` 的二元加法、乘法與減" "法,為底層型別採取了特製的快速路徑。" @@ -2572,16 +2548,16 @@ msgstr "``a[i]``" #: ../../whatsnew/3.11.rst:1474 msgid "" -"Subscripting container types such as :class:`list`, :class:`tuple` " -"and :class:`dict` directly index the underlying data structures." +"Subscripting container types such as :class:`list`, :class:`tuple` and :" +"class:`dict` directly index the underlying data structures." msgstr "" "下標容器型別如 :class:`list`、:class:`tuple` 和 :class:`dict` 直接索引底層的" "資料結構。" #: ../../whatsnew/3.11.rst:1478 msgid "" -"Subscripting custom :meth:`~object.__getitem__` is also inlined similar " -"to :ref:`inline-calls`." +"Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" +"ref:`inline-calls`." msgstr "" "下標自定義 :meth:`~object.__getitem__` 也是行內的,類似於 :ref:`inline-" "calls`。" @@ -2624,8 +2600,8 @@ msgstr "``C(arg)``" #: ../../whatsnew/3.11.rst:1484 msgid "" -"Calls to common builtin (C) functions and types such as :func:`len` " -"and :class:`str` directly call their underlying C version. This avoids going " +"Calls to common builtin (C) functions and types such as :func:`len` and :" +"class:`str` directly call their underlying C version. This avoids going " "through the internal calling convention." msgstr "" "常見內建 (C) 函式和型別的呼叫,例如 :func:`len` 和 :class:`str`,會直接呼叫它" @@ -2763,8 +2739,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:1513 msgid "" "A similar optimization already existed since Python 3.10. 3.11 specializes " -"for more forms. Furthermore, all attribute loads should be sped up " -"by :issue:`45947`." +"for more forms. Furthermore, all attribute loads should be sped up by :issue:" +"`45947`." msgstr "" "類似的最佳化自從 Python 3.10 就存在。3.11 特別處理了更多形式。此外,所有屬性" "載入也被 :issue:`45947` 所加速。" @@ -2780,17 +2756,17 @@ msgid "" "Mark Shannon in :issue:`45340` and :issue:`40116`.)" msgstr "" "物件現在因為使用了惰性建立的物件命名空間所以需要更少的記憶體。它們的命名空間" -"字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` " -"和 :issue:`40116` 貢獻。 )" +"字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` 和 :issue:" +"`40116` 貢獻。 )" #: ../../whatsnew/3.11.rst:1527 msgid "" -"\"Zero-cost\" exceptions are implemented, eliminating the cost " -"of :keyword:`try` statements when no exception is raised. (Contributed by " -"Mark Shannon in :issue:`40222`.)" +"\"Zero-cost\" exceptions are implemented, eliminating the cost of :keyword:" +"`try` statements when no exception is raised. (Contributed by Mark Shannon " +"in :issue:`40222`.)" msgstr "" -"實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時" -"的 :keyword:`try` 陳述式開銷。(由 Mark Shannon 於 :issue:`40222` 貢獻。)" +"實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時的 :keyword:" +"`try` 陳述式開銷。(由 Mark Shannon 於 :issue:`40222` 貢獻。)" #: ../../whatsnew/3.11.rst:1531 msgid "" @@ -2806,9 +2782,9 @@ msgid "" ":mod:`re`'s regular expression matching engine has been partially " "refactored, and now uses computed gotos (or \"threaded code\") on supported " "platforms. As a result, Python 3.11 executes the `pyperformance regular " -"expression benchmarks `_ up to 10% faster than Python 3.10. (Contributed " -"by Brandt Bucher in :gh:`91404`.)" +"expression benchmarks `_ up to 10% faster than Python 3.10. (Contributed by Brandt " +"Bucher in :gh:`91404`.)" msgstr "" ":mod:`re` 的正規表示式比對引擎部分被重構,且現在會有支援的平台上使用 " "computed gotos(或者「執行緒程式碼 (threaded code)」),因此 Python 3.11 在執" @@ -2943,9 +2919,9 @@ msgstr ":opcode:`MAKE_CELL` 被用於建立 :ref:`cell-objects`。" #: ../../whatsnew/3.11.rst:1632 msgid "" -":opcode:`CHECK_EG_MATCH` and :opcode:`!PREP_RERAISE_STAR`, to handle " -"the :ref:`new exception groups and except* ` added " -"in :pep:`654`." +":opcode:`CHECK_EG_MATCH` and :opcode:`!PREP_RERAISE_STAR`, to handle the :" +"ref:`new exception groups and except* ` added in :pep:" +"`654`." msgstr "" ":opcode:`CHECK_EG_MATCH` 和 :opcode:`!PREP_RERAISE_STAR`,處理 :pep:`654` 所" "加入的\\ :ref:`新增例外群組和 except* `。" @@ -3186,12 +3162,11 @@ msgstr "語言/內建" #: ../../whatsnew/3.11.rst:1720 msgid "" "Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`) is " -"now deprecated. It can no longer be used to wrap other descriptors such " -"as :class:`property`. The core design of this feature was flawed and caused " -"a number of downstream problems. To \"pass-through\" " -"a :class:`classmethod`, consider using the :attr:`!__wrapped__` attribute " -"that was added in Python 3.10. (Contributed by Raymond Hettinger " -"in :gh:`89519`.)" +"now deprecated. It can no longer be used to wrap other descriptors such as :" +"class:`property`. The core design of this feature was flawed and caused a " +"number of downstream problems. To \"pass-through\" a :class:`classmethod`, " +"consider using the :attr:`!__wrapped__` attribute that was added in Python " +"3.10. (Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" "鏈接 :class:`classmethod` 描述器(在 :issue:`19072` 中引入)現已棄用。它不能" "再用於包裝其他描述器,例如 :class:`property`。此功能的核心設計存在缺陷,並導" @@ -3203,26 +3178,26 @@ msgstr "" msgid "" "Octal escapes in string and bytes literals with values larger than ``0o377`` " "(255 in decimal) now produce a :exc:`DeprecationWarning`. In a future Python " -"version, they will raise a :exc:`SyntaxWarning` and eventually " -"a :exc:`SyntaxError`. (Contributed by Serhiy Storchaka in :gh:`81548`.)" +"version, they will raise a :exc:`SyntaxWarning` and eventually a :exc:" +"`SyntaxError`. (Contributed by Serhiy Storchaka in :gh:`81548`.)" msgstr "" "值大於 ``0o377``\\(十進位為 255)的字串和位元組文本值 (bytes literal) 中的八" "進位跳脫 (octal escape) 現在會產生 :exc:`DeprecationWarning`。在未來的 " -"Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一" -"個 :exc:`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" +"Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一個 :exc:" +"`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" #: ../../whatsnew/3.11.rst:1734 msgid "" "The delegation of :func:`int` to :meth:`~object.__trunc__` is now " "deprecated. Calling ``int(a)`` when ``type(a)`` implements :meth:`!" "__trunc__` but not :meth:`~object.__int__` or :meth:`~object.__index__` now " -"raises a :exc:`DeprecationWarning`. (Contributed by Zackery Spytz " -"in :issue:`44977`.)" +"raises a :exc:`DeprecationWarning`. (Contributed by Zackery Spytz in :issue:" +"`44977`.)" msgstr "" ":func:`int` 到 :meth:`~object.__trunc__` 的授權 (delegation) 現已棄用。當 " -"``type(a)`` 有實作 :meth:`!__trunc__` 但沒有 :meth:`~object.__int__` " -"或 :meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一" -"個 :exc:`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" +"``type(a)`` 有實作 :meth:`!__trunc__` 但沒有 :meth:`~object.__int__` 或 :" +"meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一個 :exc:" +"`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" #: ../../whatsnew/3.11.rst:1744 msgid "Modules" @@ -3312,8 +3287,8 @@ msgstr ":mod:`!sunau`" #: ../../whatsnew/3.11.rst:1761 msgid "" -"(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner " -"in :gh:`68966`.)" +"(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" +"`68966`.)" msgstr "" "(由 Brett Cannon 和 Victor Stinner 分別於 :issue:`47061` 與 :gh:`68966` 中所" "貢獻。)" @@ -3342,8 +3317,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:1774 msgid "" "Undocumented modules :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!" -"sre_parse` are now deprecated. (Contributed by Serhiy Storchaka " -"in :issue:`47152`.)" +"sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" +"`47152`.)" msgstr "" "未被記錄於文件中的 :mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!" "sre_parse` 模組現在已被棄用。(由 Serhiy Storchaka 在 :issue:`47152` 中貢" @@ -3383,16 +3358,15 @@ msgid "" ":class:`!configparser.LegacyInterpolation` has been deprecated in the " "docstring since Python 3.2, and is not listed in the :mod:`configparser` " "documentation. It now emits a :exc:`DeprecationWarning` and will be removed " -"in Python 3.13. Use :class:`configparser.BasicInterpolation` " -"or :class:`configparser.ExtendedInterpolation` instead. (Contributed by Hugo " -"van Kemenade in :issue:`46607`.)" +"in Python 3.13. Use :class:`configparser.BasicInterpolation` or :class:" +"`configparser.ExtendedInterpolation` instead. (Contributed by Hugo van " +"Kemenade in :issue:`46607`.)" msgstr "" ":class:`!configparser.LegacyInterpolation` 自 Python 3.2 起已在文件字串中棄" -"用,並且未在 :mod:`configparser` 文件中列出。它現在會發出一" -"個 :exc:`DeprecationWarning` 並將在 Python 3.13 中刪除。請改" -"用 :class:`configparser.BasicInterpolation` " -"或 :class:`configparser.ExtendedInterpolation`。(由 Hugo van Kemenade " -"在 :issue:`46607` 中貢獻。)" +"用,並且未在 :mod:`configparser` 文件中列出。它現在會發出一個 :exc:" +"`DeprecationWarning` 並將在 Python 3.13 中刪除。請改用 :class:`configparser." +"BasicInterpolation` 或 :class:`configparser.ExtendedInterpolation`。(由 " +"Hugo van Kemenade 在 :issue:`46607` 中貢獻。)" #: ../../whatsnew/3.11.rst:1801 msgid "" @@ -3436,10 +3410,9 @@ msgstr ":func:`!importlib.resources.path`" #: ../../whatsnew/3.11.rst:1814 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " -"removed in Python 3.15. " -"Use :func:`locale.setlocale`, :func:`locale.getpreferredencoding(False) " -"` and :func:`locale.getlocale` functions " -"instead. (Contributed by Victor Stinner in :gh:`90817`.)" +"removed in Python 3.15. Use :func:`locale.setlocale`, :func:`locale." +"getpreferredencoding(False) ` and :func:`locale." +"getlocale` functions instead. (Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" ":func:`locale.getdefaultlocale` 函式已被棄用且將於 Python 3.15 中移除。請改" "用 :func:`locale.setlocale`、:func:`locale.getpreferredencoding(False) " @@ -3453,18 +3426,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" ":func:`!locale.resetlocale` 函式已棄用並將於 Python 3.13 中移除,請改用 " -"``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner " -"於 :gh:`90817` 中所貢獻。)" +"``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner 於 :gh:" +"`90817` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1824 msgid "" "Stricter rules will now be applied for numerical group references and group " "names in :ref:`regular expressions `. Only sequences of ASCII " -"digits will now be accepted as a numerical reference, and the group name " -"in :class:`bytes` patterns and replacement strings can only contain ASCII " +"digits will now be accepted as a numerical reference, and the group name in :" +"class:`bytes` patterns and replacement strings can only contain ASCII " "letters, digits and underscores. For now, a deprecation warning is raised " -"for syntax violating these rules. (Contributed by Serhiy Storchaka " -"in :gh:`91760`.)" +"for syntax violating these rules. (Contributed by Serhiy Storchaka in :gh:" +"`91760`.)" msgstr "" "現在將對\\ :ref:`規則運算式 `\\ 中的數值群組參照 (numerical group " "references) 和群組名稱套用更嚴格的規則。現在只接受 ASCII 數字序列作為數值參" @@ -3482,21 +3455,21 @@ msgid "" msgstr "" "在 :mod:`re` 模組中,:func:`!re.template` 函式和相應的 :const:`!re.TEMPLATE` " "和 :const:`!re.T` 旗標被棄用,因為它們沒被記錄於文件中並且缺乏明顯的目的。它" -"們將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok " -"在 :gh:`92728` 中貢獻。)" +"們將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" +"`92728` 中貢獻。)" #: ../../whatsnew/3.11.rst:1838 msgid "" ":func:`!turtle.settiltangle` has been deprecated since Python 3.1; it now " -"emits a deprecation warning and will be removed in Python 3.13. " -"Use :func:`turtle.tiltangle` instead (it was earlier incorrectly marked as " -"deprecated, and its docstring is now corrected). (Contributed by Hugo van " -"Kemenade in :issue:`45837`.)" +"emits a deprecation warning and will be removed in Python 3.13. Use :func:" +"`turtle.tiltangle` instead (it was earlier incorrectly marked as deprecated, " +"and its docstring is now corrected). (Contributed by Hugo van Kemenade in :" +"issue:`45837`.)" msgstr "" ":func:`!turtle.settiltangle` 自 Python 3.1 以來已被棄用;它現在會發出棄用警" "告,並將在 Python 3.13 中刪除。請改用 :func:`turtle.tiltangle`\\ (它之前被錯" -"誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade " -"在 :issue:`45837` 中貢獻。)" +"誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade 在 :issue:" +"`45837` 中貢獻。)" #: ../../whatsnew/3.11.rst:1844 msgid "" @@ -3525,18 +3498,18 @@ msgid "" "itself. (Contributed by Donghee Na in :issue:`42255`.)" msgstr "" ":class:`!webbrowser.MacOSX` 已被棄用且將於 Python 3.13 中移除。它並沒有被測試" -"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Donghee Na " -"於 :issue:`42255`。)" +"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Donghee Na 於 :" +"issue:`42255`。)" #: ../../whatsnew/3.11.rst:1858 msgid "" -"The behavior of returning a value from a :class:`~unittest.TestCase` " -"and :class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " +"The behavior of returning a value from a :class:`~unittest.TestCase` and :" +"class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " "default ``None`` value) is now deprecated." msgstr "" -"回傳從 :class:`~unittest.TestCase` " -"和 :class:`~unittest.IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除" -"外)給定值的行為現已棄用。" +"回傳從 :class:`~unittest.TestCase` 和 :class:`~unittest." +"IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除外)給定值的行為現已棄" +"用。" #: ../../whatsnew/3.11.rst:1862 msgid "" @@ -3870,16 +3843,15 @@ msgstr "被移除的 C API 被\\ :ref:`獨立列出 ` #: ../../whatsnew/3.11.rst:1955 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " -"generator-based coroutines to be compatible " -"with :keyword:`async` / :keyword:`await` code. The function has been " -"deprecated since Python 3.8 and the removal was initially scheduled for " -"Python 3.10. Use :keyword:`async def` instead. (Contributed by Illia " -"Volochii in :issue:`43216`.)" +"generator-based coroutines to be compatible with :keyword:`async` / :keyword:" +"`await` code. The function has been deprecated since Python 3.8 and the " +"removal was initially scheduled for Python 3.10. Use :keyword:`async def` " +"instead. (Contributed by Illia Volochii in :issue:`43216`.)" msgstr "" "刪除了 :func:`!@asyncio.coroutine` :term:`decorator` 使遺留的基於生成器的協" "程 (generator-based coroutine) 與 :keyword:`async` / :keyword:`await` 程式碼" -"相容。該函式自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改" -"用 :keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" +"相容。該函式自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改用 :" +"keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" #: ../../whatsnew/3.11.rst:1962 msgid "" @@ -3887,30 +3859,29 @@ msgid "" "generator-based coroutine objects in the debug mode. (Contributed by Illia " "Volochii in :issue:`43216`.)" msgstr "" -"移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!" -"asyncio.coroutines.CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢" -"獻。)" +"移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!asyncio.coroutines." +"CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢獻。)" #: ../../whatsnew/3.11.rst:1966 msgid "" -"Due to significant security concerns, the *reuse_address* parameter " -"of :meth:`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is " -"now entirely removed. This is because of the behavior of the socket option " -"``SO_REUSEADDR`` in UDP. (Contributed by Hugo van Kemenade " -"in :issue:`45129`.)" +"Due to significant security concerns, the *reuse_address* parameter of :meth:" +"`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " +"entirely removed. This is because of the behavior of the socket option " +"``SO_REUSEADDR`` in UDP. (Contributed by Hugo van Kemenade in :issue:" +"`45129`.)" msgstr "" -"因為有重大的安全性考量,Python 3.9 中停用" -"的 :meth:`asyncio.loop.create_datagram_endpoint` 之 *reuse_address* 參數目前" -"已經移除。這是因為 UDP socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo " -"van Kemenade 於 :issue:`45129` 中貢獻。)" +"因為有重大的安全性考量,Python 3.9 中停用的 :meth:`asyncio.loop." +"create_datagram_endpoint` 之 *reuse_address* 參數目前已經移除。這是因為 UDP " +"socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo van Kemenade 於 :issue:" +"`45129` 中貢獻。)" #: ../../whatsnew/3.11.rst:1972 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" msgstr "" -"移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似" -"的 :mod:`binascii` 函式也一併被移除:" +"移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似的 :mod:" +"`binascii` 函式也一併被移除:" #: ../../whatsnew/3.11.rst:1975 msgid ":func:`!binascii.a2b_hqx`" @@ -3948,34 +3919,32 @@ msgstr "" #: ../../whatsnew/3.11.rst:1988 msgid "" -"Removed the :meth:`~object.__getitem__` methods " -"of :class:`xml.dom.pulldom.DOMEventStream`, :class:`wsgiref.util.FileWrapper` " -"and :class:`fileinput.FileInput`, deprecated since Python 3.9. (Contributed " -"by Hugo van Kemenade in :issue:`45132`.)" +"Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." +"DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." +"FileInput`, deprecated since Python 3.9. (Contributed by Hugo van Kemenade " +"in :issue:`45132`.)" msgstr "" -"將 :class:`xml.dom.pulldom.DOMEventStream`、:class:`wsgiref.util.FileWrapper` " -"和 :class:`fileinput.FileInput` 自 Python 3.9 中棄用" -"的 :meth:`~object.__getitem__` 方法移除。(由 Hugo van Kemenade " -"在 :issue:`45132` 中貢獻。)" +"將 :class:`xml.dom.pulldom.DOMEventStream`、:class:`wsgiref.util." +"FileWrapper` 和 :class:`fileinput.FileInput` 自 Python 3.9 中棄用的 :meth:" +"`~object.__getitem__` 方法移除。(由 Hugo van Kemenade 在 :issue:`45132` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:1993 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" -"ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed " -"the :func:`!bind_textdomain_codeset` function, the :meth:`!" -"NullTranslations.output_charset` and :meth:`!" -"NullTranslations.set_output_charset` methods, and the *codeset* parameter " -"of :func:`!translation` and :func:`!install`, since they are only used for " -"the :func:`!l*gettext` functions. (Contributed by Donghee Na and Serhiy " -"Storchaka in :issue:`44235`.)" -msgstr "" -"刪除了已棄用的 :mod:`gettext` 函式 :func:`!lgettext`、:func:`!" -"ldgettext`、:func:`!lngettext` 和 :func:`!ldngettext`,也刪除了 :func:`!" -"bind_textdomain_codeset` 函式、:meth:`!NullTranslations.output_charset` " -"和 :meth:`!NullTranslations.set_output_charset` 方法,以及 :func:`!" -"translation` 和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!" -"l*gettext` 函式。(由 Donghee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢" -"獻。)" +"ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" +"func:`!bind_textdomain_codeset` function, the :meth:`!NullTranslations." +"output_charset` and :meth:`!NullTranslations.set_output_charset` methods, " +"and the *codeset* parameter of :func:`!translation` and :func:`!install`, " +"since they are only used for the :func:`!l*gettext` functions. (Contributed " +"by Donghee Na and Serhiy Storchaka in :issue:`44235`.)" +msgstr "" +"刪除了已棄用的 :mod:`gettext` 函式 :func:`!lgettext`、:func:`!ldgettext`、:" +"func:`!lngettext` 和 :func:`!ldngettext`,也刪除了 :func:`!" +"bind_textdomain_codeset` 函式、:meth:`!NullTranslations.output_charset` 和 :" +"meth:`!NullTranslations.set_output_charset` 方法,以及 :func:`!translation` " +"和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" +"式。(由 Donghee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" #: ../../whatsnew/3.11.rst:2003 msgid "Removed from the :mod:`inspect` module:" @@ -3983,31 +3952,30 @@ msgstr "於 :mod:`inspect` 模組中移除:" #: ../../whatsnew/3.11.rst:2005 msgid "" -"The :func:`!getargspec` function, deprecated since Python 3.0; " -"use :func:`inspect.signature` or :func:`inspect.getfullargspec` instead." +"The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" +"`inspect.signature` or :func:`inspect.getfullargspec` instead." msgstr "" -"Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` " -"或 :func:`inspect.getfullargspec`。" +"Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` 或 :" +"func:`inspect.getfullargspec`。" #: ../../whatsnew/3.11.rst:2008 msgid "" -"The :func:`!formatargspec` function, deprecated since Python 3.5; use " -"the :func:`inspect.signature` function or the :class:`inspect.Signature` " -"object directly." +"The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" +"func:`inspect.signature` function or the :class:`inspect.Signature` object " +"directly." msgstr "" -"Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接" -"用 :func:`inspect.signature` 函式或 :class:`inspect.Signature` 物件。" +"Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接用 :func:`inspect." +"signature` 函式或 :class:`inspect.Signature` 物件。" #: ../../whatsnew/3.11.rst:2012 msgid "" -"The undocumented :meth:`!Signature.from_builtin` and :meth:`!" -"Signature.from_function` methods, deprecated since Python 3.5; use " -"the :meth:`Signature.from_callable() ` " -"method instead." +"The undocumented :meth:`!Signature.from_builtin` and :meth:`!Signature." +"from_function` methods, deprecated since Python 3.5; use the :meth:" +"`Signature.from_callable() ` method instead." msgstr "" -"Python 3.5 中停用且沒有被紀錄於文件上的 :meth:`!Signature.from_builtin` " -"和 :meth:`!Signature.from_function` 方法;改" -"用 :meth:`Signature.from_callable() ` 方法。" +"Python 3.5 中停用且沒有被紀錄於文件上的 :meth:`!Signature.from_builtin` 和 :" +"meth:`!Signature.from_function` 方法;改用 :meth:`Signature.from_callable() " +"` 方法。" #: ../../whatsnew/3.11.rst:2017 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" @@ -4015,9 +3983,9 @@ msgstr "(由 Hugo van Kemenade 於 :issue:`45320` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2019 msgid "" -"Removed the :meth:`~object.__class_getitem__` method " -"from :class:`pathlib.PurePath`, because it was not used and added by mistake " -"in previous versions. (Contributed by Nikita Sobolev in :issue:`46483`.)" +"Removed the :meth:`~object.__class_getitem__` method from :class:`pathlib." +"PurePath`, because it was not used and added by mistake in previous " +"versions. (Contributed by Nikita Sobolev in :issue:`46483`.)" msgstr "" "自 :class:`pathlib.PurePath` 中移除 :meth:`~object.__class_getitem__` 方法," "因為它是前一版本中誤加且沒被使用。(由 Nikita Sobolev 於 :issue:`46483` 中所" @@ -4034,8 +4002,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:2028 msgid "" -"Removed the deprecated :meth:`!split` method of :class:`!" -"_tkinter.TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" +"Removed the deprecated :meth:`!split` method of :class:`!_tkinter." +"TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" msgstr "" "移除 :class:`!_tkinter.TkappType` 已被棄用的 :meth:`!split` 方法。(由 " "Erlend E. Aasland 於 :issue:`38371` 貢獻。)" @@ -4068,8 +4036,8 @@ msgid "" "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " "been removed." msgstr "" -"移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應" -"的 :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" +"移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應的 :" +"c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" #: ../../whatsnew/3.11.rst:2045 msgid "" @@ -4101,31 +4069,31 @@ msgstr "C API 的移植被\\ :ref:`獨立列出 `。" #: ../../whatsnew/3.11.rst:2063 msgid "" -":func:`open`, :func:`io.open`, :func:`codecs.open` " -"and :class:`fileinput.FileInput` no longer accept ``'U'`` (\"universal " -"newline\") in the file mode. In Python 3, \"universal newline\" mode is used " -"by default whenever a file is opened in text mode, and the ``'U'`` flag has " -"been deprecated since Python 3.3. The :ref:`newline parameter ` to these functions controls how universal newlines work. " -"(Contributed by Victor Stinner in :issue:`37330`.)" -msgstr "" -":func:`open`、:func:`io.open`、:func:`codecs.open` " -"和 :class:`fileinput.FileInput` 不再接受 ``'U'``\\ (\"universal newline\"," -"通用換行符)文件模式。在 Python 3 中,每當以文本模式 (text mode) 打開檔案時," -"預設情況下會使用「通用換行符」模式,並且自 Python 3.3 以來就不推薦使用 " -"``'U'`` 旗標。這些函式的 :ref:`newline 參數 `\\ 控制" -"了通用換行符的作用方式。(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" +":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." +"FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " +"mode. In Python 3, \"universal newline\" mode is used by default whenever a " +"file is opened in text mode, and the ``'U'`` flag has been deprecated since " +"Python 3.3. The :ref:`newline parameter ` to these " +"functions controls how universal newlines work. (Contributed by Victor " +"Stinner in :issue:`37330`.)" +msgstr "" +":func:`open`、:func:`io.open`、:func:`codecs.open` 和 :class:`fileinput." +"FileInput` 不再接受 ``'U'``\\ (\"universal newline\",通用換行符)文件模式。" +"在 Python 3 中,每當以文本模式 (text mode) 打開檔案時,預設情況下會使用「通用" +"換行符」模式,並且自 Python 3.3 以來就不推薦使用 ``'U'`` 旗標。這些函式的 :" +"ref:`newline 參數 `\\ 控制了通用換行符的作用方式。" +"(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" #: ../../whatsnew/3.11.rst:2072 msgid "" -":class:`ast.AST` node positions are now validated when provided " -"to :func:`compile` and other related functions. If invalid positions are " -"detected, a :exc:`ValueError` will be raised. (Contributed by Pablo Galindo " -"in :gh:`93351`)" +":class:`ast.AST` node positions are now validated when provided to :func:" +"`compile` and other related functions. If invalid positions are detected, a :" +"exc:`ValueError` will be raised. (Contributed by Pablo Galindo in :gh:" +"`93351`)" msgstr "" ":class:`ast.AST` 節點位置現在會在提供給 :func:`compile` 和其他相關函式時被驗" -"證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo " -"在 :gh:`93351` 中貢獻)" +"證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo 在 :" +"gh:`93351` 中貢獻)" #: ../../whatsnew/3.11.rst:2076 msgid "" @@ -4133,23 +4101,21 @@ msgid "" "executors to :meth:`asyncio.loop.set_default_executor` following a " "deprecation in Python 3.8. (Contributed by Illia Volochii in :issue:`43234`.)" msgstr "" -"在 Python 3.8 中棄用後,禁止將" -"非 :class:`concurrent.futures.ThreadPoolExecutor` 執行器傳遞" -"給 :meth:`asyncio.loop.set_default_executor`。(由 Illia Volochii " -"在 :issue:`43234` 中貢獻。)" +"在 Python 3.8 中棄用後,禁止將非 :class:`concurrent.futures." +"ThreadPoolExecutor` 執行器傳遞給 :meth:`asyncio.loop.set_default_executor`。" +"(由 Illia Volochii 在 :issue:`43234` 中貢獻。)" #: ../../whatsnew/3.11.rst:2081 msgid "" -":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` " -"and :class:`calendar.LocaleHTMLCalendar` classes now " -"use :func:`locale.getlocale`, instead of " -"using :func:`locale.getdefaultlocale`, if no locale is specified. " +":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" +"`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " +"instead of using :func:`locale.getdefaultlocale`, if no locale is specified. " "(Contributed by Victor Stinner in :issue:`46659`.)" msgstr "" -":mod:`calendar`::class:`calendar.LocaleTextCalendar` " -"和 :class:`calendar.LocaleHTMLCalendar` 類別如果沒有指定語言環境,現在會使" -"用 :func:`locale.getlocale` 而非 :func:`locale.getdefaultlocale`。(由 " -"Victor Stinner 在 :issue:`46659` 中貢獻。)" +":mod:`calendar`::class:`calendar.LocaleTextCalendar` 和 :class:`calendar." +"LocaleHTMLCalendar` 類別如果沒有指定語言環境,現在會使用 :func:`locale." +"getlocale` 而非 :func:`locale.getdefaultlocale`。(由 Victor Stinner 在 :" +"issue:`46659` 中貢獻。)" #: ../../whatsnew/3.11.rst:2087 msgid "" @@ -4164,20 +4130,19 @@ msgstr "" msgid "" "The *population* parameter of :func:`random.sample` must be a sequence, and " "automatic conversion of :class:`set`\\s to :class:`list`\\s is no longer " -"supported. Also, if the sample size is larger than the population size, " -"a :exc:`ValueError` is raised. (Contributed by Raymond Hettinger " -"in :issue:`40465`.)" +"supported. Also, if the sample size is larger than the population size, a :" +"exc:`ValueError` is raised. (Contributed by Raymond Hettinger in :issue:" +"`40465`.)" msgstr "" -":func:`random.sample` 的 *population* 參數必須是一個序列,不再支" -"援 :class:`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小," -"則會引發 :exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢" -"獻。)" +":func:`random.sample` 的 *population* 參數必須是一個序列,不再支援 :class:" +"`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小,則會引發 :" +"exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢獻。)" #: ../../whatsnew/3.11.rst:2097 msgid "" "The *random* optional parameter of :func:`random.shuffle` was removed. It " -"was previously an arbitrary random function to use for the shuffle; " -"now, :func:`random.random` (its previous default) will always be used." +"was previously an arbitrary random function to use for the shuffle; now, :" +"func:`random.random` (its previous default) will always be used." msgstr "" "刪除了 :func:`random.shuffle` 的 *random* 可選參數。它以前是用於隨機排列 " "(shuffle) 的任意隨機函式;現在都會使用 :func:`random.random`\\ (這是它以前的" @@ -4187,8 +4152,8 @@ msgstr "" msgid "" "In :mod:`re` :ref:`re-syntax`, global inline flags (e.g. ``(?i)``) can now " "only be used at the start of regular expressions. Using them elsewhere has " -"been deprecated since Python 3.6. (Contributed by Serhiy Storchaka " -"in :issue:`47066`.)" +"been deprecated since Python 3.6. (Contributed by Serhiy Storchaka in :issue:" +"`47066`.)" msgstr "" "在 :mod:`re` :ref:`re-syntax` 中,全域行內旗標(例如 ``(?i)``)現在只能在規則" "運算式的開頭使用。自 Python 3.6 以來,在其他地方使用它們已被棄用。(由 " @@ -4220,8 +4185,8 @@ msgid "" "limited subset of POSIX APIs; Python standard libraries features and modules " "related to networking, processes, threading, signals, mmap, and users/groups " "are not available or don't work. (Emscripten contributed by Christian Heimes " -"and Ethan Smith in :gh:`84461` and WASI contributed by Christian Heimes " -"in :gh:`90473`; platforms promoted in :gh:`95085`)" +"and Ethan Smith in :gh:`84461` and WASI contributed by Christian Heimes in :" +"gh:`90473`; platforms promoted in :gh:`95085`)" msgstr "" "CPython 現在有 :pep:`11` :pep:`Tier 3 支援 <11#tier-3>` 以用於交叉編譯至 " "`WebAssembly `_ 平台 `Emscripten `_ compiler and standard library. " "`Optional C11 features `_ are not required. " -"(Contributed by Victor Stinner in :issue:`46656`, :issue:`45440` " -"and :issue:`46640`.)" +"(Contributed by Victor Stinner in :issue:`46656`, :issue:`45440` and :issue:" +"`46640`.)" msgstr "" "`C11 `_ 編譯器與標準函式庫。`可選的 C11 " "特性 `_ (when available). :mod:`tkinter` now requires a pkg-config " "command to detect development settings for `Tcl/Tk`_ headers and libraries. " -"(Contributed by Christian Heimes and Erlend Egeberg Aasland " -"in :issue:`45847`, :issue:`45747`, and :issue:`45763`.)" +"(Contributed by Christian Heimes and Erlend Egeberg Aasland in :issue:" +"`45847`, :issue:`45747`, and :issue:`45763`.)" msgstr "" "大多數 stdlib 擴充模組的依賴套件、編譯器旗標 (compiler flag) 和鏈接器旗標 " "(linker flags) 現在可以透過 :program:`configure` 檢測出來。(當可用時)\\ " "`pkg-config `_ 會檢測" "出 libffi、libnsl、libsqlite3、zlib、bzip2、liblzma、libcrypt、Tcl/Tk 和 " "uuid 旗標。:mod:`tkinter` 現在需要一個 pkg-config 命令來檢測 `Tcl/Tk`_ 標頭檔" -"和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland " -"在 :issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" +"和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland 在 :" +"issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" #: ../../whatsnew/3.11.rst:2162 msgid "" @@ -4305,20 +4270,20 @@ msgstr "" msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " -"``--with-lto=thin``. (Contributed by Donghee Na and Brett Holman " -"in :issue:`44340`.)" +"``--with-lto=thin``. (Contributed by Donghee Na and Brett Holman in :issue:" +"`44340`.)" msgstr "" "CPython 現在可以透過將 ``thin`` 傳遞給 :option:`--with-lto`\\ (也就是 ``--" -"with-lto=thin``\\ )來以 `ThinLTO `_ 選項建置。(由 Donghee Na 與 Brett Holman 於 :issue:`44340` " -"中所貢獻。)" +"with-lto=thin``\\ )來以 `ThinLTO `_ 選項建置。(由 Donghee Na 與 Brett Holman 於 :issue:`44340` 中所貢" +"獻。)" #: ../../whatsnew/3.11.rst:2170 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`--without-freelists` can be used to disable all freelists " -"except empty tuple singleton. (Contributed by Christian Heimes " -"in :issue:`45522`.)" +"except empty tuple singleton. (Contributed by Christian Heimes in :issue:" +"`45522`.)" msgstr "" #: ../../whatsnew/3.11.rst:2175 @@ -4326,14 +4291,13 @@ msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " "test modules can be linked statically into a main binary or library. " -"(Contributed by Brett Cannon and Christian Heimes " -"in :issue:`45548`, :issue:`45570`, :issue:`45571`, and :issue:`43974`.)" +"(Contributed by Brett Cannon and Christian Heimes in :issue:`45548`, :issue:" +"`45570`, :issue:`45571`, and :issue:`43974`.)" msgstr "" "``Modules/Setup`` 和 ``Modules/makesetup`` 已得到改進和綁定。現在可以通過 " "``makesetup`` 建置擴充模組。除了一些測試模組外,所有模組都可以靜態鏈接到主要" -"的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes " -"在 :issue:`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢" -"獻。)" +"的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes 在 :issue:" +"`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢獻。)" #: ../../whatsnew/3.11.rst:2182 msgid "" @@ -4354,20 +4318,20 @@ msgid "" "build Python with RHEL 7's and CentOS 7's Tcl/Tk and OpenSSL." msgstr "" "RHEL 7 和 CentOS 7 上的開發套件並無提供 ``tcl.pc`` 和 ``tk.pc``;要使用 " -"``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``。目錄 ``Misc/rhel7`` 包含 " -"``.pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的" -"指示。" +"``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``。目錄 ``Misc/rhel7`` 包含 ``." +"pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的指" +"示。" #: ../../whatsnew/3.11.rst:2193 msgid "" "CPython will now use 30-bit digits by default for the Python :class:`int` " "implementation. Previously, the default was to use 30-bit digits on " "platforms with ``SIZEOF_VOID_P >= 8``, and 15-bit digits otherwise. It's " -"still possible to explicitly request use of 15-bit digits via either " -"the :option:`--enable-big-digits` option to the configure script or (for " -"Windows) the ``PYLONG_BITS_IN_DIGIT`` variable in ``PC/pyconfig.h``, but " -"this option may be removed at some point in the future. (Contributed by Mark " -"Dickinson in :issue:`45569`.)" +"still possible to explicitly request use of 15-bit digits via either the :" +"option:`--enable-big-digits` option to the configure script or (for Windows) " +"the ``PYLONG_BITS_IN_DIGIT`` variable in ``PC/pyconfig.h``, but this option " +"may be removed at some point in the future. (Contributed by Mark Dickinson " +"in :issue:`45569`.)" msgstr "" "CPython 現在預設使用 30-bit 數字來實作 Python :class:`int`。以前,在 " "``SIZEOF_VOID_P >= 8`` 的平台上預設使用 30-bit 數字,否則使用 15-bit 數字,但" @@ -4385,8 +4349,8 @@ msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" msgstr "" -"新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi " -"於 :issue:`42035` 中所貢獻。)" +"新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi 於 :issue:" +"`42035` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2216 msgid "" @@ -4398,20 +4362,20 @@ msgstr "" #: ../../whatsnew/3.11.rst:2219 msgid "" -"Add new :c:func:`PyThreadState_EnterTracing` " -"and :c:func:`PyThreadState_LeaveTracing` functions to the limited C API to " -"suspend and resume tracing and profiling. (Contributed by Victor Stinner " -"in :issue:`43760`.)" +"Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" +"`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " +"resume tracing and profiling. (Contributed by Victor Stinner in :issue:" +"`43760`.)" msgstr "" -"在受限 C API (limited C API) 中新增 :c:func:`PyThreadState_EnterTracing` " -"和 :c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能" -"分析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" +"在受限 C API (limited C API) 中新增 :c:func:`PyThreadState_EnterTracing` 和 :" +"c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能分" +"析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" #: ../../whatsnew/3.11.rst:2224 msgid "" -"Added the :c:data:`Py_Version` constant which bears the same value " -"as :c:macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta " -"in :issue:`43931`.)" +"Added the :c:data:`Py_Version` constant which bears the same value as :c:" +"macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta in :issue:" +"`43931`.)" msgstr "" "添加了 :c:data:`Py_Version` 常數,其值與 :c:macro:`PY_VERSION_HEX` 相同。" "(由 Gabriele N. Tornetta 在 :issue:`43931` 中貢獻。)" @@ -4472,11 +4436,11 @@ msgstr ":c:func:`PyMemoryView_FromBuffer`" #: ../../whatsnew/3.11.rst:2243 msgid "" -":c:member:`~PyBufferProcs.bf_getbuffer` " -"and :c:member:`~PyBufferProcs.bf_releasebuffer` type slots" +":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." +"bf_releasebuffer` type slots" msgstr "" -":c:member:`~PyBufferProcs.bf_getbuffer` " -"與 :c:member:`~PyBufferProcs.bf_releasebuffer` 型別插槽 (type slot)" +":c:member:`~PyBufferProcs.bf_getbuffer` 與 :c:member:`~PyBufferProcs." +"bf_releasebuffer` 型別插槽 (type slot)" #: ../../whatsnew/3.11.rst:2246 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" @@ -4495,38 +4459,39 @@ msgstr "" #: ../../whatsnew/3.11.rst:2253 msgid "" -"Add new functions to pack and unpack C double (serialize and " -"deserialize): :c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`, :c:func:`PyFloat_Unpack2`, :c:func:`PyFloat_Unpack4` " -"and :c:func:`PyFloat_Unpack8`. (Contributed by Victor Stinner " -"in :issue:`46906`.)" +"Add new functions to pack and unpack C double (serialize and deserialize): :" +"c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`, :c:" +"func:`PyFloat_Unpack2`, :c:func:`PyFloat_Unpack4` and :c:func:" +"`PyFloat_Unpack8`. (Contributed by Victor Stinner in :issue:`46906`.)" msgstr "" -"新增函式以打包 (pack) 和取出 (unpack) C double(序列化和反序列" -"化)::c:func:`PyFloat_Pack2`、:c:func:`PyFloat_Pack4`、:c:func:`PyFloat_Pack8`、:c:func:`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` " -"和 :c:func:`PyFloat_Unpack8`。(由 Victor Stinner 在 :issue:`46906` 中貢" -"獻。)" +"新增函式以打包 (pack) 和取出 (unpack) C double(序列化和反序列化)::c:func:" +"`PyFloat_Pack2`、:c:func:`PyFloat_Pack4`、:c:func:`PyFloat_Pack8`、:c:func:" +"`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` 和 :c:func:`PyFloat_Unpack8`。" +"(由 Victor Stinner 在 :issue:`46906` 中貢獻。)" #: ../../whatsnew/3.11.rst:2259 msgid "" -"Add new functions to get frame object " -"attributes: :c:func:`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:`PyFrame_GetGlobals`, :c:func:`PyFrame_GetLasti`." +"Add new functions to get frame object attributes: :c:func:" +"`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:" +"`PyFrame_GetGlobals`, :c:func:`PyFrame_GetLasti`." msgstr "" -"新增取得幀物件屬性的函" -"式::c:func:`PyFrame_GetBuiltins`、:c:func:`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:`PyFrame_GetLasti`。" +"新增取得幀物件屬性的函式::c:func:`PyFrame_GetBuiltins`、:c:func:" +"`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:" +"`PyFrame_GetLasti`。" #: ../../whatsnew/3.11.rst:2263 msgid "" -"Added two new functions to get and set the active exception " -"instance: :c:func:`PyErr_GetHandledException` " -"and :c:func:`PyErr_SetHandledException`. These are alternatives " -"to :c:func:`PyErr_SetExcInfo()` and :c:func:`PyErr_GetExcInfo()` which work " -"with the legacy 3-tuple representation of exceptions. (Contributed by Irit " -"Katriel in :issue:`46343`.)" +"Added two new functions to get and set the active exception instance: :c:" +"func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " +"These are alternatives to :c:func:`PyErr_SetExcInfo()` and :c:func:" +"`PyErr_GetExcInfo()` which work with the legacy 3-tuple representation of " +"exceptions. (Contributed by Irit Katriel in :issue:`46343`.)" msgstr "" -"添加了兩個新函式來獲得和設置仍在作用的例外實" -"例::c:func:`PyErr_GetHandledException` " -"和 :c:func:`PyErr_SetHandledException`。這些是 :c:func:`PyErr_SetExcInfo()` " -"和 :c:func:`PyErr_GetExcInfo()` 的替代品,它們與例外的遺留三元組表示法一起作" -"用。(由 Irit Katriel 在 :issue:`46343` 中貢獻。)" +"添加了兩個新函式來獲得和設置仍在作用的例外實例::c:func:" +"`PyErr_GetHandledException` 和 :c:func:`PyErr_SetHandledException`。這些是 :" +"c:func:`PyErr_SetExcInfo()` 和 :c:func:`PyErr_GetExcInfo()` 的替代品,它們與" +"例外的遺留三元組表示法一起作用。(由 Irit Katriel 在 :issue:`46343` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:2270 msgid "" @@ -4547,11 +4512,11 @@ msgid "" "expected types. See :pep:`670` for more details. (Contributed by Victor " "Stinner and Erlend E. Aasland in :gh:`89653`.)" msgstr "" -"一些巨集已轉換為行內靜態函式以避免\\ `巨集陷阱 (macro pitfalls) `_。這種變化對用戶來說應該是透" -"明的,因為替換函式會將它們的引數轉換為預期的型別,以避免由於靜態型別檢查而產" -"生的編譯器警告。但是,當受限 C API 設置為 >=3.11 時,這些轉換不會完成,使用者" -"需要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。(由 " +"一些巨集已轉換為行內靜態函式以避免\\ `巨集陷阱 (macro pitfalls) `_。這種變化對用戶來說應該是透明" +"的,因為替換函式會將它們的引數轉換為預期的型別,以避免由於靜態型別檢查而產生" +"的編譯器警告。但是,當受限 C API 設置為 >=3.11 時,這些轉換不會完成,使用者需" +"要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。(由 " "Victor Stinner 和 Erlend E. Aasland 在 :gh:`89653` 中貢獻。)" #: ../../whatsnew/3.11.rst:2292 @@ -4612,17 +4577,17 @@ msgstr "" #: ../../whatsnew/3.11.rst:2318 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " -"``co_cellvars`` and ``co_freevars`` fields. Instead, " -"use :c:func:`PyCode_GetCode`, :c:func:`PyCode_GetVarnames`, :c:func:`PyCode_GetCellvars` " +"``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" +"`PyCode_GetCode`, :c:func:`PyCode_GetVarnames`, :c:func:`PyCode_GetCellvars` " "and :c:func:`PyCode_GetFreevars` respectively to access them via the C API. " "(Contributed by Brandt Bucher in :issue:`46841` and Ken Jin in :gh:`92154` " "and :gh:`94936`.)" msgstr "" ":c:type:`PyCodeObject` 不再會有 ``co_code``、``co_varnames``、" -"``co_cellvars`` 和 ``co_freevars`` 欄位。分別被改為透過 C API " -"的 :c:func:`PyCode_GetCode`、:c:func:`PyCode_GetVarnames`、:c:func:`PyCode_GetCellvars` " -"和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher " -"在 :issue:`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" +"``co_cellvars`` 和 ``co_freevars`` 欄位。分別被改為透過 C API 的 :c:func:" +"`PyCode_GetCode`、:c:func:`PyCode_GetVarnames`、:c:func:`PyCode_GetCellvars` " +"和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher 在 :issue:" +"`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" #: ../../whatsnew/3.11.rst:2326 msgid "" @@ -4721,25 +4686,24 @@ msgstr "" msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :c:macro:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function " -"(:c:member:`PyTypeObject.tp_traverse`). (Contributed by Victor Stinner " -"in :issue:`44263`.)" +"(:c:member:`PyTypeObject.tp_traverse`). (Contributed by Victor Stinner in :" +"issue:`44263`.)" msgstr "" "如果一個型別是以 :c:macro:`Py_TPFLAGS_HAVE_GC` 旗標來定義,但卻沒有遍歷函式 " -"(traverse function) (:c:member:`PyTypeObject.tp_traverse`)," -"那 :c:func:`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner " -"於 :issue:`44263` 中貢獻。)" +"(traverse function) (:c:member:`PyTypeObject.tp_traverse`),那 :c:func:" +"`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner 於 :issue:`44263` " +"中貢獻。)" #: ../../whatsnew/3.11.rst:2372 msgid "" "Heap types with the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " -"the :pep:`590` vectorcall protocol. Previously, this was only possible " -"for :ref:`static types `. (Contributed by Erlend E. Aasland " -"in :issue:`43908`)" +"the :pep:`590` vectorcall protocol. Previously, this was only possible for :" +"ref:`static types `. (Contributed by Erlend E. Aasland in :" +"issue:`43908`)" msgstr "" -"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼" -"承 :pep:`590` 向量呼叫協定 (vectorcall protocol)。以前這僅適用" -"於 :ref:`static types `。(由 Erlend E. Aasland " -"在 :issue:`43908` 中貢獻)。" +"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼承 :pep:" +"`590` 向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " +"`。(由 Erlend E. Aasland 在 :issue:`43908` 中貢獻)。" #: ../../whatsnew/3.11.rst:2377 msgid "" @@ -4749,9 +4713,9 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" "由於 :c:func:`Py_TYPE()` 更改為行內靜態函式 (inline static function),因此 " -"``Py_TYPE(obj) = new_type`` 必須替換為 ``Py_SET_TYPE(obj, new_type)``:參" -"見 :c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使" -"用這個巨集:" +"``Py_TYPE(obj) = new_type`` 必須替換為 ``Py_SET_TYPE(obj, new_type)``:參見 :" +"c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這" +"個巨集:" #: ../../whatsnew/3.11.rst:2383 msgid "" @@ -4779,9 +4743,9 @@ msgid "" "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" "由於 :c:func:`Py_SIZE()` 更改為行內靜態函式,因此 ``Py_SIZE(obj) = " -"new_size`` 必須替換為 ``Py_SET_SIZE(obj, new_size)``:參" -"見 :c:func:`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使" -"用這個巨集:" +"new_size`` 必須替換為 ``Py_SET_SIZE(obj, new_size)``:參見 :c:func:" +"`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這個巨" +"集:" #: ../../whatsnew/3.11.rst:2397 msgid "" @@ -4799,9 +4763,9 @@ msgstr "" #: ../../whatsnew/3.11.rst:2405 msgid "" -"```` no longer includes the header files ````, " -"````, ```` and ```` when the ``Py_LIMITED_API`` " -"macro is set to ``0x030b0000`` (Python 3.11) or higher. C extensions should " +"```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " +"set to ``0x030b0000`` (Python 3.11) or higher. C extensions should " "explicitly include the header files after ``#include ``. " "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" @@ -4835,8 +4799,8 @@ msgid "" "Victor Stinner in :issue:`46007`.)" msgstr "" ":c:func:`!PyUnicode_CHECK_INTERNED` 巨集已從受限 C API 中移出,它從來沒辦法被" -"使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner " -"於 :issue:`46007` 中所貢獻。)" +"使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner 於 :issue:" +"`46007` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2424 msgid "" @@ -4946,8 +4910,8 @@ msgid "" "it may be faster." msgstr "" "``f_lasti``:使用 :c:func:`PyFrame_GetLasti`。程式碼中 ``f_lasti`` 有與 " -"``PyCode_Addr2Line()`` 同時使用的部分應該改" -"用 :c:func:`PyFrame_GetLineNumber`;它可能會更快。" +"``PyCode_Addr2Line()`` 同時使用的部分應該改用 :c:func:" +"`PyFrame_GetLineNumber`;它可能會更快。" #: ../../whatsnew/3.11.rst:2464 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" @@ -4995,25 +4959,25 @@ msgstr "``f_valuestack``:已移除。" #: ../../whatsnew/3.11.rst:2474 msgid "" -"The Python frame object is now created lazily. A side effect is that " -"the :attr:`~frame.f_back` member must not be accessed directly, since its " -"value is now also computed lazily. The :c:func:`PyFrame_GetBack` function " -"must be called instead." +"The Python frame object is now created lazily. A side effect is that the :" +"attr:`~frame.f_back` member must not be accessed directly, since its value " +"is now also computed lazily. The :c:func:`PyFrame_GetBack` function must be " +"called instead." msgstr "" "Python 幀物件的建立現為惰性的 (lazily),一個副作用是 :attr:`~frame.f_back` 成" -"員不能被直接存取,因為其職的計算也是惰性的,要改呼" -"叫 :c:func:`PyFrame_GetBack`。" +"員不能被直接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:" +"`PyFrame_GetBack`。" #: ../../whatsnew/3.11.rst:2480 msgid "" -"Debuggers that accessed the :attr:`~frame.f_locals` directly *must* " -"call :c:func:`PyFrame_GetLocals` instead. They no longer need to " -"call :c:func:`!PyFrame_FastToLocalsWithError` or :c:func:`!" -"PyFrame_LocalsToFast`, in fact they should not call those functions. The " -"necessary updating of the frame is now managed by the virtual machine." +"Debuggers that accessed the :attr:`~frame.f_locals` directly *must* call :c:" +"func:`PyFrame_GetLocals` instead. They no longer need to call :c:func:`!" +"PyFrame_FastToLocalsWithError` or :c:func:`!PyFrame_LocalsToFast`, in fact " +"they should not call those functions. The necessary updating of the frame is " +"now managed by the virtual machine." msgstr "" -"直接存取 :attr:`~frame.f_locals` 的除錯器\\ *必須*\\ 改為呼" -"叫 :c:func:`PyFrame_GetLocals`。他們不再需要呼叫 :c:func:`!" +"直接存取 :attr:`~frame.f_locals` 的除錯器\\ *必須*\\ 改為呼叫 :c:func:" +"`PyFrame_GetLocals`。他們不再需要呼叫 :c:func:`!" "PyFrame_FastToLocalsWithError` 或 :c:func:`!PyFrame_LocalsToFast`,事實上他們" "不應該呼叫這些函式。框架的必要更新現在由虛擬機管理。" @@ -5085,13 +5049,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:2516 msgid "" -"``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` " -"and :c:func:`PyThreadState_LeaveTracing` (functions added to Python 3.11 " -"by :issue:`43760`)." +"``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" +"`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" +"`43760`)." msgstr "" -"``tracing``:已變更,改用 :c:func:`PyThreadState_EnterTracing` " -"和 :c:func:`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中" -"新增的函式)。" +"``tracing``:已變更,改用 :c:func:`PyThreadState_EnterTracing` 和 :c:func:" +"`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中新增的函" +"式)。" #: ../../whatsnew/3.11.rst:2519 msgid "" @@ -5206,23 +5170,22 @@ msgid "" "initialize :data:`sys.path`. Otherwise, initialization will recalculate the " "path and replace any values added to ``module_search_paths``." msgstr "" -"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始" -"化 :data:`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須" -"被設為 1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` " -"的值。" +"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始化 :data:" +"`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " +"1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" #: ../../whatsnew/3.11.rst:2571 msgid "" ":c:func:`PyConfig_Read` no longer calculates the initial search path, and " "will not fill any values into :c:member:`PyConfig.module_search_paths`. To " -"calculate default paths and then modify them, finish initialization and " -"use :c:func:`PySys_GetObject` to retrieve :data:`sys.path` as a Python list " +"calculate default paths and then modify them, finish initialization and use :" +"c:func:`PySys_GetObject` to retrieve :data:`sys.path` as a Python list " "object and modify it directly." msgstr "" -":c:func:`PyConfig_Read` 不再計算初始搜尋路徑,並且不會將任何值填充" -"到 :c:member:`PyConfig.module_search_paths` 中。若要計算預設路徑然後修改它" -"們,完成初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 " -"Python 列表物件並直接修改它。" +":c:func:`PyConfig_Read` 不再計算初始搜尋路徑,並且不會將任何值填充到 :c:" +"member:`PyConfig.module_search_paths` 中。若要計算預設路徑然後修改它們,完成" +"初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 Python 列" +"表物件並直接修改它。" #: ../../whatsnew/3.11.rst:2582 msgid "" @@ -5288,12 +5251,11 @@ msgstr "" #: ../../whatsnew/3.11.rst:2601 msgid "" -"Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. " -"Use :c:func:`PyObject_Hash` instead. (Contributed by Inada Naoki " -"in :issue:`46864`.)" +"Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" +"func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" msgstr "" -"棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改" -"用 :c:func:`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" +"棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改用 :c:func:" +"`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2610 msgid "" @@ -5423,8 +5385,8 @@ msgstr "" #: ../../whatsnew/3.11.rst:2659 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " -"``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner " -"in :issue:`45440`.)" +"``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" +"`45440`.)" msgstr "" "移除 ``Py_FORCE_DOUBLE()`` 巨集。它先前被用於 ``Py_IS_INFINITY()`` 巨集。" "(由 Victor Stinner 於 :issue:`45440` 中所貢獻。)" From 8f5602321a50a7cefa61c58703f9e5927da4f0ea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 10 Jul 2025 00:17:38 +0000 Subject: [PATCH 3/6] sync with cpython d2237398 --- glossary.po | 991 ++++++++++++++++----------------- howto/logging-cookbook.po | 103 +++- library/codecs.po | 1101 ++++++++++++++++++++----------------- library/os.path.po | 142 ++--- library/sqlite3.po | 420 +++++++------- library/time.po | 453 +++++++-------- whatsnew/3.9.po | 4 +- 7 files changed, 1674 insertions(+), 1540 deletions(-) diff --git a/glossary.po b/glossary.po index df20e8a0a7..07c04d8804 100644 --- a/glossary.po +++ b/glossary.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-03-19 00:14+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,23 +68,22 @@ msgid "" "define interfaces when other techniques like :func:`hasattr` would be clumsy " "or subtly wrong (for example with :ref:`magic methods `). " "ABCs introduce virtual subclasses, which are classes that don't inherit from " -"a class but are still recognized by :func:`isinstance` " -"and :func:`issubclass`; see the :mod:`abc` module documentation. Python " -"comes with many built-in ABCs for data structures (in " -"the :mod:`collections.abc` module), numbers (in the :mod:`numbers` module), " -"streams (in the :mod:`io` module), import finders and loaders (in " -"the :mod:`importlib.abc` module). You can create your own ABCs with " -"the :mod:`abc` module." +"a class but are still recognized by :func:`isinstance` and :func:" +"`issubclass`; see the :mod:`abc` module documentation. Python comes with " +"many built-in ABCs for data structures (in the :mod:`collections.abc` " +"module), numbers (in the :mod:`numbers` module), streams (in the :mod:`io` " +"module), import finders and loaders (in the :mod:`importlib.abc` module). " +"You can create your own ABCs with the :mod:`abc` module." msgstr "" "抽象基底類別(又稱為 ABC)提供了一種定義介面的方法,作為 :term:`duck-" "typing`\\ (鴨子型別)的補充。其他類似的技術,像是 :func:`hasattr`,則顯得笨" "拙或是帶有細微的錯誤(例如使用\\ :ref:`魔術方法 (magic method) `\\ )。ABC 採用虛擬的 subclass(子類別),它們並不繼承自另一個 class" -"(類別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參" -"閱 :mod:`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構" -"(在 :mod:`collections.abc` 模組)、數字(在 :mod:`numbers` 模組)、串流" -"(在 :mod:`io` 模組)及 import 尋檢器和載入器(在 :mod:`importlib.abc` 模" -"組)。你可以使用 :mod:`abc` 模組建立自己的 ABC。" +"(類別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參閱 :" +"mod:`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構(在 :mod:" +"`collections.abc` 模組)、數字(在 :mod:`numbers` 模組)、串流(在 :mod:`io` " +"模組)及 import 尋檢器和載入器(在 :mod:`importlib.abc` 模組)。你可以使用 :" +"mod:`abc` 模組建立自己的 ABC。" #: ../../glossary.rst:38 msgid "annotation" @@ -112,12 +111,12 @@ msgstr "" #: ../../glossary.rst:50 msgid "" "See :term:`variable annotation`, :term:`function annotation`, :pep:`484` " -"and :pep:`526`, which describe this functionality. Also " -"see :ref:`annotations-howto` for best practices on working with annotations." +"and :pep:`526`, which describe this functionality. Also see :ref:" +"`annotations-howto` for best practices on working with annotations." msgstr "" "請參閱 :term:`variable annotation`、:term:`function annotation`、:pep:`484` " -"和 :pep:`526`,這些章節皆有此功能的說明。關於註釋的最佳實踐方法也請參" -"閱 :ref:`annotations-howto`。" +"和 :pep:`526`,這些章節皆有此功能的說明。關於註釋的最佳實踐方法也請參閱 :ref:" +"`annotations-howto`。" #: ../../glossary.rst:54 msgid "argument" @@ -197,12 +196,12 @@ msgstr "asynchronous context manager(非同步情境管理器)" #: ../../glossary.rst:86 msgid "" "An object which controls the environment seen in an :keyword:`async with` " -"statement by defining :meth:`~object.__aenter__` " -"and :meth:`~object.__aexit__` methods. Introduced by :pep:`492`." +"statement by defining :meth:`~object.__aenter__` and :meth:`~object." +"__aexit__` methods. Introduced by :pep:`492`." msgstr "" -"一個可以控制 :keyword:`async with` 陳述式中所見環境的物件,而它是透過定" -"義 :meth:`~object.__aenter__` 和 :meth:`~object.__aexit__` method(方法)來控" -"制的。由 :pep:`492` 引入。" +"一個可以控制 :keyword:`async with` 陳述式中所見環境的物件,而它是透過定義 :" +"meth:`~object.__aenter__` 和 :meth:`~object.__aexit__` method(方法)來控制" +"的。由 :pep:`492` 引入。" #: ../../glossary.rst:89 msgid "asynchronous generator" @@ -217,8 +216,8 @@ msgid "" msgstr "" "一個會回傳 :term:`asynchronous generator iterator`\\ (非同步產生器疊代器)的" "函式。它看起來像一個以 :keyword:`async def` 定義的協程函式 (coroutine " -"function),但不同的是它包含了 :keyword:`yield` 運算式,能生成一系列可用" -"於 :keyword:`async for` 迴圈的值。" +"function),但不同的是它包含了 :keyword:`yield` 運算式,能生成一系列可用於 :" +"keyword:`async for` 迴圈的值。" #: ../../glossary.rst:96 msgid "" @@ -249,15 +248,15 @@ msgstr "" #: ../../glossary.rst:107 msgid "" -"This is an :term:`asynchronous iterator` which when called using " -"the :meth:`~object.__anext__` method returns an awaitable object which will " -"execute the body of the asynchronous generator function until the " -"next :keyword:`yield` expression." +"This is an :term:`asynchronous iterator` which when called using the :meth:" +"`~object.__anext__` method returns an awaitable object which will execute " +"the body of the asynchronous generator function until the next :keyword:" +"`yield` expression." msgstr "" -"這是一個 :term:`asynchronous iterator`\\ (非同步疊代器),當它" -"以 :meth:`~object.__anext__` method 被呼叫時,會回傳一個可等待物件 " -"(awaitable object),該物件將執行非同步產生器的函式主體,直到遇到下一" -"個 :keyword:`yield` 運算式。" +"這是一個 :term:`asynchronous iterator`\\ (非同步疊代器),當它以 :meth:" +"`~object.__anext__` method 被呼叫時,會回傳一個可等待物件 (awaitable " +"object),該物件將執行非同步產生器的函式主體,直到遇到下一個 :keyword:`yield` " +"運算式。" #: ../../glossary.rst:112 msgid "" @@ -268,9 +267,9 @@ msgid "" "off. See :pep:`492` and :pep:`525`." msgstr "" "每個 :keyword:`yield` 會暫停處理程序,並記住執行狀態(包括區域變數及擱置中的 " -"try 陳述式)。當\\ *非同步產生器疊代器*\\ 以另一個" -"被 :meth:`~object.__anext__` 回傳的可等待物件有效地回復時,它會從停止的地方繼" -"續執行。請參閱 :pep:`492` 和 :pep:`525`。" +"try 陳述式)。當\\ *非同步產生器疊代器*\\ 以另一個被 :meth:`~object." +"__anext__` 回傳的可等待物件有效地回復時,它會從停止的地方繼續執行。請參閱 :" +"pep:`492` 和 :pep:`525`。" #: ../../glossary.rst:117 msgid "asynchronous iterable" @@ -282,9 +281,9 @@ msgid "" "return an :term:`asynchronous iterator` from its :meth:`~object.__aiter__` " "method. Introduced by :pep:`492`." msgstr "" -"一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它" -"的 :meth:`~object.__aiter__` method 回傳一個 :term:`asynchronous iterator`\\ " -"(非同步疊代器)。由 :pep:`492` 引入。" +"一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它的 :meth:" +"`~object.__aiter__` method 回傳一個 :term:`asynchronous iterator`\\ (非同步" +"疊代器)。由 :pep:`492` 引入。" #: ../../glossary.rst:122 msgid "asynchronous iterator" @@ -292,18 +291,17 @@ msgstr "asynchronous iterator(非同步疊代器)" #: ../../glossary.rst:124 msgid "" -"An object that implements the :meth:`~object.__aiter__` " -"and :meth:`~object.__anext__` methods. :meth:`~object.__anext__` must " -"return an :term:`awaitable` object. :keyword:`async for` resolves the " -"awaitables returned by an asynchronous iterator's :meth:`~object.__anext__` " -"method until it raises a :exc:`StopAsyncIteration` exception. Introduced " -"by :pep:`492`." +"An object that implements the :meth:`~object.__aiter__` and :meth:`~object." +"__anext__` methods. :meth:`~object.__anext__` must return an :term:" +"`awaitable` object. :keyword:`async for` resolves the awaitables returned by " +"an asynchronous iterator's :meth:`~object.__anext__` method until it raises " +"a :exc:`StopAsyncIteration` exception. Introduced by :pep:`492`." msgstr "" "一個實作 :meth:`~object.__aiter__` 和 :meth:`~object.__anext__` method 的物" "件。:meth:`~object.__anext__` 必須回傳一個 :term:`awaitable`\\ (可等待物" "件)。:keyword:`async for` 會解析非同步疊代器的 :meth:`~object.__anext__` " -"method 所回傳的可等待物件,直到它引發 :exc:`StopAsyncIteration` 例外。" -"由 :pep:`492` 引入。" +"method 所回傳的可等待物件,直到它引發 :exc:`StopAsyncIteration` 例外。由 :" +"pep:`492` 引入。" #: ../../glossary.rst:129 msgid "attribute" @@ -321,10 +319,10 @@ msgstr "" #: ../../glossary.rst:136 msgid "" "It is possible to give an object an attribute whose name is not an " -"identifier as defined by :ref:`identifiers`, for example " -"using :func:`setattr`, if the object allows it. Such an attribute will not " -"be accessible using a dotted expression, and would instead need to be " -"retrieved with :func:`getattr`." +"identifier as defined by :ref:`identifiers`, for example using :func:" +"`setattr`, if the object allows it. Such an attribute will not be accessible " +"using a dotted expression, and would instead need to be retrieved with :func:" +"`getattr`." msgstr "" "如果一個物件允許,給予該物件一個名稱不是由\\ :ref:`identifiers`\\ 所定義之識" "別符 (identifier) 的屬性是有可能的,例如使用 :func:`setattr`。像這樣的屬性將" @@ -336,13 +334,13 @@ msgstr "awaitable(可等待物件)" #: ../../glossary.rst:143 msgid "" -"An object that can be used in an :keyword:`await` expression. Can be " -"a :term:`coroutine` or an object with an :meth:`~object.__await__` method. " -"See also :pep:`492`." +"An object that can be used in an :keyword:`await` expression. Can be a :" +"term:`coroutine` or an object with an :meth:`~object.__await__` method. See " +"also :pep:`492`." msgstr "" -"一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一" -"個 :term:`coroutine`\\ (協程),或是一個有 :meth:`~object.__await__` method " -"的物件。另請參閱 :pep:`492`。" +"一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一個 :term:" +"`coroutine`\\ (協程),或是一個有 :meth:`~object.__await__` method 的物件。" +"另請參閱 :pep:`492`。" #: ../../glossary.rst:146 msgid "BDFL" @@ -350,8 +348,8 @@ msgstr "BDFL" #: ../../glossary.rst:148 msgid "" -"Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." +"Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." msgstr "" "Benevolent Dictator For Life(終身仁慈獨裁者),又名 `Guido van Rossum " "`_,Python 的創造者。" @@ -364,23 +362,23 @@ msgstr "binary file(二進位檔案)" msgid "" "A :term:`file object` able to read and write :term:`bytes-like objects " "`. Examples of binary files are files opened in binary " -"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer " -"`, :data:`sys.stdout.buffer `, and instances " -"of :class:`io.BytesIO` and :class:`gzip.GzipFile`." +"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer `, :data:`sys.stdout.buffer `, and instances of :class:`io." +"BytesIO` and :class:`gzip.GzipFile`." msgstr "" "一個能夠讀取和寫入 :term:`bytes-like objects `\\ (類位元" "組串物件)的 :term:`file object`\\ (檔案物件)。二進位檔案的例子有:以二進位" "模式(``'rb'``、``'wb'`` 或 ``'rb+'``)開啟的檔案、:data:`sys.stdin.buffer " -"`、:data:`sys.stdout.buffer `,以" -"及 :class:`io.BytesIO` 和 :class:`gzip.GzipFile` 實例。" +"`、:data:`sys.stdout.buffer `,以及 :class:`io." +"BytesIO` 和 :class:`gzip.GzipFile` 實例。" #: ../../glossary.rst:159 msgid "" -"See also :term:`text file` for a file object able to read and " -"write :class:`str` objects." +"See also :term:`text file` for a file object able to read and write :class:" +"`str` objects." msgstr "" -"另請參閱 :term:`text file`\\ (文字檔案),它是一個能夠讀取和寫" -"入 :class:`str` 物件的檔案物件。" +"另請參閱 :term:`text file`\\ (文字檔案),它是一個能夠讀取和寫入 :class:" +"`str` 物件的檔案物件。" #: ../../glossary.rst:161 msgid "borrowed reference" @@ -402,8 +400,8 @@ msgstr "" msgid "" "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " "to convert it to a :term:`strong reference` in-place, except when the object " -"cannot be destroyed before the last usage of the borrowed reference. " -"The :c:func:`Py_NewRef` function can be used to create a new :term:`strong " +"cannot be destroyed before the last usage of the borrowed reference. The :c:" +"func:`Py_NewRef` function can be used to create a new :term:`strong " "reference`." msgstr "" "對 :term:`borrowed reference` 呼叫 :c:func:`Py_INCREF` 以將它原地 (in-place) " @@ -417,12 +415,12 @@ msgstr "bytes-like object(類位元組串物件)" #: ../../glossary.rst:176 msgid "" -"An object that supports the :ref:`bufferobjects` and can export a " -"C-:term:`contiguous` buffer. This includes " -"all :class:`bytes`, :class:`bytearray`, and :class:`array.array` objects, as " -"well as many common :class:`memoryview` objects. Bytes-like objects can be " -"used for various operations that work with binary data; these include " -"compression, saving to a binary file, and sending over a socket." +"An object that supports the :ref:`bufferobjects` and can export a C-:term:" +"`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, " +"and :class:`array.array` objects, as well as many common :class:`memoryview` " +"objects. Bytes-like objects can be used for various operations that work " +"with binary data; these include compression, saving to a binary file, and " +"sending over a socket." msgstr "" "一個支援\\ :ref:`bufferobjects`\\ 且能夠匯出 C-:term:`contiguous` 緩衝區的物" "件。這包括所有的 :class:`bytes`、:class:`bytearray` 和 :class:`array.array` " @@ -433,9 +431,9 @@ msgstr "" msgid "" "Some operations need the binary data to be mutable. The documentation often " "refers to these as \"read-write bytes-like objects\". Example mutable " -"buffer objects include :class:`bytearray` and a :class:`memoryview` of " -"a :class:`bytearray`. Other operations require the binary data to be stored " -"in immutable objects (\"read-only bytes-like objects\"); examples of these " +"buffer objects include :class:`bytearray` and a :class:`memoryview` of a :" +"class:`bytearray`. Other operations require the binary data to be stored in " +"immutable objects (\"read-only bytes-like objects\"); examples of these " "include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." msgstr "" "有些運算需要二進位資料是可變的。說明文件通常會將這些物件稱為「可讀寫的類位元" @@ -469,8 +467,8 @@ msgstr "" #: ../../glossary.rst:203 msgid "" -"A list of bytecode instructions can be found in the documentation " -"for :ref:`the dis module `." +"A list of bytecode instructions can be found in the documentation for :ref:" +"`the dis module `." msgstr "" "位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" @@ -483,8 +481,8 @@ msgid "" "A callable is an object that can be called, possibly with a set of arguments " "(see :term:`argument`), with the following syntax::" msgstr "" -"一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請" -"見 :term:`argument`): ::" +"一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請見 :" +"term:`argument`): ::" #: ../../glossary.rst:210 msgid "callable(argument1, argument2, argumentN)" @@ -496,8 +494,8 @@ msgid "" "instance of a class that implements the :meth:`~object.__call__` method is " "also a callable." msgstr "" -"一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實" -"作 :meth:`~object.__call__` 方法的 class 之實例也是個 callable。" +"一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實作 :" +"meth:`~object.__call__` 方法的 class 之實例也是個 callable。" #: ../../glossary.rst:215 msgid "callback" @@ -542,9 +540,9 @@ msgstr "closure variable(閉包變數)" msgid "" "A :term:`free variable` referenced from a :term:`nested scope` that is " "defined in an outer scope rather than being resolved at runtime from the " -"globals or builtin namespaces. May be explicitly defined with " -"the :keyword:`nonlocal` keyword to allow write access, or implicitly defined " -"if the variable is only being read." +"globals or builtin namespaces. May be explicitly defined with the :keyword:" +"`nonlocal` keyword to allow write access, or implicitly defined if the " +"variable is only being read." msgstr "" "從外部作用域中定義且從\\ :term:`巢狀作用域 `\\ 參照的\\ :term:`" "自由變數 `,不是於 runtime 從全域或內建命名空間解析。可以使" @@ -609,10 +607,10 @@ msgstr "" "一個我們熟悉的實數系統的擴充,在此所有數字都會被表示為一個實部和一個虛部之" "和。虛數就是虛數單位(``-1`` 的平方根)的實數倍,此單位通常在數學中被寫為 " "``i``,在工程學中被寫為 ``j``。Python 內建了對複數的支援,它是用後者的記法來" -"表示複數;虛部會帶著一個後綴的 ``j`` 被編寫,例如 ``3+1j``。若要" -"將 :mod:`math` 模組內的工具等效地用於複數,請使用 :mod:`cmath` 模組。複數的使" -"用是一個相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可" -"以安全地忽略它們。" +"表示複數;虛部會帶著一個後綴的 ``j`` 被編寫,例如 ``3+1j``。若要將 :mod:" +"`math` 模組內的工具等效地用於複數,請使用 :mod:`cmath` 模組。複數的使用是一個" +"相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" +"忽略它們。" #: ../../glossary.rst:262 msgid "context" @@ -632,10 +630,9 @@ msgstr "" #: ../../glossary.rst:269 msgid "" -"The collection of key­value bindings associated with a " -"particular :class:`contextvars.Context` object and accessed " -"via :class:`~contextvars.ContextVar` objects. Also see :term:`context " -"variable`." +"The collection of key­value bindings associated with a particular :class:" +"`contextvars.Context` object and accessed via :class:`~contextvars." +"ContextVar` objects. Also see :term:`context variable`." msgstr "" #: ../../glossary.rst:273 @@ -653,8 +650,8 @@ msgid "" "The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by " "the :keyword:`with` statement. See :pep:`343`." msgstr "" -"由 :keyword:`with` 陳述式所呼叫的 :meth:`~object.__enter__` " -"和 :meth:`~object.__exit__` 方法。另請參閱 :pep:`343`。" +"由 :keyword:`with` 陳述式所呼叫的 :meth:`~object.__enter__` 和 :meth:" +"`~object.__exit__` 方法。另請參閱 :pep:`343`。" #: ../../glossary.rst:279 msgid "context manager" @@ -663,8 +660,8 @@ msgstr "context manager(情境管理器)" #: ../../glossary.rst:281 msgid "" "An object which implements the :term:`context management protocol` and " -"controls the environment seen in a :keyword:`with` statement. " -"See :pep:`343`." +"controls the environment seen in a :keyword:`with` statement. See :pep:" +"`343`." msgstr "" #: ../../glossary.rst:284 @@ -722,14 +719,13 @@ msgstr "coroutine function(協程函式)" #: ../../glossary.rst:311 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " -"may be defined with the :keyword:`async def` statement, and may " -"contain :keyword:`await`, :keyword:`async for`, and :keyword:`async with` " -"keywords. These were introduced by :pep:`492`." +"may be defined with the :keyword:`async def` statement, and may contain :" +"keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords. " +"These were introduced by :pep:`492`." msgstr "" -"一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能" -"以 :keyword:`async def` 陳述式被定義,並可能會包" -"含 :keyword:`await`、:keyword:`async for` 和 :keyword:`async with` 關鍵字。這" -"些關鍵字由 :pep:`492` 引入。" +"一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能以 :keyword:" +"`async def` 陳述式被定義,並可能會包含 :keyword:`await`、:keyword:`async " +"for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" #: ../../glossary.rst:316 msgid "CPython" @@ -755,9 +751,9 @@ msgid "" "The :term:`context` (:class:`contextvars.Context` object) that is currently " "used by :class:`~contextvars.ContextVar` objects to access (get or set) the " "values of :term:`context variables `. Each thread has its " -"own current context. Frameworks for executing asynchronous tasks " -"(see :mod:`asyncio`) associate each task with a context which becomes the " -"current context whenever the task starts or resumes execution." +"own current context. Frameworks for executing asynchronous tasks (see :mod:" +"`asyncio`) associate each task with a context which becomes the current " +"context whenever the task starts or resumes execution." msgstr "" #: ../../glossary.rst:330 @@ -804,8 +800,8 @@ msgid "" "the documentation for :ref:`function definitions ` and :ref:`class " "definitions ` for more about decorators." msgstr "" -"Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱" -"\\ :ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" +"Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" +"ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" #: ../../glossary.rst:350 msgid "descriptor" @@ -813,24 +809,23 @@ msgstr "descriptor(描述器)" #: ../../glossary.rst:352 msgid "" -"Any object which defines the " -"methods :meth:`~object.__get__`, :meth:`~object.__set__`, " -"or :meth:`~object.__delete__`. When a class attribute is a descriptor, its " -"special binding behavior is triggered upon attribute lookup. Normally, " -"using *a.b* to get, set or delete an attribute looks up the object named *b* " -"in the class dictionary for *a*, but if *b* is a descriptor, the respective " -"descriptor method gets called. Understanding descriptors is a key to a deep " -"understanding of Python because they are the basis for many features " -"including functions, methods, properties, class methods, static methods, and " -"reference to super classes." -msgstr "" -"任何定義了 :meth:`~object.__get__`、:meth:`~object.__set__` " -"或 :meth:`~object.__delete__` method 的物件。當一個 class 屬性是一個描述器" -"時,它的特殊連結行為會在屬性查找時被觸發。通常,使用 *a.b* 來取得、設定或刪除" -"某個屬性時,會在 *a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個" -"描述器,則相對應的描述器 method 會被呼叫。對描述器的理解是深入理解 Python 的" -"關鍵,因為它們是許多功能的基礎,這些功能包括函式、method、屬性 (property)、" -"class method、靜態 method,以及對 super class(父類別)的參照。" +"Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." +"__set__`, or :meth:`~object.__delete__`. When a class attribute is a " +"descriptor, its special binding behavior is triggered upon attribute " +"lookup. Normally, using *a.b* to get, set or delete an attribute looks up " +"the object named *b* in the class dictionary for *a*, but if *b* is a " +"descriptor, the respective descriptor method gets called. Understanding " +"descriptors is a key to a deep understanding of Python because they are the " +"basis for many features including functions, methods, properties, class " +"methods, static methods, and reference to super classes." +msgstr "" +"任何定義了 :meth:`~object.__get__`、:meth:`~object.__set__` 或 :meth:" +"`~object.__delete__` method 的物件。當一個 class 屬性是一個描述器時,它的特殊" +"連結行為會在屬性查找時被觸發。通常,使用 *a.b* 來取得、設定或刪除某個屬性時," +"會在 *a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器,則相" +"對應的描述器 method 會被呼叫。對描述器的理解是深入理解 Python 的關鍵,因為它" +"們是許多功能的基礎,這些功能包括函式、method、屬性 (property)、class method、" +"靜態 method,以及對 super class(父類別)的參照。" #: ../../glossary.rst:363 msgid "" @@ -875,11 +870,11 @@ msgstr "dictionary view(字典檢視)" #: ../../glossary.rst:379 msgid "" -"The objects returned from :meth:`dict.keys`, :meth:`dict.values`, " -"and :meth:`dict.items` are called dictionary views. They provide a dynamic " -"view on the dictionary’s entries, which means that when the dictionary " -"changes, the view reflects these changes. To force the dictionary view to " -"become a full list use ``list(dictview)``. See :ref:`dict-views`." +"The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" +"`dict.items` are called dictionary views. They provide a dynamic view on the " +"dictionary’s entries, which means that when the dictionary changes, the view " +"reflects these changes. To force the dictionary view to become a full list " +"use ``list(dictview)``. See :ref:`dict-views`." msgstr "" "從 :meth:`dict.keys`、:meth:`dict.values` 及 :meth:`dict.items` 回傳的物件被" "稱為字典檢視。它們提供了字典中項目的動態檢視,這表示當字典有變動時,該檢視會" @@ -899,9 +894,9 @@ msgid "" "introspection, it is the canonical place for documentation of the object." msgstr "" "一個在 class、函式或模組中,作為第一個運算式出現的字串文本。雖然它在套件執行" -"時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組" -"的 :attr:`~definition.__doc__` 屬性中。由於說明字串可以透過內省 " -"(introspection) 來瀏覽,因此它是物件的說明文件存放的標準位置。" +"時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組的 :attr:" +"`~definition.__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏" +"覽,因此它是物件的說明文件存放的標準位置。" #: ../../glossary.rst:393 msgid "duck-typing" @@ -914,10 +909,10 @@ msgid "" "called or used (\"If it looks like a duck and quacks like a duck, it must be " "a duck.\") By emphasizing interfaces rather than specific types, well-" "designed code improves its flexibility by allowing polymorphic " -"substitution. Duck-typing avoids tests using :func:`type` " -"or :func:`isinstance`. (Note, however, that duck-typing can be complemented " -"with :term:`abstract base classes `.) Instead, it " -"typically employs :func:`hasattr` tests or :term:`EAFP` programming." +"substitution. Duck-typing avoids tests using :func:`type` or :func:" +"`isinstance`. (Note, however, that duck-typing can be complemented with :" +"term:`abstract base classes `.) Instead, it typically " +"employs :func:`hasattr` tests or :term:`EAFP` programming." msgstr "" "一種程式設計風格,它不是藉由檢查一個物件的型別來確定它是否具有正確的介面;取" "而代之的是,method 或屬性會單純地被呼叫或使用。(「如果它看起來像一隻鴨子而且" @@ -943,9 +938,9 @@ msgid "" msgstr "" "Easier to ask for forgiveness than permission.(請求寬恕比請求許可更容易。)" "這種常見的 Python 編碼風格會先假設有效的鍵或屬性的存在,並在該假設被推翻時再" -"捕獲例外。這種乾淨且快速的風格,其特色是存在許多的 :keyword:`try` " -"和 :keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見" -"的 :term:`LBYL` 風格形成了對比。" +"捕獲例外。這種乾淨且快速的風格,其特色是存在許多的 :keyword:`try` 和 :" +"keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" +"格形成了對比。" #: ../../glossary.rst:412 msgid "expression" @@ -1019,10 +1014,9 @@ msgid "" "The canonical way to create a file object is by using the :func:`open` " "function." msgstr "" -"實際上,有三種檔案物件:原始的\\ :term:`二進位檔案 `、緩衝的" -"\\ :term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們" -"的介面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函" -"式。" +"實際上,有三種檔案物件:原始的\\ :term:`二進位檔案 `、緩衝的\\ :" +"term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們的介" +"面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函式。" #: ../../glossary.rst:445 msgid "file-like object" @@ -1055,9 +1049,9 @@ msgstr "" #: ../../glossary.rst:457 msgid "" -"The :func:`sys.getfilesystemencoding` " -"and :func:`sys.getfilesystemencodeerrors` functions can be used to get the " -"filesystem encoding and error handler." +"The :func:`sys.getfilesystemencoding` and :func:`sys." +"getfilesystemencodeerrors` functions can be used to get the filesystem " +"encoding and error handler." msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" @@ -1065,14 +1059,14 @@ msgstr "" #: ../../glossary.rst:461 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " -"startup by the :c:func:`PyConfig_Read` function: " -"see :c:member:`~PyConfig.filesystem_encoding` " -"and :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." +"startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." +"filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" +"c:type:`PyConfig`." msgstr "" ":term:`filesystem encoding and error handler`\\ (檔案系統編碼和錯誤處理函" -"式)會在 Python 啟動時由 :c:func:`PyConfig_Read` 函式來配置:請參" -"閱 :c:member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成" -"員 :c:member:`~PyConfig.filesystem_errors`。" +"式)會在 Python 啟動時由 :c:func:`PyConfig_Read` 函式來配置:請參閱 :c:" +"member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成員 :c:" +"member:`~PyConfig.filesystem_errors`。" #: ../../glossary.rst:466 msgid "See also the :term:`locale encoding`." @@ -1128,8 +1122,8 @@ msgstr "free threading(自由執行緒)" #: ../../glossary.rst:486 msgid "" "A threading model where multiple threads can run Python bytecode " -"simultaneously within the same interpreter. This is in contrast to " -"the :term:`global interpreter lock` which allows only one thread to execute " +"simultaneously within the same interpreter. This is in contrast to the :" +"term:`global interpreter lock` which allows only one thread to execute " "Python bytecode at a time. See :pep:`703`." msgstr "" "為一種執行緒模型,多個執行緒可以在同一直譯器中同時運行 Python 位元組碼。這與" @@ -1158,13 +1152,13 @@ msgstr "function(函式)" msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " -"execution of the body. See also :term:`parameter`, :term:`method`, and " -"the :ref:`function` section." +"execution of the body. See also :term:`parameter`, :term:`method`, and the :" +"ref:`function` section." msgstr "" "一連串的陳述式,它能夠向呼叫者回傳一些值。它也可以被傳遞零個或多個\\ :term:`" -"引數 `,這些引數可被使用於函式本體的執行。另請參" -"閱 :term:`parameter`\\ (參數)、:term:`method`\\ (方法),以及" -"\\ :ref:`function`\\ 章節。" +"引數 `,這些引數可被使用於函式本體的執行。另請參閱 :term:" +"`parameter`\\ (參數)、:term:`method`\\ (方法),以及\\ :ref:`function`\\ " +"章節。" #: ../../glossary.rst:503 msgid "function annotation" @@ -1212,8 +1206,8 @@ msgstr "__future__" msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " -"that will become standard in a future release of Python. " -"The :mod:`__future__` module documents the possible values of *feature*. By " +"that will become standard in a future release of Python. The :mod:" +"`__future__` module documents the possible values of *feature*. By " "importing this module and evaluating its variables, you can see when a new " "feature was first added to the language and when it will (or did) become the " "default::" @@ -1332,11 +1326,11 @@ msgstr "" #: ../../glossary.rst:578 msgid "" -"See also the :term:`single dispatch` glossary entry, " -"the :func:`functools.singledispatch` decorator, and :pep:`443`." +"See also the :term:`single dispatch` glossary entry, the :func:`functools." +"singledispatch` decorator, and :pep:`443`." msgstr "" -"另請參閱 :term:`single dispatch`\\ (單一調度)術語表條" -"目、:func:`functools.singledispatch` 裝飾器和 :pep:`443`。" +"另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、:func:`functools." +"singledispatch` 裝飾器和 :pep:`443`。" #: ../../glossary.rst:580 msgid "generic type" @@ -1345,21 +1339,20 @@ msgstr "generic type(泛型型別)" #: ../../glossary.rst:582 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " -"class` such as :class:`list` or :class:`dict`. Used " -"for :term:`type hints ` and :term:`annotations `." +"class` such as :class:`list` or :class:`dict`. Used for :" +"term:`type hints ` and :term:`annotations `." msgstr "" -"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一" -"個 :ref:`容器型別 `,像是 :class:`list` 和 :class:`dict`。它" -"被用於\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" +"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一個 :ref:" +"`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" +"\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" #: ../../glossary.rst:587 msgid "" -"For more details, see :ref:`generic alias types`, :pep:`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` " -"module." +"For more details, see :ref:`generic alias types`, :pep:" +"`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." msgstr "" -"詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:`484`、:pep:`585` 和 :mod:`typing` 模組。" +"詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" +"`484`、:pep:`585` 和 :mod:`typing` 模組。" #: ../../glossary.rst:589 msgid "GIL" @@ -1440,10 +1433,10 @@ msgid "" "compared to other objects (it needs an :meth:`~object.__eq__` method). " "Hashable objects which compare equal must have the same hash value." msgstr "" -"如果一個物件有一個雜湊值,該值在其生命週期中永不改變(它需要一" -"個 :meth:`~object.__hash__` method),且可與其他物件互相比較(它需要一" -"個 :meth:`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結" -"果為相等的多個可雜湊物件,它們必須擁有相同的雜湊值。" +"如果一個物件有一個雜湊值,該值在其生命週期中永不改變(它需要一個 :meth:" +"`~object.__hash__` method),且可與其他物件互相比較(它需要一個 :meth:" +"`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的" +"多個可雜湊物件,它們必須擁有相同的雜湊值。" #: ../../glossary.rst:627 msgid "" @@ -1488,8 +1481,8 @@ msgstr "immortal(不滅)" #: ../../glossary.rst:644 msgid "" -"*Immortal objects* are a CPython implementation detail introduced " -"in :pep:`683`." +"*Immortal objects* are a CPython implementation detail introduced in :pep:" +"`683`." msgstr "*不滅物件 (Immortal objects)* 是 :pep:`683` 引入的 CPython 實作細節。" #: ../../glossary.rst:647 @@ -1499,8 +1492,8 @@ msgid "" "example, :const:`True` and :const:`None` are immortal in CPython." msgstr "" "如果一個物件是不滅的,它的\\ :term:`參照計數 `\\ 永遠不會被" -"修改,因此在直譯器運行時它永遠不會被釋放。例如,:const:`True` " -"和 :const:`None` 在 CPython 中是不滅的。" +"修改,因此在直譯器運行時它永遠不會被釋放。例如,:const:`True` 和 :const:" +"`None` 在 CPython 中是不滅的。" #: ../../glossary.rst:650 msgid "immutable" @@ -1552,11 +1545,11 @@ msgstr "importer(引入器)" #: ../../glossary.rst:670 msgid "" -"An object that both finds and loads a module; both a :term:`finder` " -"and :term:`loader` object." +"An object that both finds and loads a module; both a :term:`finder` and :" +"term:`loader` object." msgstr "" -"一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也" -"是 :term:`loader`\\ (載入器)物件。" +"一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" +"`loader`\\ (載入器)物件。" #: ../../glossary.rst:672 msgid "interactive" @@ -1602,12 +1595,12 @@ msgstr "interpreter shutdown(直譯器關閉)" msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " -"critical internal structures. It also makes several calls to " -"the :term:`garbage collector `. This can trigger the " -"execution of code in user-defined destructors or weakref callbacks. Code " -"executed during the shutdown phase can encounter various exceptions as the " -"resources it relies on may not function anymore (common examples are library " -"modules or the warnings machinery)." +"critical internal structures. It also makes several calls to the :term:" +"`garbage collector `. This can trigger the execution of " +"code in user-defined destructors or weakref callbacks. Code executed during " +"the shutdown phase can encounter various exceptions as the resources it " +"relies on may not function anymore (common examples are library modules or " +"the warnings machinery)." msgstr "" "當 Python 直譯器被要求關閉時,它會進入一個特殊階段,在此它逐漸釋放所有被配置" "的資源,例如模組和各種關鍵內部結構。它也會多次呼叫\\ :term:`垃圾回收器 " @@ -1631,39 +1624,36 @@ msgstr "iterable(可疊代物件)" msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " -"and :class:`tuple`) and some non-sequence types " -"like :class:`dict`, :term:`file objects `, and objects of any " -"classes you define with an :meth:`~object.__iter__` method or with " -"a :meth:`~object.__getitem__` method that implements :term:`sequence` " -"semantics." +"and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" +"`file objects `, and objects of any classes you define with an :" +"meth:`~object.__iter__` method or with a :meth:`~object.__getitem__` method " +"that implements :term:`sequence` semantics." msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" -"是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像" -"是 :class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物" -"件,只要那些 class 有實作 :term:`sequence`\\ (序列)語意" -"的 :meth:`~object.__iter__` 或是 :meth:`~object.__getitem__` method,該物件就" -"是可疊代物件。" +"是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像是 :" +"class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物件," +"只要那些 class 有實作 :term:`sequence`\\ (序列)語意的 :meth:`~object." +"__iter__` 或是 :meth:`~object.__getitem__` method,該物件就是可疊代物件。" #: ../../glossary.rst:713 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " -"iterable object is passed as an argument to the built-in " -"function :func:`iter`, it returns an iterator for the object. This iterator " -"is good for one pass over the set of values. When using iterables, it is " -"usually not necessary to call :func:`iter` or deal with iterator objects " -"yourself. The :keyword:`for` statement does that automatically for you, " -"creating a temporary unnamed variable to hold the iterator for the duration " -"of the loop. See also :term:`iterator`, :term:`sequence`, " -"and :term:`generator`." -msgstr "" -"可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 " -"(:func:`zip`、:func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函" -"式 :func:`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行" -"一遍 (one pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理" -"疊代器物件。:keyword:`for` 陳述式會自動地為你處理這些事,它會建立一個暫時性的" -"未命名變數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代" -"器)、:term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" +"iterable object is passed as an argument to the built-in function :func:" +"`iter`, it returns an iterator for the object. This iterator is good for " +"one pass over the set of values. When using iterables, it is usually not " +"necessary to call :func:`iter` or deal with iterator objects yourself. The :" +"keyword:`for` statement does that automatically for you, creating a " +"temporary unnamed variable to hold the iterator for the duration of the " +"loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`." +msgstr "" +"可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 (:func:" +"`zip`、:func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函式 :func:" +"`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行一遍 (one " +"pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理疊代器物" +"件。:keyword:`for` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變" +"數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:" +"term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" #: ../../glossary.rst:723 msgid "iterator" @@ -1671,33 +1661,32 @@ msgstr "iterator(疊代器)" #: ../../glossary.rst:725 msgid "" -"An object representing a stream of data. Repeated calls to the " -"iterator's :meth:`~iterator.__next__` method (or passing it to the built-in " -"function :func:`next`) return successive items in the stream. When no more " -"data are available a :exc:`StopIteration` exception is raised instead. At " -"this point, the iterator object is exhausted and any further calls to " -"its :meth:`!__next__` method just raise :exc:`StopIteration` again. " -"Iterators are required to have an :meth:`~iterator.__iter__` method that " -"returns the iterator object itself so every iterator is also iterable and " -"may be used in most places where other iterables are accepted. One notable " -"exception is code which attempts multiple iteration passes. A container " -"object (such as a :class:`list`) produces a fresh new iterator each time you " -"pass it to the :func:`iter` function or use it in a :keyword:`for` loop. " -"Attempting this with an iterator will just return the same exhausted " -"iterator object used in the previous iteration pass, making it appear like " -"an empty container." +"An object representing a stream of data. Repeated calls to the iterator's :" +"meth:`~iterator.__next__` method (or passing it to the built-in function :" +"func:`next`) return successive items in the stream. When no more data are " +"available a :exc:`StopIteration` exception is raised instead. At this " +"point, the iterator object is exhausted and any further calls to its :meth:`!" +"__next__` method just raise :exc:`StopIteration` again. Iterators are " +"required to have an :meth:`~iterator.__iter__` method that returns the " +"iterator object itself so every iterator is also iterable and may be used in " +"most places where other iterables are accepted. One notable exception is " +"code which attempts multiple iteration passes. A container object (such as " +"a :class:`list`) produces a fresh new iterator each time you pass it to the :" +"func:`iter` function or use it in a :keyword:`for` loop. Attempting this " +"with an iterator will just return the same exhausted iterator object used in " +"the previous iteration pass, making it appear like an empty container." msgstr "" "一個表示資料流的物件。重複地呼叫疊代器的 :meth:`~iterator.__next__` method" "(或是將它傳遞給內建函式 :func:`next`\\ )會依序回傳資料流中的各項目。當不再" "有資料時,則會引發 :exc:`StopIteration` 例外。此時,該疊代器物件已被用盡,而" -"任何對其 :meth:`!__next__` method 的進一步呼叫,都只會再次引" -"發 :exc:`StopIteration`。疊代器必須有一個 :meth:`~iterator.__iter__` method," -"它會回傳疊代器物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用" -"其他可疊代物件的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration " -"passes) 的程式碼。一個容器物件(像是 :class:`list`)在每次你將它傳遞" -"給 :func:`iter` 函式或在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊" -"代器。使用疊代器嘗試此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一" -"個已被用盡的疊代器物件,使其看起來就像一個空的容器。" +"任何對其 :meth:`!__next__` method 的進一步呼叫,都只會再次引發 :exc:" +"`StopIteration`。疊代器必須有一個 :meth:`~iterator.__iter__` method,它會回傳" +"疊代器物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊" +"代物件的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程" +"式碼。一個容器物件(像是 :class:`list`)在每次你將它傳遞給 :func:`iter` 函式" +"或在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試" +"此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" +"件,使其看起來就像一個空的容器。" #: ../../glossary.rst:740 msgid "More information can be found in :ref:`typeiter`." @@ -1705,14 +1694,13 @@ msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" #: ../../glossary.rst:744 msgid "" -"CPython does not consistently apply the requirement that an iterator " -"define :meth:`~iterator.__iter__`. And also please note that the free-" -"threading CPython does not guarantee the thread-safety of iterator " -"operations." +"CPython does not consistently apply the requirement that an iterator define :" +"meth:`~iterator.__iter__`. And also please note that the free-threading " +"CPython does not guarantee the thread-safety of iterator operations." msgstr "" -"CPython 並不是始終如一地都會檢查「疊代器有定" -"義 :meth:`~iterator.__iter__`\\ 」這個規定。另請注意,free-threading(自由執" -"行緒)CPython 不保證疊代器操作的執行緒安全。" +"CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`~iterator." +"__iter__`\\ 」這個規定。另請注意,free-threading(自由執行緒)CPython 不保證" +"疊代器操作的執行緒安全。" #: ../../glossary.rst:749 msgid "key function" @@ -1731,31 +1719,31 @@ msgstr "" #: ../../glossary.rst:756 msgid "" "A number of tools in Python accept key functions to control how elements are " -"ordered or grouped. They " -"include :func:`min`, :func:`max`, :func:`sorted`, :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq.nlargest`, " -"and :func:`itertools.groupby`." +"ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" +"meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq." +"nlargest`, and :func:`itertools.groupby`." msgstr "" -"Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包" -"括 :func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq.merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` " -"和 :func:`itertools.groupby`。" +"Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包括 :" +"func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq." +"merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." +"groupby`。" #: ../../glossary.rst:762 msgid "" -"There are several ways to create a key function. For example. " -"the :meth:`str.lower` method can serve as a key function for case " -"insensitive sorts. Alternatively, a key function can be built from " -"a :keyword:`lambda` expression such as ``lambda r: (r[0], r[2])``. " -"Also, :func:`operator.attrgetter`, :func:`operator.itemgetter`, " -"and :func:`operator.methodcaller` are three key function constructors. See " -"the :ref:`Sorting HOW TO ` for examples of how to create and " -"use key functions." +"There are several ways to create a key function. For example. the :meth:" +"`str.lower` method can serve as a key function for case insensitive sorts. " +"Alternatively, a key function can be built from a :keyword:`lambda` " +"expression such as ``lambda r: (r[0], r[2])``. Also, :func:`operator." +"attrgetter`, :func:`operator.itemgetter`, and :func:`operator.methodcaller` " +"are three key function constructors. See the :ref:`Sorting HOW TO " +"` for examples of how to create and use key functions." msgstr "" "有幾種方法可以建立一個鍵函式。例如,:meth:`str.lower` method 可以作為不分大小" "寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造,例" -"如 ``lambda r: (r[0], r[2])``。另" -"外,:func:`operator.attrgetter`、:func:`operator.itemgetter` " -"和 :func:`operator.methodcaller` 為三個鍵函式的建構函式 (constructor)。關於如" -"何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 `。" +"如 ``lambda r: (r[0], r[2])``。另外,:func:`operator.attrgetter`、:func:" +"`operator.itemgetter` 和 :func:`operator.methodcaller` 為三個鍵函式的建構函" +"式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " +"`。" #: ../../glossary.rst:769 msgid "keyword argument" @@ -1791,8 +1779,8 @@ msgid "" "statements." msgstr "" "Look before you leap.(三思而後行。)這種編碼風格會在進行呼叫或查找之前,明確" -"地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許" -"多 :keyword:`if` 陳述式的存在。" +"地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" +"keyword:`if` 陳述式的存在。" #: ../../glossary.rst:784 msgid "" @@ -1844,9 +1832,9 @@ msgid "" msgstr "" "一種用來處理一個序列中的全部或部分元素,並將處理結果以一個 list 回傳的簡要方" "法。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會產" -"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 " -"(0x..)。:keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有" -"元素都會被處理。" +"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 (0x..)。:" +"keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" +"處理。" #: ../../glossary.rst:806 msgid "loader" @@ -1854,10 +1842,10 @@ msgstr "loader(載入器)" #: ../../glossary.rst:808 msgid "" -"An object that loads a module. It must define the :meth:`!exec_module` " -"and :meth:`!create_module` methods to implement " -"the :class:`~importlib.abc.Loader` interface. A loader is typically returned " -"by a :term:`finder`. See also:" +"An object that loads a module. It must define the :meth:`!exec_module` and :" +"meth:`!create_module` methods to implement the :class:`~importlib.abc." +"Loader` interface. A loader is typically returned by a :term:`finder`. See " +"also:" msgstr "" "一個能夠載入模組的物件。它必須定義 :meth:`!exec_module` 和 :meth:`!" "create_module` 方法以實作 :class:`~importlib.abc.Loader` 介面。載入器通常是" @@ -1881,13 +1869,11 @@ msgstr "locale encoding(區域編碼)" #: ../../glossary.rst:819 msgid "" -"On Unix, it is the encoding of the LC_CTYPE locale. It can be set " -"with :func:`locale.setlocale(locale.LC_CTYPE, new_locale) " -"`." +"On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" +"`locale.setlocale(locale.LC_CTYPE, new_locale) `." msgstr "" -"在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以" -"用 :func:`locale.setlocale(locale.LC_CTYPE, new_locale) ` " -"來設定。" +"在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." +"setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" #: ../../glossary.rst:822 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." @@ -1921,18 +1907,17 @@ msgstr "mapping(對映)" #: ../../glossary.rst:836 msgid "" "A container object that supports arbitrary key lookups and implements the " -"methods specified in the :class:`collections.abc.Mapping` " -"or :class:`collections.abc.MutableMapping` :ref:`abstract base classes " -"`. Examples " -"include :class:`dict`, :class:`collections.defaultdict`, :class:`collections.OrderedDict` " -"and :class:`collections.Counter`." +"methods specified in the :class:`collections.abc.Mapping` or :class:" +"`collections.abc.MutableMapping` :ref:`abstract base classes `. Examples include :class:`dict`, :class:" +"`collections.defaultdict`, :class:`collections.OrderedDict` and :class:" +"`collections.Counter`." msgstr "" "一個容器物件,它支援任意鍵的查找,且能實作 :ref:`abstract base classes(抽象" -"基底類別) `\\ " -"中,:class:`collections.abc.Mapping` " -"或 :class:`collections.abc.MutableMapping` 所指定的 method。範例包" -"括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections.OrderedDict` " -"和 :class:`collections.Counter`。" +"基底類別) `\\ 中,:class:`collections." +"abc.Mapping` 或 :class:`collections.abc.MutableMapping` 所指定的 method。範例" +"包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." +"OrderedDict` 和 :class:`collections.Counter`。" #: ../../glossary.rst:842 msgid "meta path finder" @@ -1991,8 +1976,8 @@ msgstr "method(方法)" msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " -"first :term:`argument` (which is usually called ``self``). " -"See :term:`function` and :term:`nested scope`." +"first :term:`argument` (which is usually called ``self``). See :term:" +"`function` and :term:`nested scope`." msgstr "" "一個在 class 本體內被定義的函式。如果 method 作為其 class 實例的一個屬性被呼" "叫,則它將會得到該實例物件成為它的第一個 :term:`argument`\\ (引數)(此引數" @@ -2039,8 +2024,8 @@ msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." msgstr "" -"一個命名空間,它包含用於載入模組的 import 相關資訊。它" -"是 :class:`importlib.machinery.ModuleSpec` 的一個實例。" +"一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." +"machinery.ModuleSpec` 的一個實例。" #: ../../glossary.rst:886 msgid "See also :ref:`module-specs`." @@ -2060,11 +2045,11 @@ msgstr "mutable(可變物件)" #: ../../glossary.rst:892 msgid "" -"Mutable objects can change their value but keep their :func:`id`. See " -"also :term:`immutable`." +"Mutable objects can change their value but keep their :func:`id`. See also :" +"term:`immutable`." msgstr "" -"可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參" -"閱 :term:`immutable`\\ (不可變物件)。" +"可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" +"`immutable`\\ (不可變物件)。" #: ../../glossary.rst:894 msgid "named tuple" @@ -2082,9 +2067,9 @@ msgstr "" #: ../../glossary.rst:900 msgid "" -"Several built-in types are named tuples, including the values returned " -"by :func:`time.localtime` and :func:`os.stat`. Another example " -"is :data:`sys.float_info`::" +"Several built-in types are named tuples, including the values returned by :" +"func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." +"float_info`::" msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" @@ -2104,18 +2089,17 @@ msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " "that inherits from :class:`tuple` and that defines named fields. Such a " -"class can be written by hand, or it can be created by " -"inheriting :class:`typing.NamedTuple`, or with the factory " -"function :func:`collections.namedtuple`. The latter techniques also add " -"some extra methods that may not be found in hand-written or built-in named " -"tuples." +"class can be written by hand, or it can be created by inheriting :class:" +"`typing.NamedTuple`, or with the factory function :func:`collections." +"namedtuple`. The latter techniques also add some extra methods that may not " +"be found in hand-written or built-in named tuples." msgstr "" "有些 named tuple 是內建型別(如上例)。或者,一個 named tuple 也可以從一個正" "規的 class 定義來建立,只要該 class 是繼承自 :class:`tuple`,且定義了附名欄" -"位 (named field) 即可。這類的 class 可以手工編寫、可以繼承" -"自 :class:`typing.NamedTuple` 來建立,也可以使用工廠函式 (factory " -"function) :func:`collections.namedtuple` 來建立。後者技術也增加了一些額外的 " -"method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到的。" +"位 (named field) 即可。這類的 class 可以手工編寫、可以繼承自 :class:`typing." +"NamedTuple` 來建立,也可以使用工廠函式 (factory function) :func:`collections." +"namedtuple` 來建立。後者技術也增加了一些額外的 method,這些 method 可能是在手" +"寫或內建的 named tuple 中,無法找到的。" #: ../../glossary.rst:919 msgid "namespace" @@ -2126,21 +2110,20 @@ msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " "as nested namespaces in objects (in methods). Namespaces support modularity " -"by preventing naming conflicts. For instance, the " -"functions :func:`builtins.open <.open>` and :func:`os.open` are " -"distinguished by their namespaces. Namespaces also aid readability and " -"maintainability by making it clear which module implements a function. For " -"instance, writing :func:`random.seed` or :func:`itertools.islice` makes it " -"clear that those functions are implemented by the :mod:`random` " -"and :mod:`itertools` modules, respectively." +"by preventing naming conflicts. For instance, the functions :func:`builtins." +"open <.open>` and :func:`os.open` are distinguished by their namespaces. " +"Namespaces also aid readability and maintainability by making it clear which " +"module implements a function. For instance, writing :func:`random.seed` or :" +"func:`itertools.islice` makes it clear that those functions are implemented " +"by the :mod:`random` and :mod:`itertools` modules, respectively." msgstr "" "變數被儲存的地方。命名空間是以 dictionary(字典)被實作。有區域的、全域的及內" "建的命名空間,而在物件中(在 method 中)也有巢狀的命名空間。命名空間藉由防止" -"命名衝突,來支援模組化。例如,函式 :func:`builtins.open <.open>` " -"和 :func:`os.open` 是透過它們的命名空間來區分彼此。命名空間也藉由明確地區分是" -"哪個模組在實作一個函式,來增進可讀性及可維護性。例如,寫" -"出 :func:`random.seed` 或 :func:`itertools.islice` 明確地表示,這些函式分別是" -"由 :mod:`random` 和 :mod:`itertools` 模組在實作。" +"命名衝突,來支援模組化。例如,函式 :func:`builtins.open <.open>` 和 :func:" +"`os.open` 是透過它們的命名空間來區分彼此。命名空間也藉由明確地區分是哪個模組" +"在實作一個函式,來增進可讀性及可維護性。例如,寫出 :func:`random.seed` 或 :" +"func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" +"`itertools` 模組在實作。" #: ../../glossary.rst:931 msgid "namespace package" @@ -2201,15 +2184,13 @@ msgstr "new-style class(新式類別)" msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " -"versatile features like :attr:`~object.__slots__`, descriptors, " -"properties, :meth:`~object.__getattribute__`, class methods, and static " -"methods." +"versatile features like :attr:`~object.__slots__`, descriptors, properties, :" +"meth:`~object.__getattribute__`, class methods, and static methods." msgstr "" "一個舊名,它是指現在所有的 class 物件所使用的 class 風格。在早期的 Python 版" -"本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像" -"是 :attr:`~object.__slots__`、描述器 (descriptor)、屬性 " -"(property)、:meth:`~object.__getattribute__`、class method(類別方法)和 " -"static method(靜態方法)。" +"本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像是 :attr:`~object." +"__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." +"__getattribute__`、class method(類別方法)和 static method(靜態方法)。" #: ../../glossary.rst:960 msgid "object" @@ -2220,8 +2201,8 @@ msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." msgstr "" -"具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任" -"何 :term:`new-style class`\\ (新式類別)的最終 base class(基底類別)。" +"具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" +"`new-style class`\\ (新式類別)的最終 base class(基底類別)。" #: ../../glossary.rst:965 msgid "optimized scope" @@ -2357,8 +2338,8 @@ msgstr "" msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " -"the :class:`inspect.Parameter` class, the :ref:`function` section, " -"and :pep:`362`." +"the :class:`inspect.Parameter` class, the :ref:`function` section, and :pep:" +"`362`." msgstr "" "另請參閱術語表的 :term:`argument`\\ (引數)條目、常見問題中的\\ :ref:`引數和" "參數之間的差異 `、:class:`inspect.Parameter` " @@ -2382,21 +2363,21 @@ msgstr "path entry finder(路徑項目尋檢器)" #: ../../glossary.rst:1040 msgid "" -"A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. " -"a :term:`path entry hook`) which knows how to locate modules given " -"a :term:`path entry`." +"A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" +"term:`path entry hook`) which knows how to locate modules given a :term:" +"`path entry`." msgstr "" -"被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一" -"個 :term:`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一" -"個 :term:`path entry`\\ 定位模組。" +"被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一個 :term:" +"`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" +"`path entry`\\ 定位模組。" #: ../../glossary.rst:1044 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" -"關於路徑項目尋檢器實作的 method,請參" -"閱 :class:`importlib.abc.PathEntryFinder`。" +"關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." +"PathEntryFinder`。" #: ../../glossary.rst:1046 msgid "path entry hook" @@ -2430,21 +2411,21 @@ msgstr "path-like object(類路徑物件)" #: ../../glossary.rst:1057 msgid "" -"An object representing a file system path. A path-like object is either " -"a :class:`str` or :class:`bytes` object representing a path, or an object " -"implementing the :class:`os.PathLike` protocol. An object that supports " -"the :class:`os.PathLike` protocol can be converted to a :class:`str` " -"or :class:`bytes` file system path by calling the :func:`os.fspath` " -"function; :func:`os.fsdecode` and :func:`os.fsencode` can be used to " -"guarantee a :class:`str` or :class:`bytes` result instead, respectively. " -"Introduced by :pep:`519`." -msgstr "" -"一個表示檔案系統路徑的物件。類路徑物件可以是一個表示路徑的 :class:`str` " -"或 :class:`bytes` 物件,或是一個實作 :class:`os.PathLike` 協定的物件。透過呼" -"叫 :func:`os.fspath` 函式,一個支援 :class:`os.PathLike` 協定的物件可以被轉換" -"為 :class:`str` 或 :class:`bytes` 檔案系統路徑;而 :func:`os.fsdecode` " -"及 :func:`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結" -"果。由 :pep:`519` 引入。" +"An object representing a file system path. A path-like object is either a :" +"class:`str` or :class:`bytes` object representing a path, or an object " +"implementing the :class:`os.PathLike` protocol. An object that supports the :" +"class:`os.PathLike` protocol can be converted to a :class:`str` or :class:" +"`bytes` file system path by calling the :func:`os.fspath` function; :func:" +"`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a :class:" +"`str` or :class:`bytes` result instead, respectively. Introduced by :pep:" +"`519`." +msgstr "" +"一個表示檔案系統路徑的物件。類路徑物件可以是一個表示路徑的 :class:`str` 或 :" +"class:`bytes` 物件,或是一個實作 :class:`os.PathLike` 協定的物件。透過呼叫 :" +"func:`os.fspath` 函式,一個支援 :class:`os.PathLike` 協定的物件可以被轉換為 :" +"class:`str` 或 :class:`bytes` 檔案系統路徑;而 :func:`os.fsdecode` 及 :func:" +"`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" +"pep:`519` 引入。" #: ../../glossary.rst:1065 msgid "PEP" @@ -2566,9 +2547,9 @@ msgid "" "Python sometimes use a numerical counter instead::" msgstr "" "一個想法或一段程式碼,它應用了 Python 語言最常見的慣用語,而不是使用其他語言" -"常見的概念來實作程式碼。例如,Python 中常見的一種習慣用法,是使用一" -"個 :keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並" -"沒有這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" +"常見的概念來實作程式碼。例如,Python 中常見的一種習慣用法,是使用一個 :" +"keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" +"這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" #: ../../glossary.rst:1122 msgid "" @@ -2634,8 +2615,8 @@ msgstr "" #: ../../glossary.rst:1148 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " -"dotted path to the module, including any parent packages, e.g. " -"``email.mime.text``::" +"dotted path to the module, including any parent packages, e.g. ``email.mime." +"text``::" msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" @@ -2667,8 +2648,8 @@ msgstr "" "對於一個物件的參照次數。當一個物件的參照計數下降到零時,它會被解除配置 " "(deallocated)。有些物件是「\\ :term:`不滅的 ` (immortal)」並擁有不" "會被改變的參照計數,也因此永遠不會被解除配置。參照計數通常在 Python 程式碼中" -"看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼" -"叫 :func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" +"看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :" +"func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" #: ../../glossary.rst:1165 msgid "regular package" @@ -2676,8 +2657,8 @@ msgstr "regular package(正規套件)" #: ../../glossary.rst:1167 msgid "" -"A traditional :term:`package`, such as a directory containing an " -"``__init__.py`` file." +"A traditional :term:`package`, such as a directory containing an ``__init__." +"py`` file." msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" @@ -2692,8 +2673,8 @@ msgstr "REPL" #: ../../glossary.rst:1173 msgid "" -"An acronym for the \"read–eval–print loop\", another name for " -"the :term:`interactive` interpreter shell." +"An acronym for the \"read–eval–print loop\", another name for the :term:" +"`interactive` interpreter shell." msgstr "" "「read-eval-print 迴圈 (read–eval–print loop)」的縮寫,是\\ :term:`互動式 " "`\\ 直譯器 shell 的另一個名稱。" @@ -2722,38 +2703,38 @@ msgstr "sequence(序列)" #: ../../glossary.rst:1184 msgid "" "An :term:`iterable` which supports efficient element access using integer " -"indices via the :meth:`~object.__getitem__` special method and defines " -"a :meth:`~object.__len__` method that returns the length of the sequence. " -"Some built-in sequence types " -"are :class:`list`, :class:`str`, :class:`tuple`, and :class:`bytes`. Note " -"that :class:`dict` also supports :meth:`~object.__getitem__` and :meth:`!" -"__len__`, but is considered a mapping rather than a sequence because the " -"lookups use arbitrary :term:`hashable` keys rather than integers." +"indices via the :meth:`~object.__getitem__` special method and defines a :" +"meth:`~object.__len__` method that returns the length of the sequence. Some " +"built-in sequence types are :class:`list`, :class:`str`, :class:`tuple`, " +"and :class:`bytes`. Note that :class:`dict` also supports :meth:`~object." +"__getitem__` and :meth:`!__len__`, but is considered a mapping rather than a " +"sequence because the lookups use arbitrary :term:`hashable` keys rather than " +"integers." msgstr "" "一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`~object.__getitem__` " "special method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一" -"個 :meth:`~object.__len__` method 來回傳該序列的長度。一些內建序列型別包" -"括 :class:`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖" -"然 :class:`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`!__len__`,但它" -"被視為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` " -"鍵,而不是整數。" +"個 :meth:`~object.__len__` method 來回傳該序列的長度。一些內建序列型別包括 :" +"class:`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :" +"class:`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`!__len__`,但它被視" +"為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` 鍵," +"而不是整數。" #: ../../glossary.rst:1193 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " -"richer interface that goes beyond just :meth:`~object.__getitem__` " -"and :meth:`~object.__len__`, adding :meth:`!count`, :meth:`!" -"index`, :meth:`~object.__contains__`, and :meth:`~object.__reversed__`. " -"Types that implement this expanded interface can be registered explicitly " -"using :func:`~abc.ABCMeta.register`. For more documentation on sequence " -"methods generally, see :ref:`Common Sequence Operations `." +"richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" +"`~object.__len__`, adding :meth:`!count`, :meth:`!index`, :meth:`~object." +"__contains__`, and :meth:`~object.__reversed__`. Types that implement this " +"expanded interface can be registered explicitly using :func:`~abc.ABCMeta." +"register`. For more documentation on sequence methods generally, see :ref:" +"`Common Sequence Operations `." msgstr "" "抽象基底類別 (abstract base class) :class:`collections.abc.Sequence` 定義了一" -"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` " -"和 :meth:`~object.__len__`,還增加了 :meth:`!count`、:meth:`!" -"index`、:meth:`~object.__contains__` 和 :meth:`~object.__reversed__`。實作此" -"擴充介面的型別,可以使用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於" -"序列方法的文件,請見\\ :ref:`常見序列操作 `。" +"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` 和 :meth:`~object." +"__len__`,還增加了 :meth:`!count`、:meth:`!index`、:meth:`~object." +"__contains__` 和 :meth:`~object.__reversed__`。實作此擴充介面的型別,可以使" +"用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文件,請見" +"\\ :ref:`常見序列操作 `。" #: ../../glossary.rst:1202 msgid "set comprehension" @@ -2763,8 +2744,8 @@ msgstr "set comprehension(集合綜合運算)" msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " -"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. " -"See :ref:`comprehensions`." +"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See :ref:" +"`comprehensions`." msgstr "" "一種緊密的方法,用來處理一個可疊代物件中的全部或部分元素,並將處理結果以一個 " "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" @@ -2833,57 +2814,84 @@ msgstr "special method(特殊方法)" msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " -"with double underscores. Special methods are documented " -"in :ref:`specialnames`." +"with double underscores. Special methods are documented in :ref:" +"`specialnames`." msgstr "" "一種會被 Python 自動呼叫的 method,用於對某種型別執行某種運算,例如加法。這" -"種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在" -"\\ :ref:`specialnames`\\ 中有詳細說明。" +"種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" +"`specialnames`\\ 中有詳細說明。" #: ../../glossary.rst:1237 +msgid "standard library" +msgstr "" + +#: ../../glossary.rst:1239 +msgid "" +"The collection of :term:`packages `, :term:`modules ` and :" +"term:`extension modules ` distributed as a part of the " +"official Python interpreter package. The exact membership of the collection " +"may vary based on platform, available system libraries, or other criteria. " +"Documentation can be found at :ref:`library-index`." +msgstr "" + +#: ../../glossary.rst:1245 +msgid "" +"See also :data:`sys.stdlib_module_names` for a list of all possible standard " +"library module names." +msgstr "" + +#: ../../glossary.rst:1247 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1239 +#: ../../glossary.rst:1249 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " -"an :term:`expression` or one of several constructs with a keyword, such " -"as :keyword:`if`, :keyword:`while` or :keyword:`for`." +"an :term:`expression` or one of several constructs with a keyword, such as :" +"keyword:`if`, :keyword:`while` or :keyword:`for`." msgstr "" -"陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一" -"個 :term:`expression`\\ (運算式),或是含有關鍵字(例" -"如 :keyword:`if`、:keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" +"陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一個 :" +"term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" +"`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1242 +#: ../../glossary.rst:1252 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1244 +#: ../../glossary.rst:1254 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " -"such as incorrect types. See also :term:`type hints ` and " -"the :mod:`typing` module." +"such as incorrect types. See also :term:`type hints ` and the :" +"mod:`typing` module." msgstr "" "會讀取 Python 程式碼並分析的外部工具,能夠找出錯誤,像是使用了不正確的型別。" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1247 +#: ../../glossary.rst:1257 +msgid "stdlib" +msgstr "" + +#: ../../glossary.rst:1259 +msgid "An abbreviation of :term:`standard library`." +msgstr "" + +#: ../../glossary.rst:1260 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1262 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " -"calling :c:func:`Py_INCREF` when the reference is created and released " -"with :c:func:`Py_DECREF` when the reference is deleted." +"calling :c:func:`Py_INCREF` when the reference is created and released with :" +"c:func:`Py_DECREF` when the reference is deleted." msgstr "" "在 Python 的 C API 中,強參照是對物件的參照,該物件為持有該參照的程式碼所擁" -"有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透" -"過 :c:func:`Py_DECREF` 釋放強參照。" +"有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" +"func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1255 +#: ../../glossary.rst:1268 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2893,15 +2901,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1260 +#: ../../glossary.rst:1273 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1261 +#: ../../glossary.rst:1274 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1263 +#: ../../glossary.rst:1276 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -2910,7 +2918,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1267 +#: ../../glossary.rst:1280 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2918,7 +2926,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1270 +#: ../../glossary.rst:1283 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2926,56 +2934,54 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1273 +#: ../../glossary.rst:1286 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1275 +#: ../../glossary.rst:1288 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " -"text file actually accesses a byte-oriented datastream and handles " -"the :term:`text encoding` automatically. Examples of text files are files " -"opened in text mode (``'r'`` or " -"``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and instances " -"of :class:`io.StringIO`." +"text file actually accesses a byte-oriented datastream and handles the :term:" +"`text encoding` automatically. Examples of text files are files opened in " +"text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and " +"instances of :class:`io.StringIO`." msgstr "" "一個能夠讀取和寫入 :class:`str` 物件的一個 :term:`file object`\\ (檔案物" "件)。通常,文字檔案實際上是存取位元組導向的資料流 (byte-oriented " "datastream) 並會自動處理 :term:`text encoding`\\ (文字編碼)。文字檔案的例子" -"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔" -"案、:data:`sys.stdin`、:data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" +"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" +"`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1282 +#: ../../glossary.rst:1295 msgid "" -"See also :term:`binary file` for a file object able to read and " -"write :term:`bytes-like objects `." +"See also :term:`binary file` for a file object able to read and write :term:" +"`bytes-like objects `." msgstr "" -"另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入" -"\\ :term:`類位元組串物件 (bytes-like object) ` 的檔案物" -"件。" +"另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" +"term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1284 +#: ../../glossary.rst:1297 msgid "token" msgstr "" -#: ../../glossary.rst:1287 +#: ../../glossary.rst:1300 msgid "" "A small unit of source code, generated by the :ref:`lexical analyzer " "` (also called the *tokenizer*). Names, numbers, strings, " "operators, newlines and similar are represented by tokens." msgstr "" -#: ../../glossary.rst:1292 +#: ../../glossary.rst:1305 msgid "" -"The :mod:`tokenize` module exposes Python's lexical analyzer. " -"The :mod:`token` module contains information on the various types of tokens." +"The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:" +"`token` module contains information on the various types of tokens." msgstr "" -#: ../../glossary.rst:1295 +#: ../../glossary.rst:1308 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1297 +#: ../../glossary.rst:1310 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2990,37 +2996,36 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1304 +#: ../../glossary.rst:1317 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1306 +#: ../../glossary.rst:1319 msgid "" "The type of a Python object determines what kind of object it is; every " -"object has a type. An object's type is accessible as " -"its :attr:`~object.__class__` attribute or can be retrieved with " -"``type(obj)``." +"object has a type. An object's type is accessible as its :attr:`~object." +"__class__` attribute or can be retrieved with ``type(obj)``." msgstr "" "一個 Python 物件的型別決定了它是什麼類型的物件;每個物件都有一個型別。一個物" "件的型別可以用它的 :attr:`~object.__class__` 屬性來存取,或以 ``type(obj)`` " "來檢索。" -#: ../../glossary.rst:1310 +#: ../../glossary.rst:1323 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1312 +#: ../../glossary.rst:1325 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1314 +#: ../../glossary.rst:1327 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1317 +#: ../../glossary.rst:1330 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -3030,11 +3035,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1321 +#: ../../glossary.rst:1334 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1323 +#: ../../glossary.rst:1336 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -3046,15 +3051,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1328 ../../glossary.rst:1342 +#: ../../glossary.rst:1341 ../../glossary.rst:1355 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1329 +#: ../../glossary.rst:1342 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1331 +#: ../../glossary.rst:1344 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -3062,7 +3067,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1334 +#: ../../glossary.rst:1347 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -3072,45 +3077,45 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1338 +#: ../../glossary.rst:1351 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." msgstr "" -"全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使" -"用 :func:`typing.get_type_hints` 來存取。" +"全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" +"`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1343 +#: ../../glossary.rst:1356 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1345 +#: ../../glossary.rst:1358 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " "Windows convention ``'\\r\\n'``, and the old Macintosh convention " -"``'\\r'``. See :pep:`278` and :pep:`3116`, as well " -"as :func:`bytes.splitlines` for an additional use." +"``'\\r'``. See :pep:`278` and :pep:`3116`, as well as :func:`bytes." +"splitlines` for an additional use." msgstr "" "一種解譯文字流 (text stream) 的方式,會將以下所有的情況識別為一行的結束:" "Unix 行尾慣例 ``'\\n'``、Windows 慣例 ``'\\r\\n'`` 和舊的 Macintosh 慣例 " -"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用" -"於 :func:`bytes.splitlines` 的附加用途。" +"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." +"splitlines` 的附加用途。" -#: ../../glossary.rst:1350 +#: ../../glossary.rst:1363 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1352 +#: ../../glossary.rst:1365 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1354 +#: ../../glossary.rst:1367 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1356 +#: ../../glossary.rst:1369 msgid "" "class C:\n" " field: 'annotation'" @@ -3118,7 +3123,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1359 +#: ../../glossary.rst:1372 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -3126,15 +3131,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1363 +#: ../../glossary.rst:1376 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1365 +#: ../../glossary.rst:1378 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1367 +#: ../../glossary.rst:1380 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3143,11 +3148,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1371 +#: ../../glossary.rst:1384 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1373 +#: ../../glossary.rst:1386 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3158,27 +3163,27 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1378 +#: ../../glossary.rst:1391 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1379 +#: ../../glossary.rst:1392 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1381 +#: ../../glossary.rst:1394 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." msgstr "" -"一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行" -"由 :term:`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" +"一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" +"`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1383 +#: ../../glossary.rst:1396 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1385 +#: ../../glossary.rst:1398 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3205,12 +3210,12 @@ msgstr "special" #~ msgid "" #~ "An object which controls the environment seen in a :keyword:`with` " -#~ "statement by defining :meth:`~object.__enter__` " -#~ "and :meth:`~object.__exit__` methods. See :pep:`343`." +#~ "statement by defining :meth:`~object.__enter__` and :meth:`~object." +#~ "__exit__` methods. See :pep:`343`." #~ msgstr "" -#~ "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定" -#~ "義 :meth:`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。" -#~ "請參閱 :pep:`343`。" +#~ "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" +#~ "`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。請參閱 :" +#~ "pep:`343`。" #~ msgid "" #~ "A variable which can have different values depending on its context. This " diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index bb686c54de..d4055b489d 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-07 10:49+0000\n" +"POT-Creation-Date: 2025-07-10 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-" @@ -5368,11 +5368,62 @@ msgid "" "2025-07-02 13:54:47,234 DEBUG can't get fooled again" msgstr "" +#: ../../howto/logging-cookbook.rst:4130 +msgid "" +"If, on the other hand, you are concerned about `log injection `_, you can use a formatter which " +"escapes newlines, as per the following example:" +msgstr "" + #: ../../howto/logging-cookbook.rst:4134 +msgid "" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"class EscapingFormatter(logging.Formatter):\n" +" def format(self, record):\n" +" s = super().format(record)\n" +" return s.replace('\\n', r'\\n')\n" +"\n" +"if __name__ == '__main__':\n" +" h = logging.StreamHandler()\n" +" h.setFormatter(EscapingFormatter('%(asctime)s %(levelname)-9s " +"%(message)s'))\n" +" logging.basicConfig(level=logging.DEBUG, handlers = [h])\n" +" logger.debug('Single line')\n" +" logger.debug('Multiple lines:\\nfool me once ...')\n" +" logger.debug('Another single line')\n" +" logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled " +"again')" +msgstr "" + +#: ../../howto/logging-cookbook.rst:4154 +msgid "" +"You can, of course, use whatever escaping scheme makes the most sense for " +"you. The script, when run, should produce output like this:" +msgstr "" + +#: ../../howto/logging-cookbook.rst:4157 +msgid "" +"2025-07-09 06:47:33,783 DEBUG Single line\n" +"2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me once ...\n" +"2025-07-09 06:47:33,783 DEBUG Another single line\n" +"2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me ...\\ncan't get " +"fooled again" +msgstr "" + +#: ../../howto/logging-cookbook.rst:4164 +msgid "" +"Escaping behaviour can't be the stdlib default , as it would break backwards " +"compatibility." +msgstr "" + +#: ../../howto/logging-cookbook.rst:4170 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:4136 +#: ../../howto/logging-cookbook.rst:4172 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -5380,11 +5431,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:4142 +#: ../../howto/logging-cookbook.rst:4178 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:4144 +#: ../../howto/logging-cookbook.rst:4180 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -5392,32 +5443,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:4149 +#: ../../howto/logging-cookbook.rst:4185 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -#: ../../howto/logging-cookbook.rst:4152 +#: ../../howto/logging-cookbook.rst:4188 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." msgstr "" -#: ../../howto/logging-cookbook.rst:4155 +#: ../../howto/logging-cookbook.rst:4191 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " "module, for example." msgstr "" -#: ../../howto/logging-cookbook.rst:4159 +#: ../../howto/logging-cookbook.rst:4195 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" msgstr "" -#: ../../howto/logging-cookbook.rst:4162 +#: ../../howto/logging-cookbook.rst:4198 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -5426,7 +5477,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:4168 +#: ../../howto/logging-cookbook.rst:4204 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " @@ -5436,17 +5487,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:4175 +#: ../../howto/logging-cookbook.rst:4211 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:4179 +#: ../../howto/logging-cookbook.rst:4215 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:4181 +#: ../../howto/logging-cookbook.rst:4217 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -5457,13 +5508,13 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:4190 +#: ../../howto/logging-cookbook.rst:4226 msgid "" "Adding handlers other than :class:`~logging.NullHandler` to a logger in a " "library" msgstr "" -#: ../../howto/logging-cookbook.rst:4192 +#: ../../howto/logging-cookbook.rst:4228 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -5471,11 +5522,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:4198 +#: ../../howto/logging-cookbook.rst:4234 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:4200 +#: ../../howto/logging-cookbook.rst:4236 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " @@ -5486,38 +5537,38 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:4211 +#: ../../howto/logging-cookbook.rst:4247 msgid "Other resources" msgstr "其他資源" -#: ../../howto/logging-cookbook.rst:4215 +#: ../../howto/logging-cookbook.rst:4251 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:4216 +#: ../../howto/logging-cookbook.rst:4252 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4218 +#: ../../howto/logging-cookbook.rst:4254 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:4219 +#: ../../howto/logging-cookbook.rst:4255 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4221 +#: ../../howto/logging-cookbook.rst:4257 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:4222 +#: ../../howto/logging-cookbook.rst:4258 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4224 +#: ../../howto/logging-cookbook.rst:4260 msgid ":ref:`Basic Tutorial `" msgstr ":ref:`基礎教學 `" -#: ../../howto/logging-cookbook.rst:4226 +#: ../../howto/logging-cookbook.rst:4262 msgid ":ref:`Advanced Tutorial `" msgstr ":ref:`進階教學 `" diff --git a/library/codecs.po b/library/codecs.po index 1c6c9fcef5..5b0752b990 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-01 00:18+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -318,13 +318,30 @@ msgid "" "`iterencode`." msgstr "" -#: ../../library/codecs.rst:264 +#: ../../library/codecs.rst:266 +msgid "" +"Return a :class:`tuple` containing the raw bytes of *buffer*, a :ref:`buffer-" +"compatible object ` or :class:`str` (encoded to UTF-8 before " +"processing), and their length in bytes." +msgstr "" + +#: ../../library/codecs.rst:270 +msgid "The *errors* argument is ignored." +msgstr "" + +#: ../../library/codecs.rst:272 +msgid "" +">>> codecs.readbuffer_encode(b\"Zito\")\n" +"(b'Zito', 4)" +msgstr "" + +#: ../../library/codecs.rst:278 msgid "" "The module also provides the following constants which are useful for " "reading and writing to platform dependent files:" msgstr "" -#: ../../library/codecs.rst:279 +#: ../../library/codecs.rst:293 msgid "" "These constants define various byte sequences, being Unicode byte order " "marks (BOMs) for several encodings. They are used in UTF-16 and UTF-32 data " @@ -336,18 +353,18 @@ msgid "" "represent the BOM in UTF-8 and UTF-32 encodings." msgstr "" -#: ../../library/codecs.rst:293 +#: ../../library/codecs.rst:307 msgid "Codec Base Classes" msgstr "" -#: ../../library/codecs.rst:295 +#: ../../library/codecs.rst:309 msgid "" "The :mod:`codecs` module defines a set of base classes which define the " "interfaces for working with codec objects, and can also be used as the basis " "for custom codec implementations." msgstr "" -#: ../../library/codecs.rst:299 +#: ../../library/codecs.rst:313 msgid "" "Each codec has to define four interfaces to make it usable as codec in " "Python: stateless encoder, stateless decoder, stream reader and stream " @@ -356,69 +373,69 @@ msgid "" "how the codec will handle encoding and decoding errors." msgstr "" -#: ../../library/codecs.rst:310 +#: ../../library/codecs.rst:324 msgid "Error Handlers" msgstr "" -#: ../../library/codecs.rst:312 +#: ../../library/codecs.rst:326 msgid "" "To simplify and standardize error handling, codecs may implement different " "error handling schemes by accepting the *errors* string argument:" msgstr "" -#: ../../library/codecs.rst:332 +#: ../../library/codecs.rst:346 msgid "" "The following error handlers can be used with all Python :ref:`standard-" "encodings` codecs:" msgstr "" -#: ../../library/codecs.rst:338 ../../library/codecs.rst:381 -#: ../../library/codecs.rst:401 +#: ../../library/codecs.rst:352 ../../library/codecs.rst:395 +#: ../../library/codecs.rst:415 msgid "Value" msgstr "" -#: ../../library/codecs.rst:338 ../../library/codecs.rst:381 -#: ../../library/codecs.rst:401 ../../library/codecs.rst:1339 -#: ../../library/codecs.rst:1407 ../../library/codecs.rst:1462 +#: ../../library/codecs.rst:352 ../../library/codecs.rst:395 +#: ../../library/codecs.rst:415 ../../library/codecs.rst:1353 +#: ../../library/codecs.rst:1421 ../../library/codecs.rst:1476 msgid "Meaning" msgstr "含義" -#: ../../library/codecs.rst:340 +#: ../../library/codecs.rst:354 msgid "``'strict'``" msgstr "``'strict'``" -#: ../../library/codecs.rst:340 +#: ../../library/codecs.rst:354 msgid "" "Raise :exc:`UnicodeError` (or a subclass), this is the default. Implemented " "in :func:`strict_errors`." msgstr "" -#: ../../library/codecs.rst:344 +#: ../../library/codecs.rst:358 msgid "``'ignore'``" msgstr "``'ignore'``" -#: ../../library/codecs.rst:344 +#: ../../library/codecs.rst:358 msgid "" "Ignore the malformed data and continue without further notice. Implemented " "in :func:`ignore_errors`." msgstr "" -#: ../../library/codecs.rst:348 +#: ../../library/codecs.rst:362 msgid "``'replace'``" msgstr "``'replace'``" -#: ../../library/codecs.rst:348 +#: ../../library/codecs.rst:362 msgid "" "Replace with a replacement marker. On encoding, use ``?`` (ASCII character). " "On decoding, use ``�`` (U+FFFD, the official REPLACEMENT CHARACTER). " "Implemented in :func:`replace_errors`." msgstr "" -#: ../../library/codecs.rst:354 +#: ../../library/codecs.rst:368 msgid "``'backslashreplace'``" msgstr "``'backslashreplace'``" -#: ../../library/codecs.rst:354 +#: ../../library/codecs.rst:368 msgid "" "Replace with backslashed escape sequences. On encoding, use hexadecimal form " "of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :" @@ -426,11 +443,11 @@ msgid "" "format :samp:`\\\\x{hh}`. Implemented in :func:`backslashreplace_errors`." msgstr "" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:377 msgid "``'surrogateescape'``" msgstr "``'surrogateescape'``" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:377 msgid "" "On decoding, replace byte with individual surrogate code ranging from " "``U+DC80`` to ``U+DCFF``. This code will then be turned back into the same " @@ -438,92 +455,92 @@ msgid "" "data. (See :pep:`383` for more.)" msgstr "" -#: ../../library/codecs.rst:377 +#: ../../library/codecs.rst:391 msgid "" "The following error handlers are only applicable to encoding (within :term:" "`text encodings `):" msgstr "" -#: ../../library/codecs.rst:383 +#: ../../library/codecs.rst:397 msgid "``'xmlcharrefreplace'``" msgstr "``'xmlcharrefreplace'``" -#: ../../library/codecs.rst:383 +#: ../../library/codecs.rst:397 msgid "" "Replace with XML/HTML numeric character reference, which is a decimal form " "of Unicode code point with format :samp:`&#{num};`. Implemented in :func:" "`xmlcharrefreplace_errors`." msgstr "" -#: ../../library/codecs.rst:389 +#: ../../library/codecs.rst:403 msgid "``'namereplace'``" msgstr "``'namereplace'``" -#: ../../library/codecs.rst:389 +#: ../../library/codecs.rst:403 msgid "" "Replace with ``\\N{...}`` escape sequences, what appears in the braces is " "the Name property from Unicode Character Database. Implemented in :func:" "`namereplace_errors`." msgstr "" -#: ../../library/codecs.rst:398 +#: ../../library/codecs.rst:412 msgid "" "In addition, the following error handler is specific to the given codecs:" msgstr "" -#: ../../library/codecs.rst:13 ../../library/codecs.rst:401 +#: ../../library/codecs.rst:13 ../../library/codecs.rst:415 msgid "Codecs" msgstr "" -#: ../../library/codecs.rst:403 +#: ../../library/codecs.rst:417 msgid "``'surrogatepass'``" msgstr "``'surrogatepass'``" -#: ../../library/codecs.rst:403 +#: ../../library/codecs.rst:417 msgid "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" msgstr "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" -#: ../../library/codecs.rst:403 +#: ../../library/codecs.rst:417 msgid "" "Allow encoding and decoding surrogate code point (``U+D800`` - ``U+DFFF``) " "as normal code point. Otherwise these codecs treat the presence of surrogate " "code point in :class:`str` as an error." msgstr "" -#: ../../library/codecs.rst:410 +#: ../../library/codecs.rst:424 msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." msgstr "" -#: ../../library/codecs.rst:413 +#: ../../library/codecs.rst:427 msgid "" "The ``'surrogatepass'`` error handler now works with utf-16\\* and utf-32\\* " "codecs." msgstr "" -#: ../../library/codecs.rst:417 +#: ../../library/codecs.rst:431 msgid "The ``'namereplace'`` error handler." msgstr "" -#: ../../library/codecs.rst:420 +#: ../../library/codecs.rst:434 msgid "" "The ``'backslashreplace'`` error handler now works with decoding and " "translating." msgstr "" -#: ../../library/codecs.rst:424 +#: ../../library/codecs.rst:438 msgid "" "The set of allowed values can be extended by registering a new named error " "handler:" msgstr "" -#: ../../library/codecs.rst:429 +#: ../../library/codecs.rst:443 msgid "" "Register the error handling function *error_handler* under the name *name*. " "The *error_handler* argument will be called during encoding and decoding in " "case of an error, when *name* is specified as the errors parameter." msgstr "" -#: ../../library/codecs.rst:433 +#: ../../library/codecs.rst:447 msgid "" "For encoding, *error_handler* will be called with a :exc:" "`UnicodeEncodeError` instance, which contains information about the location " @@ -538,66 +555,66 @@ msgid "" "position is out of bound an :exc:`IndexError` will be raised." msgstr "" -#: ../../library/codecs.rst:445 +#: ../../library/codecs.rst:459 msgid "" "Decoding and translating works similarly, except :exc:`UnicodeDecodeError` " "or :exc:`UnicodeTranslateError` will be passed to the handler and that the " "replacement from the error handler will be put into the output directly." msgstr "" -#: ../../library/codecs.rst:450 +#: ../../library/codecs.rst:464 msgid "" "Previously registered error handlers (including the standard error handlers) " "can be looked up by name:" msgstr "" -#: ../../library/codecs.rst:455 +#: ../../library/codecs.rst:469 msgid "Return the error handler previously registered under the name *name*." msgstr "" -#: ../../library/codecs.rst:457 +#: ../../library/codecs.rst:471 msgid "Raises a :exc:`LookupError` in case the handler cannot be found." msgstr "" -#: ../../library/codecs.rst:459 +#: ../../library/codecs.rst:473 msgid "" "The following standard error handlers are also made available as module " "level functions:" msgstr "" -#: ../../library/codecs.rst:464 +#: ../../library/codecs.rst:478 msgid "Implements the ``'strict'`` error handling." msgstr "" -#: ../../library/codecs.rst:466 +#: ../../library/codecs.rst:480 msgid "Each encoding or decoding error raises a :exc:`UnicodeError`." msgstr "" -#: ../../library/codecs.rst:471 +#: ../../library/codecs.rst:485 msgid "Implements the ``'ignore'`` error handling." msgstr "" -#: ../../library/codecs.rst:473 +#: ../../library/codecs.rst:487 msgid "" "Malformed data is ignored; encoding or decoding is continued without further " "notice." msgstr "" -#: ../../library/codecs.rst:479 +#: ../../library/codecs.rst:493 msgid "Implements the ``'replace'`` error handling." msgstr "" -#: ../../library/codecs.rst:481 +#: ../../library/codecs.rst:495 msgid "" "Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, " "the official REPLACEMENT CHARACTER) for decoding errors." msgstr "" -#: ../../library/codecs.rst:487 +#: ../../library/codecs.rst:501 msgid "Implements the ``'backslashreplace'`` error handling." msgstr "" -#: ../../library/codecs.rst:489 +#: ../../library/codecs.rst:503 msgid "" "Malformed data is replaced by a backslashed escape sequence. On encoding, " "use the hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}" @@ -605,30 +622,30 @@ msgid "" "hexadecimal form of byte value with format :samp:`\\\\x{hh}`." msgstr "" -#: ../../library/codecs.rst:495 +#: ../../library/codecs.rst:509 msgid "Works with decoding and translating." msgstr "" -#: ../../library/codecs.rst:501 +#: ../../library/codecs.rst:515 msgid "" "Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :" "term:`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:504 +#: ../../library/codecs.rst:518 msgid "" "The unencodable character is replaced by an appropriate XML/HTML numeric " "character reference, which is a decimal form of Unicode code point with " "format :samp:`&#{num};` ." msgstr "" -#: ../../library/codecs.rst:511 +#: ../../library/codecs.rst:525 msgid "" "Implements the ``'namereplace'`` error handling (for encoding within :term:" "`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:514 +#: ../../library/codecs.rst:528 msgid "" "The unencodable character is replaced by a ``\\N{...}`` escape sequence. The " "set of characters that appear in the braces is the Name property from " @@ -636,17 +653,17 @@ msgid "" "will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}`` ." msgstr "" -#: ../../library/codecs.rst:525 +#: ../../library/codecs.rst:539 msgid "Stateless Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:527 +#: ../../library/codecs.rst:541 msgid "" "The base :class:`Codec` class defines these methods which also define the " "function interfaces of the stateless encoder and decoder:" msgstr "" -#: ../../library/codecs.rst:535 +#: ../../library/codecs.rst:549 msgid "" "Encodes the object *input* and returns a tuple (output object, length " "consumed). For instance, :term:`text encoding` converts a string object to a " @@ -654,26 +671,26 @@ msgid "" "``iso-8859-1``)." msgstr "" -#: ../../library/codecs.rst:540 ../../library/codecs.rst:562 +#: ../../library/codecs.rst:554 ../../library/codecs.rst:576 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." msgstr "" -#: ../../library/codecs.rst:543 +#: ../../library/codecs.rst:557 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamWriter` for codecs which have to keep state in order to make encoding " "efficient." msgstr "" -#: ../../library/codecs.rst:547 +#: ../../library/codecs.rst:561 msgid "" "The encoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:553 +#: ../../library/codecs.rst:567 msgid "" "Decodes the object *input* and returns a tuple (output object, length " "consumed). For instance, for a :term:`text encoding`, decoding converts a " @@ -681,31 +698,31 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:558 +#: ../../library/codecs.rst:572 msgid "" "For text encodings and bytes-to-bytes codecs, *input* must be a bytes object " "or one which provides the read-only buffer interface -- for example, buffer " "objects and memory mapped files." msgstr "" -#: ../../library/codecs.rst:565 +#: ../../library/codecs.rst:579 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamReader` for codecs which have to keep state in order to make decoding " "efficient." msgstr "" -#: ../../library/codecs.rst:569 +#: ../../library/codecs.rst:583 msgid "" "The decoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:574 +#: ../../library/codecs.rst:588 msgid "Incremental Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:576 +#: ../../library/codecs.rst:590 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -716,7 +733,7 @@ msgid "" "during method calls." msgstr "" -#: ../../library/codecs.rst:584 +#: ../../library/codecs.rst:598 msgid "" "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" "`~IncrementalDecoder.decode` method is the same as if all the single inputs " @@ -724,36 +741,36 @@ msgid "" "encoder/decoder." msgstr "" -#: ../../library/codecs.rst:593 +#: ../../library/codecs.rst:607 msgid "IncrementalEncoder Objects" msgstr "IncrementalEncoder 物件" -#: ../../library/codecs.rst:595 +#: ../../library/codecs.rst:609 msgid "" "The :class:`IncrementalEncoder` class is used for encoding an input in " "multiple steps. It defines the following methods which every incremental " "encoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:602 +#: ../../library/codecs.rst:616 msgid "Constructor for an :class:`IncrementalEncoder` instance." msgstr "" -#: ../../library/codecs.rst:604 +#: ../../library/codecs.rst:618 msgid "" "All incremental encoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:608 +#: ../../library/codecs.rst:622 msgid "" "The :class:`IncrementalEncoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:612 +#: ../../library/codecs.rst:626 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -761,21 +778,21 @@ msgid "" "`IncrementalEncoder` object." msgstr "" -#: ../../library/codecs.rst:620 +#: ../../library/codecs.rst:634 msgid "" "Encodes *object* (taking the current state of the encoder into account) and " "returns the resulting encoded object. If this is the last call to :meth:" "`encode` *final* must be true (the default is false)." msgstr "" -#: ../../library/codecs.rst:627 +#: ../../library/codecs.rst:641 msgid "" "Reset the encoder to the initial state. The output is discarded: call ``." "encode(object, final=True)``, passing an empty byte or text string if " "necessary, to reset the encoder and to get the output." msgstr "" -#: ../../library/codecs.rst:634 +#: ../../library/codecs.rst:648 msgid "" "Return the current state of the encoder which must be an integer. The " "implementation should make sure that ``0`` is the most common state. (States " @@ -784,42 +801,42 @@ msgid "" "into an integer.)" msgstr "" -#: ../../library/codecs.rst:643 +#: ../../library/codecs.rst:657 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:650 +#: ../../library/codecs.rst:664 msgid "IncrementalDecoder Objects" msgstr "IncrementalDecoder 物件" -#: ../../library/codecs.rst:652 +#: ../../library/codecs.rst:666 msgid "" "The :class:`IncrementalDecoder` class is used for decoding an input in " "multiple steps. It defines the following methods which every incremental " "decoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:659 +#: ../../library/codecs.rst:673 msgid "Constructor for an :class:`IncrementalDecoder` instance." msgstr "" -#: ../../library/codecs.rst:661 +#: ../../library/codecs.rst:675 msgid "" "All incremental decoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:665 +#: ../../library/codecs.rst:679 msgid "" "The :class:`IncrementalDecoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:669 +#: ../../library/codecs.rst:683 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -827,7 +844,7 @@ msgid "" "`IncrementalDecoder` object." msgstr "" -#: ../../library/codecs.rst:677 +#: ../../library/codecs.rst:691 msgid "" "Decodes *object* (taking the current state of the decoder into account) and " "returns the resulting decoded object. If this is the last call to :meth:" @@ -838,11 +855,11 @@ msgid "" "(which might raise an exception)." msgstr "" -#: ../../library/codecs.rst:688 +#: ../../library/codecs.rst:702 msgid "Reset the decoder to the initial state." msgstr "" -#: ../../library/codecs.rst:693 +#: ../../library/codecs.rst:707 msgid "" "Return the current state of the decoder. This must be a tuple with two " "items, the first must be the buffer containing the still undecoded input. " @@ -857,59 +874,59 @@ msgid "" "bytes of the resulting string into an integer.)" msgstr "" -#: ../../library/codecs.rst:708 +#: ../../library/codecs.rst:722 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:713 +#: ../../library/codecs.rst:727 msgid "Stream Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:716 +#: ../../library/codecs.rst:730 msgid "" "The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " "working interfaces which can be used to implement new encoding submodules " "very easily. See :mod:`!encodings.utf_8` for an example of how this is done." msgstr "" -#: ../../library/codecs.rst:724 +#: ../../library/codecs.rst:738 msgid "StreamWriter Objects" msgstr "StreamWriter 物件" -#: ../../library/codecs.rst:726 +#: ../../library/codecs.rst:740 msgid "" "The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines " "the following methods which every stream writer must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:733 +#: ../../library/codecs.rst:747 msgid "Constructor for a :class:`StreamWriter` instance." msgstr "" -#: ../../library/codecs.rst:735 +#: ../../library/codecs.rst:749 msgid "" "All stream writers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:739 +#: ../../library/codecs.rst:753 msgid "" "The *stream* argument must be a file-like object open for writing text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:742 +#: ../../library/codecs.rst:756 msgid "" "The :class:`StreamWriter` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:746 +#: ../../library/codecs.rst:760 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -917,70 +934,70 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:752 +#: ../../library/codecs.rst:766 msgid "Writes the object's contents encoded to the stream." msgstr "" -#: ../../library/codecs.rst:757 +#: ../../library/codecs.rst:771 msgid "" "Writes the concatenated iterable of strings to the stream (possibly by " "reusing the :meth:`write` method). Infinite or very large iterables are not " "supported. The standard bytes-to-bytes codecs do not support this method." msgstr "" -#: ../../library/codecs.rst:765 ../../library/codecs.rst:860 +#: ../../library/codecs.rst:779 ../../library/codecs.rst:874 msgid "Resets the codec buffers used for keeping internal state." msgstr "" -#: ../../library/codecs.rst:767 +#: ../../library/codecs.rst:781 msgid "" "Calling this method should ensure that the data on the output is put into a " "clean state that allows appending of new fresh data without having to rescan " "the whole stream to recover state." msgstr "" -#: ../../library/codecs.rst:772 +#: ../../library/codecs.rst:786 msgid "" "In addition to the above methods, the :class:`StreamWriter` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:779 +#: ../../library/codecs.rst:793 msgid "StreamReader Objects" msgstr "StreamReader 物件" -#: ../../library/codecs.rst:781 +#: ../../library/codecs.rst:795 msgid "" "The :class:`StreamReader` class is a subclass of :class:`Codec` and defines " "the following methods which every stream reader must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:788 +#: ../../library/codecs.rst:802 msgid "Constructor for a :class:`StreamReader` instance." msgstr "" -#: ../../library/codecs.rst:790 +#: ../../library/codecs.rst:804 msgid "" "All stream readers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:794 +#: ../../library/codecs.rst:808 msgid "" "The *stream* argument must be a file-like object open for reading text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:797 +#: ../../library/codecs.rst:811 msgid "" "The :class:`StreamReader` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:801 +#: ../../library/codecs.rst:815 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -988,24 +1005,24 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:805 +#: ../../library/codecs.rst:819 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" -#: ../../library/codecs.rst:811 +#: ../../library/codecs.rst:825 msgid "Decodes data from the stream and returns the resulting object." msgstr "" -#: ../../library/codecs.rst:813 +#: ../../library/codecs.rst:827 msgid "" "The *chars* argument indicates the number of decoded code points or bytes to " "return. The :func:`read` method will never return more data than requested, " "but it might return less, if there is not enough available." msgstr "" -#: ../../library/codecs.rst:818 +#: ../../library/codecs.rst:832 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -1014,13 +1031,13 @@ msgid "" "huge files in one step." msgstr "" -#: ../../library/codecs.rst:825 +#: ../../library/codecs.rst:839 msgid "" "The *firstline* flag indicates that it would be sufficient to only return " "the first line, if there are decoding errors on later lines." msgstr "" -#: ../../library/codecs.rst:829 +#: ../../library/codecs.rst:843 msgid "" "The method should use a greedy read strategy meaning that it should read as " "much data as is allowed within the definition of the encoding and the given " @@ -1028,68 +1045,68 @@ msgid "" "the stream, these should be read too." msgstr "" -#: ../../library/codecs.rst:837 +#: ../../library/codecs.rst:851 msgid "Read one line from the input stream and return the decoded data." msgstr "" -#: ../../library/codecs.rst:839 +#: ../../library/codecs.rst:853 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." msgstr "" -#: ../../library/codecs.rst:842 +#: ../../library/codecs.rst:856 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "" -#: ../../library/codecs.rst:848 +#: ../../library/codecs.rst:862 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "" -#: ../../library/codecs.rst:851 +#: ../../library/codecs.rst:865 msgid "" "Line-endings are implemented using the codec's :meth:`decode` method and are " "included in the list entries if *keepends* is true." msgstr "" -#: ../../library/codecs.rst:854 +#: ../../library/codecs.rst:868 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." msgstr "" -#: ../../library/codecs.rst:862 +#: ../../library/codecs.rst:876 msgid "" "Note that no stream repositioning should take place. This method is " "primarily intended to be able to recover from decoding errors." msgstr "" -#: ../../library/codecs.rst:866 +#: ../../library/codecs.rst:880 msgid "" "In addition to the above methods, the :class:`StreamReader` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:872 +#: ../../library/codecs.rst:886 msgid "StreamReaderWriter Objects" msgstr "StreamReaderWriter 物件" -#: ../../library/codecs.rst:874 +#: ../../library/codecs.rst:888 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." msgstr "" -#: ../../library/codecs.rst:877 ../../library/codecs.rst:901 +#: ../../library/codecs.rst:891 ../../library/codecs.rst:915 msgid "" "The design is such that one can use the factory functions returned by the :" "func:`lookup` function to construct the instance." msgstr "" -#: ../../library/codecs.rst:883 +#: ../../library/codecs.rst:897 msgid "" "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " "object. *Reader* and *Writer* must be factory functions or classes providing " @@ -1098,24 +1115,24 @@ msgid "" "writers." msgstr "" -#: ../../library/codecs.rst:888 +#: ../../library/codecs.rst:902 msgid "" ":class:`StreamReaderWriter` instances define the combined interfaces of :" "class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " "other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:896 +#: ../../library/codecs.rst:910 msgid "StreamRecoder Objects" msgstr "StreamRecoder 物件" -#: ../../library/codecs.rst:898 +#: ../../library/codecs.rst:912 msgid "" "The :class:`StreamRecoder` translates data from one encoding to another, " "which is sometimes useful when dealing with different encoding environments." msgstr "" -#: ../../library/codecs.rst:907 +#: ../../library/codecs.rst:921 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " "conversion: *encode* and *decode* work on the frontend — the data visible to " @@ -1123,17 +1140,17 @@ msgid "" "while *Reader* and *Writer* work on the backend — the data in *stream*." msgstr "" -#: ../../library/codecs.rst:913 +#: ../../library/codecs.rst:927 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." msgstr "" -#: ../../library/codecs.rst:916 +#: ../../library/codecs.rst:930 msgid "The *stream* argument must be a file-like object." msgstr "" -#: ../../library/codecs.rst:918 +#: ../../library/codecs.rst:932 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1141,24 +1158,24 @@ msgid "" "interface respectively." msgstr "" -#: ../../library/codecs.rst:923 +#: ../../library/codecs.rst:937 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." msgstr "" -#: ../../library/codecs.rst:927 +#: ../../library/codecs.rst:941 msgid "" ":class:`StreamRecoder` instances define the combined interfaces of :class:" "`StreamReader` and :class:`StreamWriter` classes. They inherit all other " "methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:935 +#: ../../library/codecs.rst:949 msgid "Encodings and Unicode" msgstr "" -#: ../../library/codecs.rst:937 +#: ../../library/codecs.rst:951 msgid "" "Strings are stored internally as sequences of code points in range " "``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " @@ -1170,7 +1187,7 @@ msgid "" "which are collectivity referred to as :term:`text encodings `." msgstr "" -#: ../../library/codecs.rst:947 +#: ../../library/codecs.rst:961 msgid "" "The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " "the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " @@ -1181,7 +1198,7 @@ msgid "" "position 3: ordinal not in range(256)``." msgstr "" -#: ../../library/codecs.rst:955 +#: ../../library/codecs.rst:969 msgid "" "There's another group of encodings (the so called charmap encodings) that " "choose a different subset of all Unicode code points and how these code " @@ -1191,7 +1208,7 @@ msgid "" "that shows you which character is mapped to which byte value." msgstr "" -#: ../../library/codecs.rst:962 +#: ../../library/codecs.rst:976 msgid "" "All of these encodings can only encode 256 of the 1114112 code points " "defined in Unicode. A simple and straightforward way that can store each " @@ -1221,7 +1238,7 @@ msgid "" "normal character that will be decoded like any other." msgstr "" -#: ../../library/codecs.rst:988 +#: ../../library/codecs.rst:1002 msgid "" "There's another encoding that is able to encode the full range of Unicode " "characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " @@ -1232,59 +1249,59 @@ msgid "" "which when concatenated give the Unicode character):" msgstr "" -#: ../../library/codecs.rst:997 +#: ../../library/codecs.rst:1011 msgid "Range" msgstr "" -#: ../../library/codecs.rst:997 +#: ../../library/codecs.rst:1011 msgid "Encoding" msgstr "" -#: ../../library/codecs.rst:999 +#: ../../library/codecs.rst:1013 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "``U-00000000`` ... ``U-0000007F``" -#: ../../library/codecs.rst:999 +#: ../../library/codecs.rst:1013 msgid "0xxxxxxx" msgstr "0xxxxxxx" -#: ../../library/codecs.rst:1001 +#: ../../library/codecs.rst:1015 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "``U-00000080`` ... ``U-000007FF``" -#: ../../library/codecs.rst:1001 +#: ../../library/codecs.rst:1015 msgid "110xxxxx 10xxxxxx" msgstr "110xxxxx 10xxxxxx" -#: ../../library/codecs.rst:1003 +#: ../../library/codecs.rst:1017 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "``U-00000800`` ... ``U-0000FFFF``" -#: ../../library/codecs.rst:1003 +#: ../../library/codecs.rst:1017 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "1110xxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:1005 +#: ../../library/codecs.rst:1019 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "``U-00010000`` ... ``U-0010FFFF``" -#: ../../library/codecs.rst:1005 +#: ../../library/codecs.rst:1019 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:1008 +#: ../../library/codecs.rst:1022 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "" -#: ../../library/codecs.rst:1010 +#: ../../library/codecs.rst:1024 msgid "" "As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` " "character in the decoded string (even if it's the first character) is " "treated as a ``ZERO WIDTH NO-BREAK SPACE``." msgstr "" -#: ../../library/codecs.rst:1014 +#: ../../library/codecs.rst:1028 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " @@ -1310,7 +1327,7 @@ msgstr "" msgid "INVERTED QUESTION MARK" msgstr "" -#: ../../library/codecs.rst:1030 +#: ../../library/codecs.rst:1044 msgid "" "in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding " "can be correctly guessed from the byte sequence. So here the BOM is not used " @@ -1322,11 +1339,11 @@ msgid "" "the use of the BOM is discouraged and should generally be avoided." msgstr "" -#: ../../library/codecs.rst:1043 +#: ../../library/codecs.rst:1057 msgid "Standard Encodings" msgstr "" -#: ../../library/codecs.rst:1045 +#: ../../library/codecs.rst:1059 msgid "" "Python comes with a number of codecs built-in, either implemented as C " "functions or with dictionaries as mapping tables. The following table lists " @@ -1338,7 +1355,7 @@ msgid "" "alias for the ``'utf_8'`` codec." msgstr "" -#: ../../library/codecs.rst:1055 +#: ../../library/codecs.rst:1069 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1348,11 +1365,11 @@ msgid "" "Using alternative aliases for these encodings may result in slower execution." msgstr "" -#: ../../library/codecs.rst:1063 +#: ../../library/codecs.rst:1077 msgid "Optimization opportunity recognized for us-ascii." msgstr "" -#: ../../library/codecs.rst:1066 +#: ../../library/codecs.rst:1080 msgid "" "Many of the character sets support the same languages. They vary in " "individual characters (e.g. whether the EURO SIGN is supported or not), and " @@ -1360,504 +1377,504 @@ msgid "" "languages in particular, the following variants typically exist:" msgstr "" -#: ../../library/codecs.rst:1071 +#: ../../library/codecs.rst:1085 msgid "an ISO 8859 codeset" msgstr "" -#: ../../library/codecs.rst:1073 +#: ../../library/codecs.rst:1087 msgid "" "a Microsoft Windows code page, which is typically derived from an 8859 " "codeset, but replaces control characters with additional graphic characters" msgstr "" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1090 msgid "an IBM EBCDIC code page" msgstr "" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1092 msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: ../../library/codecs.rst:1083 ../../library/codecs.rst:1339 -#: ../../library/codecs.rst:1407 ../../library/codecs.rst:1462 +#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1353 +#: ../../library/codecs.rst:1421 ../../library/codecs.rst:1476 msgid "Codec" msgstr "" -#: ../../library/codecs.rst:1083 ../../library/codecs.rst:1339 -#: ../../library/codecs.rst:1407 ../../library/codecs.rst:1462 +#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1353 +#: ../../library/codecs.rst:1421 ../../library/codecs.rst:1476 msgid "Aliases" msgstr "" -#: ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1097 msgid "Languages" msgstr "語言" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1099 msgid "ascii" msgstr "ascii" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1099 msgid "646, us-ascii" msgstr "646, us-ascii" -#: ../../library/codecs.rst:1085 ../../library/codecs.rst:1091 -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1099 ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1113 msgid "English" msgstr "英文" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1101 msgid "big5" msgstr "big5" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1101 msgid "big5-tw, csbig5" msgstr "big5-tw, csbig5" -#: ../../library/codecs.rst:1087 ../../library/codecs.rst:1089 -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1162 msgid "Traditional Chinese" msgstr "繁體中文" -#: ../../library/codecs.rst:1089 +#: ../../library/codecs.rst:1103 msgid "big5hkscs" msgstr "big5hkscs" -#: ../../library/codecs.rst:1089 +#: ../../library/codecs.rst:1103 msgid "big5-hkscs, hkscs" msgstr "big5-hkscs, hkscs" -#: ../../library/codecs.rst:1091 +#: ../../library/codecs.rst:1105 msgid "cp037" msgstr "cp037" -#: ../../library/codecs.rst:1091 +#: ../../library/codecs.rst:1105 msgid "IBM037, IBM039" msgstr "IBM037, IBM039" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1107 msgid "cp273" msgstr "cp273" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1107 msgid "273, IBM273, csIBM273" msgstr "273, IBM273, csIBM273" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1107 msgid "German" msgstr "德文" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1111 msgid "cp424" msgstr "cp424" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1111 msgid "EBCDIC-CP-HE, IBM424" msgstr "EBCDIC-CP-HE, IBM424" -#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1117 -#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1171 -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1111 ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1141 ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1248 msgid "Hebrew" msgstr "希伯來文" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1113 msgid "cp437" msgstr "cp437" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1113 msgid "437, IBM437" msgstr "437, IBM437" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1115 msgid "cp500" msgstr "cp500" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1115 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1110 -#: ../../library/codecs.rst:1121 ../../library/codecs.rst:1158 -#: ../../library/codecs.rst:1165 ../../library/codecs.rst:1218 -#: ../../library/codecs.rst:1246 ../../library/codecs.rst:1274 +#: ../../library/codecs.rst:1115 ../../library/codecs.rst:1124 +#: ../../library/codecs.rst:1135 ../../library/codecs.rst:1172 +#: ../../library/codecs.rst:1179 ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1260 ../../library/codecs.rst:1288 msgid "Western Europe" msgstr "" -#: ../../library/codecs.rst:1104 +#: ../../library/codecs.rst:1118 msgid "cp720" msgstr "cp720" -#: ../../library/codecs.rst:1104 ../../library/codecs.rst:1131 -#: ../../library/codecs.rst:1173 ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1118 ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1187 ../../library/codecs.rst:1244 msgid "Arabic" msgstr "阿拉伯文" -#: ../../library/codecs.rst:1106 +#: ../../library/codecs.rst:1120 msgid "cp737" msgstr "cp737" -#: ../../library/codecs.rst:1106 ../../library/codecs.rst:1137 -#: ../../library/codecs.rst:1141 ../../library/codecs.rst:1167 -#: ../../library/codecs.rst:1232 ../../library/codecs.rst:1267 +#: ../../library/codecs.rst:1120 ../../library/codecs.rst:1151 +#: ../../library/codecs.rst:1155 ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1246 ../../library/codecs.rst:1281 msgid "Greek" msgstr "希臘文" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1122 msgid "cp775" msgstr "cp775" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1122 msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1108 ../../library/codecs.rst:1175 -#: ../../library/codecs.rst:1225 ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1122 ../../library/codecs.rst:1189 +#: ../../library/codecs.rst:1239 ../../library/codecs.rst:1256 msgid "Baltic languages" msgstr "" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1124 msgid "cp850" msgstr "cp850" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1124 msgid "850, IBM850" msgstr "850, IBM850" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1126 msgid "cp852" msgstr "cp852" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1126 msgid "852, IBM852" msgstr "852, IBM852" -#: ../../library/codecs.rst:1112 ../../library/codecs.rst:1160 -#: ../../library/codecs.rst:1221 ../../library/codecs.rst:1271 +#: ../../library/codecs.rst:1126 ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1235 ../../library/codecs.rst:1285 msgid "Central and Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1128 msgid "cp855" msgstr "cp855" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1128 msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1114 ../../library/codecs.rst:1162 -#: ../../library/codecs.rst:1227 ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1128 ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1241 ../../library/codecs.rst:1278 msgid "Belarusian, Bulgarian, Macedonian, Russian, Serbian" msgstr "" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1131 msgid "cp856" msgstr "cp856" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1133 msgid "cp857" msgstr "cp857" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1133 msgid "857, IBM857" msgstr "857, IBM857" -#: ../../library/codecs.rst:1119 ../../library/codecs.rst:1152 -#: ../../library/codecs.rst:1169 ../../library/codecs.rst:1236 -#: ../../library/codecs.rst:1276 +#: ../../library/codecs.rst:1133 ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1183 ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1290 msgid "Turkish" msgstr "土耳其文" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1135 msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1135 msgid "858, IBM858" msgstr "858, IBM858" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1137 msgid "cp860" msgstr "cp860" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1137 msgid "860, IBM860" msgstr "860, IBM860" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1137 msgid "Portuguese" msgstr "" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1139 msgid "cp861" msgstr "cp861" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1139 msgid "861, CP-IS, IBM861" msgstr "861, CP-IS, IBM861" -#: ../../library/codecs.rst:1125 ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1139 ../../library/codecs.rst:1283 msgid "Icelandic" msgstr "" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1141 msgid "cp862" msgstr "cp862" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1141 msgid "862, IBM862" msgstr "862, IBM862" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1143 msgid "cp863" msgstr "cp863" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1143 msgid "863, IBM863" msgstr "863, IBM863" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1143 msgid "Canadian" msgstr "" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1145 msgid "cp864" msgstr "cp864" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1145 msgid "IBM864" msgstr "IBM864" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1147 msgid "cp865" msgstr "cp865" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1147 msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1147 msgid "Danish, Norwegian" msgstr "" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1149 msgid "cp866" msgstr "cp866" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1149 msgid "866, IBM866" msgstr "866, IBM866" -#: ../../library/codecs.rst:1135 ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1149 ../../library/codecs.rst:1266 msgid "Russian" msgstr "俄羅斯文" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1151 msgid "cp869" msgstr "cp869" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1151 msgid "869, CP-GR, IBM869" msgstr "869, CP-GR, IBM869" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1153 msgid "cp874" msgstr "cp874" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1153 msgid "Thai" msgstr "泰文" -#: ../../library/codecs.rst:1141 +#: ../../library/codecs.rst:1155 msgid "cp875" msgstr "cp875" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1157 msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1157 msgid "932, ms932, mskanji, ms-kanji, windows-31j" msgstr "932, ms932, mskanji, ms-kanji, windows-31j" -#: ../../library/codecs.rst:1143 ../../library/codecs.rst:1179 -#: ../../library/codecs.rst:1181 ../../library/codecs.rst:1183 -#: ../../library/codecs.rst:1200 ../../library/codecs.rst:1203 -#: ../../library/codecs.rst:1208 ../../library/codecs.rst:1211 -#: ../../library/codecs.rst:1213 ../../library/codecs.rst:1281 -#: ../../library/codecs.rst:1284 ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1157 ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1195 ../../library/codecs.rst:1197 +#: ../../library/codecs.rst:1214 ../../library/codecs.rst:1217 +#: ../../library/codecs.rst:1222 ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1227 ../../library/codecs.rst:1295 +#: ../../library/codecs.rst:1298 ../../library/codecs.rst:1301 msgid "Japanese" msgstr "日文" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1160 msgid "cp949" msgstr "cp949" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1160 msgid "949, ms949, uhc" msgstr "949, ms949, uhc" -#: ../../library/codecs.rst:1146 ../../library/codecs.rst:1185 -#: ../../library/codecs.rst:1215 ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1160 ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1229 ../../library/codecs.rst:1264 msgid "Korean" msgstr "韓文" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1162 msgid "cp950" msgstr "cp950" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1162 msgid "950, ms950" msgstr "950, ms950" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1164 msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1164 msgid "Urdu" msgstr "" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1166 msgid "cp1026" msgstr "cp1026" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1166 msgid "ibm1026" msgstr "ibm1026" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1168 msgid "cp1125" msgstr "cp1125" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1168 msgid "1125, ibm1125, cp866u, ruscii" msgstr "1125, ibm1125, cp866u, ruscii" -#: ../../library/codecs.rst:1154 ../../library/codecs.rst:1258 +#: ../../library/codecs.rst:1168 ../../library/codecs.rst:1272 msgid "Ukrainian" msgstr "烏克蘭文" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1172 msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1172 msgid "ibm1140" msgstr "ibm1140" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1174 msgid "cp1250" msgstr "cp1250" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1174 msgid "windows-1250" msgstr "windows-1250" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1176 msgid "cp1251" msgstr "cp1251" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1176 msgid "windows-1251" msgstr "windows-1251" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1179 msgid "cp1252" msgstr "cp1252" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1179 msgid "windows-1252" msgstr "windows-1252" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1181 msgid "cp1253" msgstr "cp1253" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1181 msgid "windows-1253" msgstr "windows-1253" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1183 msgid "cp1254" msgstr "cp1254" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1183 msgid "windows-1254" msgstr "windows-1254" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1185 msgid "cp1255" msgstr "cp1255" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1185 msgid "windows-1255" msgstr "windows-1255" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1187 msgid "cp1256" msgstr "cp1256" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1187 msgid "windows-1256" msgstr "windows-1256" -#: ../../library/codecs.rst:1175 +#: ../../library/codecs.rst:1189 msgid "cp1257" msgstr "cp1257" -#: ../../library/codecs.rst:1175 +#: ../../library/codecs.rst:1189 msgid "windows-1257" msgstr "windows-1257" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1191 msgid "cp1258" msgstr "cp1258" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1191 msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1191 msgid "Vietnamese" msgstr "越南文" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1193 msgid "euc_jp" msgstr "euc_jp" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1193 msgid "eucjp, ujis, u-jis" msgstr "eucjp, ujis, u-jis" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1195 msgid "euc_jis_2004" msgstr "euc_jis_2004" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1195 msgid "jisx0213, eucjis2004" msgstr "jisx0213, eucjis2004" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1197 msgid "euc_jisx0213" msgstr "euc_jisx0213" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1197 msgid "eucjisx0213" msgstr "eucjisx0213" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1199 msgid "euc_kr" msgstr "euc_kr" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1199 msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgstr "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" -#: ../../library/codecs.rst:1189 +#: ../../library/codecs.rst:1203 msgid "gb2312" msgstr "gb2312" -#: ../../library/codecs.rst:1189 +#: ../../library/codecs.rst:1203 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" @@ -1865,446 +1882,446 @@ msgstr "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" -#: ../../library/codecs.rst:1189 ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1203 ../../library/codecs.rst:1212 msgid "Simplified Chinese" msgstr "簡體中文" -#: ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1208 msgid "gbk" msgstr "gbk" -#: ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1208 msgid "936, cp936, ms936" msgstr "936, cp936, ms936" -#: ../../library/codecs.rst:1194 ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1208 ../../library/codecs.rst:1210 msgid "Unified Chinese" msgstr "" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1210 msgid "gb18030" msgstr "gb18030" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1210 msgid "gb18030-2000" msgstr "gb18030-2000" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1212 msgid "hz" msgstr "hz" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1212 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "hzgb, hz-gb, hz-gb-2312" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1214 msgid "iso2022_jp" msgstr "iso2022_jp" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1214 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "csiso2022jp, iso2022jp, iso-2022-jp" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1217 msgid "iso2022_jp_1" msgstr "iso2022_jp_1" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1217 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "iso2022jp-1, iso-2022-jp-1" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1219 msgid "iso2022_jp_2" msgstr "iso2022_jp_2" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1219 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "iso2022jp-2, iso-2022-jp-2" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1219 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1222 msgid "iso2022_jp_2004" msgstr "iso2022_jp_2004" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1222 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "iso2022jp-2004, iso-2022-jp-2004" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1225 msgid "iso2022_jp_3" msgstr "iso2022_jp_3" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1225 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "iso2022jp-3, iso-2022-jp-3" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1227 msgid "iso2022_jp_ext" msgstr "iso2022_jp_ext" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1227 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "iso2022jp-ext, iso-2022-jp-ext" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1229 msgid "iso2022_kr" msgstr "iso2022_kr" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1229 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "csiso2022kr, iso2022kr, iso-2022-kr" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1232 msgid "latin_1" msgstr "latin_1" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1232 msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgstr "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1235 msgid "iso8859_2" msgstr "iso8859_2" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1235 msgid "iso-8859-2, latin2, L2" msgstr "iso-8859-2, latin2, L2" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1237 msgid "iso8859_3" msgstr "iso8859_3" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1237 msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1237 msgid "Esperanto, Maltese" msgstr "" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1239 msgid "iso8859_4" msgstr "iso8859_4" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1239 msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1241 msgid "iso8859_5" msgstr "iso8859_5" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1241 msgid "iso-8859-5, cyrillic" msgstr "iso-8859-5, cyrillic" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1244 msgid "iso8859_6" msgstr "iso8859_6" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1244 msgid "iso-8859-6, arabic" msgstr "iso-8859-6, arabic" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1246 msgid "iso8859_7" msgstr "iso8859_7" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1246 msgid "iso-8859-7, greek, greek8" msgstr "iso-8859-7, greek, greek8" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1248 msgid "iso8859_8" msgstr "iso8859_8" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1248 msgid "iso-8859-8, hebrew" msgstr "iso-8859-8, hebrew" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1250 msgid "iso8859_9" msgstr "iso8859_9" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1250 msgid "iso-8859-9, latin5, L5" msgstr "iso-8859-9, latin5, L5" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1252 msgid "iso8859_10" msgstr "iso8859_10" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1252 msgid "iso-8859-10, latin6, L6" msgstr "iso-8859-10, latin6, L6" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1252 msgid "Nordic languages" msgstr "" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1254 msgid "iso8859_11" msgstr "iso8859_11" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1254 msgid "iso-8859-11, thai" msgstr "iso-8859-11, thai" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1254 msgid "Thai languages" msgstr "泰語" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1256 msgid "iso8859_13" msgstr "iso8859_13" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1256 msgid "iso-8859-13, latin7, L7" msgstr "iso-8859-13, latin7, L7" -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1258 msgid "iso8859_14" msgstr "iso8859_14" -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1258 msgid "iso-8859-14, latin8, L8" msgstr "iso-8859-14, latin8, L8" -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1258 msgid "Celtic languages" msgstr "" -#: ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1260 msgid "iso8859_15" msgstr "iso8859_15" -#: ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1260 msgid "iso-8859-15, latin9, L9" msgstr "iso-8859-15, latin9, L9" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1262 msgid "iso8859_16" msgstr "iso8859_16" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1262 msgid "iso-8859-16, latin10, L10" msgstr "iso-8859-16, latin10, L10" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1262 msgid "South-Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1264 msgid "johab" msgstr "" -#: ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1264 msgid "cp1361, ms1361" msgstr "cp1361, ms1361" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1266 msgid "koi8_r" msgstr "koi8_r" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1268 msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1268 msgid "Tajik" msgstr "" -#: ../../library/codecs.rst:1258 +#: ../../library/codecs.rst:1272 msgid "koi8_u" msgstr "koi8_u" -#: ../../library/codecs.rst:1260 +#: ../../library/codecs.rst:1274 msgid "kz1048" msgstr "kz1048" -#: ../../library/codecs.rst:1260 +#: ../../library/codecs.rst:1274 msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1260 ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1274 ../../library/codecs.rst:1292 msgid "Kazakh" msgstr "" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1278 msgid "mac_cyrillic" msgstr "mac_cyrillic" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1278 msgid "maccyrillic" msgstr "" -#: ../../library/codecs.rst:1267 +#: ../../library/codecs.rst:1281 msgid "mac_greek" msgstr "mac_greek" -#: ../../library/codecs.rst:1267 +#: ../../library/codecs.rst:1281 msgid "macgreek" msgstr "" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1283 msgid "mac_iceland" msgstr "mac_iceland" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1283 msgid "maciceland" msgstr "" -#: ../../library/codecs.rst:1271 +#: ../../library/codecs.rst:1285 msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1271 +#: ../../library/codecs.rst:1285 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "maclatin2, maccentraleurope, mac_centeuro" -#: ../../library/codecs.rst:1274 +#: ../../library/codecs.rst:1288 msgid "mac_roman" msgstr "mac_roman" -#: ../../library/codecs.rst:1274 +#: ../../library/codecs.rst:1288 msgid "macroman, macintosh" msgstr "macroman, macintosh" -#: ../../library/codecs.rst:1276 +#: ../../library/codecs.rst:1290 msgid "mac_turkish" msgstr "mac_turkish" -#: ../../library/codecs.rst:1276 +#: ../../library/codecs.rst:1290 msgid "macturkish" msgstr "" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1292 msgid "ptcp154" msgstr "ptcp154" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1292 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "csptcp154, pt154, cp154, cyrillic-asian" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1295 msgid "shift_jis" msgstr "shift_jis" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1295 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "csshiftjis, shiftjis, sjis, s_jis" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1298 msgid "shift_jis_2004" msgstr "shift_jis_2004" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1298 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "shiftjis2004, sjis_2004, sjis2004" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1301 msgid "shift_jisx0213" msgstr "shift_jisx0213" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1301 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "shiftjisx0213, sjisx0213, s_jisx0213" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1304 msgid "utf_32" msgstr "utf_32" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1304 msgid "U32, utf32" msgstr "U32, utf32" -#: ../../library/codecs.rst:1290 ../../library/codecs.rst:1292 -#: ../../library/codecs.rst:1294 ../../library/codecs.rst:1296 -#: ../../library/codecs.rst:1298 ../../library/codecs.rst:1300 -#: ../../library/codecs.rst:1302 ../../library/codecs.rst:1304 -#: ../../library/codecs.rst:1306 +#: ../../library/codecs.rst:1304 ../../library/codecs.rst:1306 +#: ../../library/codecs.rst:1308 ../../library/codecs.rst:1310 +#: ../../library/codecs.rst:1312 ../../library/codecs.rst:1314 +#: ../../library/codecs.rst:1316 ../../library/codecs.rst:1318 +#: ../../library/codecs.rst:1320 msgid "all languages" msgstr "" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1306 msgid "utf_32_be" msgstr "utf_32_be" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1306 msgid "UTF-32BE" msgstr "UTF-32BE" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1308 msgid "utf_32_le" msgstr "utf_32_le" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1308 msgid "UTF-32LE" msgstr "UTF-32LE" -#: ../../library/codecs.rst:1296 +#: ../../library/codecs.rst:1310 msgid "utf_16" msgstr "utf_16" -#: ../../library/codecs.rst:1296 +#: ../../library/codecs.rst:1310 msgid "U16, utf16" msgstr "U16, utf16" -#: ../../library/codecs.rst:1298 +#: ../../library/codecs.rst:1312 msgid "utf_16_be" msgstr "utf_16_be" -#: ../../library/codecs.rst:1298 +#: ../../library/codecs.rst:1312 msgid "UTF-16BE" msgstr "UTF-16BE" -#: ../../library/codecs.rst:1300 +#: ../../library/codecs.rst:1314 msgid "utf_16_le" msgstr "utf_16_le" -#: ../../library/codecs.rst:1300 +#: ../../library/codecs.rst:1314 msgid "UTF-16LE" msgstr "UTF-16LE" -#: ../../library/codecs.rst:1302 +#: ../../library/codecs.rst:1316 msgid "utf_7" msgstr "utf_7" -#: ../../library/codecs.rst:1302 +#: ../../library/codecs.rst:1316 msgid "U7, unicode-1-1-utf-7" msgstr "U7, unicode-1-1-utf-7" -#: ../../library/codecs.rst:1304 +#: ../../library/codecs.rst:1318 msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1304 +#: ../../library/codecs.rst:1318 msgid "U8, UTF, utf8, cp65001" msgstr "U8, UTF, utf8, cp65001" -#: ../../library/codecs.rst:1306 +#: ../../library/codecs.rst:1320 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1309 +#: ../../library/codecs.rst:1323 msgid "" "The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " "(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " "decode byte sequences that correspond to surrogate code points." msgstr "" -#: ../../library/codecs.rst:1315 +#: ../../library/codecs.rst:1329 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "``cp65001`` 現在是 ``utf_8`` 的別名。" -#: ../../library/codecs.rst:1320 +#: ../../library/codecs.rst:1334 msgid "Python Specific Encodings" msgstr "" -#: ../../library/codecs.rst:1322 +#: ../../library/codecs.rst:1336 msgid "" "A number of predefined codecs are specific to Python, so their codec names " "have no meaning outside Python. These are listed in the tables below based " @@ -2314,268 +2331,328 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1344 msgid "Text Encodings" msgstr "" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1346 msgid "" "The following codecs provide :class:`str` to :class:`bytes` encoding and :" "term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " "text encodings." msgstr "" -#: ../../library/codecs.rst:1341 +#: ../../library/codecs.rst:1355 msgid "idna" msgstr "idna" -#: ../../library/codecs.rst:1341 +#: ../../library/codecs.rst:1355 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1361 msgid "mbcs" msgstr "mbcs" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1361 msgid "ansi, dbcs" msgstr "ansi, dbcs" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1361 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1365 msgid "oem" msgstr "oem" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1365 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1371 msgid "palmos" msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1371 msgid "Encoding of PalmOS 3.5." msgstr "" -#: ../../library/codecs.rst:1359 +#: ../../library/codecs.rst:1373 msgid "punycode" msgstr "" -#: ../../library/codecs.rst:1359 +#: ../../library/codecs.rst:1373 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: ../../library/codecs.rst:1363 +#: ../../library/codecs.rst:1377 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1363 +#: ../../library/codecs.rst:1377 msgid "" "Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " "other code points. Existing backslashes are not escaped in any way. It is " "used in the Python pickle protocol." msgstr "" -#: ../../library/codecs.rst:1373 +#: ../../library/codecs.rst:1387 msgid "undefined" msgstr "" -#: ../../library/codecs.rst:1373 +#: ../../library/codecs.rst:1387 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1378 +#: ../../library/codecs.rst:1392 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1378 +#: ../../library/codecs.rst:1392 msgid "" "Encoding suitable as the contents of a Unicode literal in ASCII-encoded " "Python source code, except that quotes are not escaped. Decode from Latin-1 " "source code. Beware that Python source code actually uses UTF-8 by default." msgstr "" -#: ../../library/codecs.rst:1390 +#: ../../library/codecs.rst:1404 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1411 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1399 +#: ../../library/codecs.rst:1413 msgid "" "The following codecs provide binary transforms: :term:`bytes-like object` " "to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " "(which only produces :class:`str` output)." msgstr "" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1421 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1409 +#: ../../library/codecs.rst:1423 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1409 +#: ../../library/codecs.rst:1423 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1409 +#: ../../library/codecs.rst:1423 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1414 +#: ../../library/codecs.rst:1428 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1409 +#: ../../library/codecs.rst:1423 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1434 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1434 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1434 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1434 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1437 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1437 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1437 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1437 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1428 +#: ../../library/codecs.rst:1442 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1428 +#: ../../library/codecs.rst:1442 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1428 +#: ../../library/codecs.rst:1442 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1428 +#: ../../library/codecs.rst:1442 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1432 +#: ../../library/codecs.rst:1446 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1432 +#: ../../library/codecs.rst:1446 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1432 +#: ../../library/codecs.rst:1446 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1449 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1449 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1449 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1449 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1439 +#: ../../library/codecs.rst:1453 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1443 +#: ../../library/codecs.rst:1457 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1460 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1453 +#: ../../library/codecs.rst:1467 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1455 +#: ../../library/codecs.rst:1469 msgid "" "The following codec provides a text transform: a :class:`str` to :class:" "`str` mapping. It is not supported by :meth:`str.encode` (which only " "produces :class:`bytes` output)." msgstr "" -#: ../../library/codecs.rst:1464 +#: ../../library/codecs.rst:1478 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1464 +#: ../../library/codecs.rst:1478 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1464 +#: ../../library/codecs.rst:1478 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1469 +#: ../../library/codecs.rst:1483 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1472 +#: ../../library/codecs.rst:1486 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1477 +#: ../../library/codecs.rst:1491 +msgid ":mod:`encodings` --- Encodings package" +msgstr "" + +#: ../../library/codecs.rst:1496 +msgid "This module implements the following functions:" +msgstr "" + +#: ../../library/codecs.rst:1500 +msgid "Normalize encoding name *encoding*." +msgstr "" + +#: ../../library/codecs.rst:1502 +msgid "" +"Normalization works as follows: all non-alphanumeric characters except the " +"dot used for Python package names are collapsed and replaced with a single " +"underscore, leading and trailing underscores are removed. For example, ``' " +"-;#'`` becomes ``'_'``." +msgstr "" + +#: ../../library/codecs.rst:1507 +msgid "Note that *encoding* should be ASCII only." +msgstr "" + +#: ../../library/codecs.rst:1511 +msgid "" +"The following function should not be used directly, except for testing " +"purposes; :func:`codecs.lookup` should be used instead." +msgstr "" + +#: ../../library/codecs.rst:1517 +msgid "" +"Search for the codec module corresponding to the given encoding name " +"*encoding*." +msgstr "" + +#: ../../library/codecs.rst:1520 +msgid "" +"This function first normalizes the *encoding* using :func:" +"`normalize_encoding`, then looks for a corresponding alias. It attempts to " +"import a codec module from the encodings package using either the alias or " +"the normalized name. If the module is found and defines a valid " +"``getregentry()`` function that returns a :class:`codecs.CodecInfo` object, " +"the codec is cached and returned." +msgstr "" + +#: ../../library/codecs.rst:1527 +msgid "" +"If the codec module defines a ``getaliases()`` function any returned aliases " +"are registered for future use." +msgstr "" + +#: ../../library/codecs.rst:1531 +msgid "This module implements the following exception:" +msgstr "" + +#: ../../library/codecs.rst:1535 +msgid "Raised when a codec is invalid or incompatible." +msgstr "" + +#: ../../library/codecs.rst:1539 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1483 +#: ../../library/codecs.rst:1545 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2583,13 +2660,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1488 +#: ../../library/codecs.rst:1550 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party :pypi:`idna` module." msgstr "" -#: ../../library/codecs.rst:1491 +#: ../../library/codecs.rst:1553 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " "domain names. A domain name containing non-ASCII characters (such as ``www." @@ -2603,7 +2680,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1502 +#: ../../library/codecs.rst:1564 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2620,14 +2697,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1515 +#: ../../library/codecs.rst:1577 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " "present such host names to the user should decode them to Unicode." msgstr "" -#: ../../library/codecs.rst:1519 +#: ../../library/codecs.rst:1581 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2635,49 +2712,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1527 +#: ../../library/codecs.rst:1589 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1533 +#: ../../library/codecs.rst:1595 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1539 +#: ../../library/codecs.rst:1601 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1543 +#: ../../library/codecs.rst:1605 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: ../../library/codecs.rst:1548 +#: ../../library/codecs.rst:1610 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1550 +#: ../../library/codecs.rst:1612 msgid "Availability" msgstr "可用性" -#: ../../library/codecs.rst:1552 +#: ../../library/codecs.rst:1614 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1556 +#: ../../library/codecs.rst:1618 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1561 +#: ../../library/codecs.rst:1623 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1567 +#: ../../library/codecs.rst:1629 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " @@ -2706,71 +2783,71 @@ msgstr "streams(串流)" msgid "stackable" msgstr "stackable(可堆疊)" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "strict" msgstr "strict" -#: ../../library/codecs.rst:320 ../../library/codecs.rst:372 -#: ../../library/codecs.rst:395 +#: ../../library/codecs.rst:334 ../../library/codecs.rst:386 +#: ../../library/codecs.rst:409 msgid "error handler's name" msgstr "error handler's name(錯誤處理器名稱)" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "ignore" msgstr "ignore" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "replace" msgstr "replace" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "backslashreplace" msgstr "backslashreplace" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "surrogateescape" msgstr "surrogateescape" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "replacement character" msgstr "replacement character(替代字元)" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/codecs.rst:320 ../../library/codecs.rst:372 +#: ../../library/codecs.rst:334 ../../library/codecs.rst:386 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "\\x" msgstr "\\x" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "\\u" msgstr "\\u" -#: ../../library/codecs.rst:320 +#: ../../library/codecs.rst:334 msgid "\\U" msgstr "\\U" -#: ../../library/codecs.rst:372 +#: ../../library/codecs.rst:386 msgid "xmlcharrefreplace" msgstr "xmlcharrefreplace" -#: ../../library/codecs.rst:372 +#: ../../library/codecs.rst:386 msgid "namereplace" msgstr "namereplace" -#: ../../library/codecs.rst:372 +#: ../../library/codecs.rst:386 msgid "\\N" msgstr "\\N" -#: ../../library/codecs.rst:395 +#: ../../library/codecs.rst:409 msgid "surrogatepass" msgstr "surrogatepass" diff --git a/library/os.path.po b/library/os.path.po index dd776816d6..dd2fb8acec 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: 2023-07-13 14:06+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -115,12 +115,12 @@ msgstr "" #: ../../library/os.path.rst:215 ../../library/os.path.rst:227 #: ../../library/os.path.rst:236 ../../library/os.path.rst:246 #: ../../library/os.path.rst:260 ../../library/os.path.rst:270 -#: ../../library/os.path.rst:289 ../../library/os.path.rst:308 -#: ../../library/os.path.rst:380 ../../library/os.path.rst:400 -#: ../../library/os.path.rst:440 ../../library/os.path.rst:469 -#: ../../library/os.path.rst:485 ../../library/os.path.rst:496 -#: ../../library/os.path.rst:510 ../../library/os.path.rst:526 -#: ../../library/os.path.rst:551 ../../library/os.path.rst:615 +#: ../../library/os.path.rst:289 ../../library/os.path.rst:309 +#: ../../library/os.path.rst:381 ../../library/os.path.rst:401 +#: ../../library/os.path.rst:441 ../../library/os.path.rst:470 +#: ../../library/os.path.rst:486 ../../library/os.path.rst:497 +#: ../../library/os.path.rst:511 ../../library/os.path.rst:527 +#: ../../library/os.path.rst:552 ../../library/os.path.rst:616 msgid "Accepts a :term:`path-like object`." msgstr "接受一個 :term:`path-like object`。" @@ -144,9 +144,9 @@ msgid "" "relative pathnames, if *paths* are on different drives, or if *paths* is " "empty. Unlike :func:`commonprefix`, this returns a valid path." msgstr "" -"回傳可疊代物件 *paths* 中每個路徑名稱的最長共同子路徑。如果 *paths* 同時包含絕對路徑名稱" -"和相對路徑名稱、*paths* 位於不同的驅動機或 *paths* 為空,則引發 :exc:" -"`ValueError`。與 :func:`commonprefix` 不同,此函式回傳的是有效路徑。" +"回傳可疊代物件 *paths* 中每個路徑名稱的最長共同子路徑。如果 *paths* 同時包含" +"絕對路徑名稱和相對路徑名稱、*paths* 位於不同的驅動機或 *paths* 為空,則引發 :" +"exc:`ValueError`。與 :func:`commonprefix` 不同,此函式回傳的是有效路徑。" #: ../../library/os.path.rst:90 msgid "Accepts a sequence of :term:`path-like objects `." @@ -381,6 +381,7 @@ msgstr "" "傳 ``True``。如果 Python 執行時不支援符號連結,則始終回傳 ``False``。" #: ../../library/os.path.rst:295 +#, fuzzy msgid "" "Return ``True`` if pathname *path* is a :dfn:`mount point`: a point in a " "file system where a different file system has been mounted. On POSIX, the " @@ -388,9 +389,11 @@ msgid "" "different device than *path*, or whether :file:`{path}/..` and *path* point " "to the same i-node on the same device --- this should detect mount points " "for all Unix and POSIX variants. It is not able to reliably detect bind " -"mounts on the same filesystem. On Windows, a drive letter root and a share " -"UNC are always mount points, and for any other path ``GetVolumePathName`` is " -"called to see if it is different from the input path." +"mounts on the same filesystem. On Linux systems, it will always return " +"``True`` for btrfs subvolumes, even if they aren't mount points. On Windows, " +"a drive letter root and a share UNC are always mount points, and for any " +"other path ``GetVolumePathName`` is called to see if it is different from " +"the input path." msgstr "" "如果路徑名 *path* 是一個掛載點 (:dfn:`mount point`),則回傳 ``True``:即在檔" "案系統中掛載了不同的檔案系統。在 POSIX 系統上,該函式檢查 *path* 的父目錄 :" @@ -400,11 +403,11 @@ msgstr "" "上,以驅動機字母開頭的根目錄和 UNC 共享路徑始終是掛載點,對於任何其他路徑,會" "呼叫 ``GetVolumePathName`` 函式來檢查它是否與輸入路徑不同。" -#: ../../library/os.path.rst:305 +#: ../../library/os.path.rst:306 msgid "Added support for detecting non-root mount points on Windows." msgstr "新增在 Windows 上檢測非根目錄掛載點的支援。" -#: ../../library/os.path.rst:314 +#: ../../library/os.path.rst:315 msgid "" "Return ``True`` if pathname *path* is located on a Windows Dev Drive. A Dev " "Drive is optimized for developer scenarios, and offers faster performance " @@ -416,7 +419,7 @@ msgstr "" "開發人員場景進行了優化,提供更快的讀寫檔案性能。建議將其用於原始程式碼、臨時" "建置目錄、封包快取和其他 I/O 密集型操作。" -#: ../../library/os.path.rst:320 +#: ../../library/os.path.rst:321 msgid "" "May raise an error for an invalid path, for example, one without a " "recognizable drive, but returns ``False`` on platforms that do not support " @@ -427,17 +430,17 @@ msgstr "" "碟機的平台上返回 ``False``。請參閱 `Windows 文件 `_\\ 以了解有關啟用和建立 Dev 驅動機的資訊。" -#: ../../library/os.path.rst:327 +#: ../../library/os.path.rst:328 msgid "" "The function is now available on all platforms, and will always return " "``False`` on those that have no support for Dev Drives" msgstr "" -#: ../../library/os.path.rst:333 +#: ../../library/os.path.rst:334 msgid "Return ``True`` if *path* is a reserved pathname on the current system." msgstr "" -#: ../../library/os.path.rst:335 +#: ../../library/os.path.rst:336 msgid "" "On Windows, reserved filenames include those that end with a space or dot; " "those that contain colons (i.e. file streams such as \"name:stream\"), " @@ -446,7 +449,7 @@ msgid "" "\", \"AUX\", \"PRN\", \"COM1\", and \"LPT1\"." msgstr "" -#: ../../library/os.path.rst:343 +#: ../../library/os.path.rst:344 msgid "" "This function approximates rules for reserved paths on most Windows systems. " "These rules change over time in various Windows releases. This function may " @@ -454,11 +457,11 @@ msgid "" "available." msgstr "" -#: ../../library/os.path.rst:348 +#: ../../library/os.path.rst:349 msgid "Availability" msgstr "可用性" -#: ../../library/os.path.rst:355 +#: ../../library/os.path.rst:356 msgid "" "Join one or more path segments intelligently. The return value is the " "concatenation of *path* and all members of *\\*paths*, with exactly one " @@ -473,7 +476,7 @@ msgstr "" "個部分為空或以分隔符號結尾,結果只會以分隔符號結尾。如果一個段是絕對路徑(在 " "Windows 上需要驅動機和根),則忽略所有之前的段,並從絕對路徑段繼續連接。" -#: ../../library/os.path.rst:363 +#: ../../library/os.path.rst:364 msgid "" "On Windows, the drive is not reset when a rooted path segment (e.g., " "``r'\\foo'``) is encountered. If a segment is on a different drive or is an " @@ -488,11 +491,11 @@ msgstr "" "對於驅動機 :file:`C:` 的目前目錄的路徑(即 :file:`c:foo`),而不是 :file:`c:" "\\\\foo`。" -#: ../../library/os.path.rst:370 +#: ../../library/os.path.rst:371 msgid "Accepts a :term:`path-like object` for *path* and *paths*." msgstr "*path* 和 *paths* 接受 :term:`path-like object` 作為參數。" -#: ../../library/os.path.rst:376 +#: ../../library/os.path.rst:377 msgid "" "Normalize the case of a pathname. On Windows, convert all characters in the " "pathname to lowercase, and also convert forward slashes to backward slashes. " @@ -501,7 +504,7 @@ msgstr "" "將路徑名的大小寫規範化。在 Windows 上,將路徑名中的所有字元轉換為小寫,並將正" "斜線轉換為反斜線。在其他作業系統上,回傳原始路徑。" -#: ../../library/os.path.rst:386 +#: ../../library/os.path.rst:387 msgid "" "Normalize a pathname by collapsing redundant separators and up-level " "references so that ``A//B``, ``A/B/``, ``A/./B`` and ``A/foo/../B`` all " @@ -514,7 +517,7 @@ msgstr "" "結的路徑的含義。在 Windows 上,它將正斜線轉換為反斜線。要標準化大小寫,請使" "用 :func:`normcase`。" -#: ../../library/os.path.rst:393 +#: ../../library/os.path.rst:394 msgid "" "On POSIX systems, in accordance with `IEEE Std 1003.1 2013 Edition; 4.13 " "Pathname Resolution >> splitdrive(\"c:/dir\")\n" "(\"c:\", \"/dir\")" @@ -714,12 +716,12 @@ msgstr "" ">>> splitdrive(\"c:/dir\")\n" "(\"c:\", \"/dir\")" -#: ../../library/os.path.rst:545 +#: ../../library/os.path.rst:546 msgid "" "If the path contains a UNC path, drive will contain the host name and share::" msgstr "如果路徑包含 UNC 路徑,則驅動機將包含主機名和共享名: ::" -#: ../../library/os.path.rst:548 +#: ../../library/os.path.rst:549 msgid "" ">>> splitdrive(\"//host/computer/dir\")\n" "(\"//host/computer\", \"/dir\")" @@ -727,7 +729,7 @@ msgstr "" ">>> splitdrive(\"//host/computer/dir\")\n" "(\"//host/computer\", \"/dir\")" -#: ../../library/os.path.rst:557 +#: ../../library/os.path.rst:558 msgid "" "Split the pathname *path* into a 3-item tuple ``(drive, root, tail)`` where " "*drive* is a device name or mount point, *root* is a string of separators " @@ -740,7 +742,7 @@ msgstr "" "這些項目中的任何一個都可能是空字串。在所有情況下,``drive + root + tail`` 將" "與 *path* 相同。" -#: ../../library/os.path.rst:563 +#: ../../library/os.path.rst:564 msgid "" "On POSIX systems, *drive* is always empty. The *root* may be empty (if " "*path* is relative), a single forward slash (if *path* is absolute), or two " @@ -754,7 +756,7 @@ msgstr "" "onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>`_ 的實作定義)。例" "如: ::" -#: ../../library/os.path.rst:569 +#: ../../library/os.path.rst:570 msgid "" ">>> splitroot('/home/sam')\n" "('', '/', 'home/sam')\n" @@ -770,7 +772,7 @@ msgstr "" ">>> splitroot('///home/sam')\n" "('', '/', '//home/sam')" -#: ../../library/os.path.rst:576 +#: ../../library/os.path.rst:577 msgid "" "On Windows, *drive* may be empty, a drive-letter name, a UNC share, or a " "device name. The *root* may be empty, a forward slash, or a backward slash. " @@ -779,7 +781,7 @@ msgstr "" "在 Windows 上,*drive* 可能為空、驅動機名稱、UNC 共享或設備名稱。*root* 可能" "為空,斜線或反斜線。例如: ::" -#: ../../library/os.path.rst:580 +#: ../../library/os.path.rst:581 msgid "" ">>> splitroot('C:/Users/Sam')\n" "('C:', '/', 'Users/Sam')\n" @@ -791,7 +793,7 @@ msgstr "" ">>> splitroot('//Server/Share/Users/Sam')\n" "('//Server/Share', '/', 'Users/Sam')" -#: ../../library/os.path.rst:590 +#: ../../library/os.path.rst:591 msgid "" "Split the pathname *path* into a pair ``(root, ext)`` such that ``root + " "ext == path``, and the extension, *ext*, is empty or begins with a period " @@ -800,11 +802,11 @@ msgstr "" "將路徑名 *path* 拆分為一對 ``(root, ext)``,使得 ``root + ext == path``,且副" "檔名 *ext* 為空或以點開頭且最多包含一個點 (period)。" -#: ../../library/os.path.rst:594 +#: ../../library/os.path.rst:595 msgid "If the path contains no extension, *ext* will be ``''``::" msgstr "如果路徑不包含副檔名,則 *ext* 將為 ``''``: ::" -#: ../../library/os.path.rst:596 +#: ../../library/os.path.rst:597 msgid "" ">>> splitext('bar')\n" "('bar', '')" @@ -812,7 +814,7 @@ msgstr "" ">>> splitext('bar')\n" "('bar', '')" -#: ../../library/os.path.rst:599 +#: ../../library/os.path.rst:600 msgid "" "If the path contains an extension, then *ext* will be set to this extension, " "including the leading period. Note that previous periods will be ignored::" @@ -820,7 +822,7 @@ msgstr "" "如果路徑包含副檔名,則 *ext* 將設置為該副檔名,包括前導的點。請注意,前面的點" "將被忽略: ::" -#: ../../library/os.path.rst:602 +#: ../../library/os.path.rst:603 msgid "" ">>> splitext('foo.bar.exe')\n" "('foo.bar', '.exe')\n" @@ -832,13 +834,13 @@ msgstr "" ">>> splitext('/foo/bar.exe')\n" "('/foo/bar', '.exe')" -#: ../../library/os.path.rst:607 +#: ../../library/os.path.rst:608 msgid "" "Leading periods of the last component of the path are considered to be part " "of the root::" msgstr "路徑的最後一個部份的前導點被認為是根的一部分: ::" -#: ../../library/os.path.rst:610 +#: ../../library/os.path.rst:611 msgid "" ">>> splitext('.cshrc')\n" "('.cshrc', '')\n" @@ -850,7 +852,7 @@ msgstr "" ">>> splitext('/foo/....jpg')\n" "('/foo/....jpg', '')" -#: ../../library/os.path.rst:621 +#: ../../library/os.path.rst:622 msgid "" "``True`` if arbitrary Unicode strings can be used as file names (within " "limitations imposed by the file system)." diff --git a/library/sqlite3.po b/library/sqlite3.po index 3e0270c411..b174182430 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-03-19 00:14+0000\n" +"POT-Creation-Date: 2025-07-10 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-" @@ -38,8 +38,8 @@ msgstr "" #: ../../library/sqlite3.rst:32 msgid "" "The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an " -"SQL interface compliant with the DB-API 2.0 specification described " -"by :pep:`249`, and requires SQLite 3.15.2 or newer." +"SQL interface compliant with the DB-API 2.0 specification described by :pep:" +"`249`, and requires SQLite 3.15.2 or newer." msgstr "" #: ../../library/sqlite3.rst:36 @@ -128,8 +128,8 @@ msgstr "" #: ../../library/sqlite3.rst:89 msgid "" "In order to execute SQL statements and fetch results from SQL queries, we " -"will need to use a database cursor. Call :meth:`con.cursor() " -"` to create the :class:`Cursor`:" +"will need to use a database cursor. Call :meth:`con.cursor() ` to create the :class:`Cursor`:" msgstr "" #: ../../library/sqlite3.rst:93 @@ -142,8 +142,8 @@ msgid "" "database table ``movie`` with columns for title, release year, and review " "score. For simplicity, we can just use column names in the table declaration " "-- thanks to the `flexible typing`_ feature of SQLite, specifying the data " -"types is optional. Execute the ``CREATE TABLE`` statement by " -"calling :meth:`cur.execute(...) `:" +"types is optional. Execute the ``CREATE TABLE`` statement by calling :meth:" +"`cur.execute(...) `:" msgstr "" #: ../../library/sqlite3.rst:106 @@ -155,9 +155,9 @@ msgid "" "We can verify that the new table has been created by querying the " "``sqlite_master`` table built-in to SQLite, which should now contain an " "entry for the ``movie`` table definition (see `The Schema Table`_ for " -"details). Execute that query by calling :meth:`cur.execute(...) " -"`, assign the result to ``res``, and " -"call :meth:`res.fetchone() ` to fetch the resulting row:" +"details). Execute that query by calling :meth:`cur.execute(...) `, assign the result to ``res``, and call :meth:`res.fetchone() " +"` to fetch the resulting row:" msgstr "" #: ../../library/sqlite3.rst:121 @@ -172,10 +172,9 @@ msgstr "" #: ../../library/sqlite3.rst:127 msgid "" -"We can see that the table has been created, as the query returns " -"a :class:`tuple` containing the table's name. If we query ``sqlite_master`` " -"for a non-existent table ``spam``, :meth:`!res.fetchone` will return " -"``None``:" +"We can see that the table has been created, as the query returns a :class:" +"`tuple` containing the table's name. If we query ``sqlite_master`` for a non-" +"existent table ``spam``, :meth:`!res.fetchone` will return ``None``:" msgstr "" #: ../../library/sqlite3.rst:132 @@ -191,8 +190,8 @@ msgstr "" #: ../../library/sqlite3.rst:138 msgid "" "Now, add two rows of data supplied as SQL literals by executing an " -"``INSERT`` statement, once again by calling :meth:`cur.execute(...) " -"`:" +"``INSERT`` statement, once again by calling :meth:`cur.execute(...) `:" msgstr "" #: ../../library/sqlite3.rst:142 @@ -213,8 +212,8 @@ msgstr "" msgid "" "The ``INSERT`` statement implicitly opens a transaction, which needs to be " "committed before changes are saved in the database (see :ref:`sqlite3-" -"controlling-transactions` for details). Call :meth:`con.commit() " -"` on the connection object to commit the transaction:" +"controlling-transactions` for details). Call :meth:`con.commit() ` on the connection object to commit the transaction:" msgstr "" #: ../../library/sqlite3.rst:156 @@ -225,8 +224,8 @@ msgstr "con.commit()" msgid "" "We can verify that the data was inserted correctly by executing a ``SELECT`` " "query. Use the now-familiar :meth:`cur.execute(...) ` to " -"assign the result to ``res``, and call :meth:`res.fetchall() " -"` to return all resulting rows:" +"assign the result to ``res``, and call :meth:`res.fetchall() ` to return all resulting rows:" msgstr "" #: ../../library/sqlite3.rst:166 @@ -247,8 +246,8 @@ msgstr "" #: ../../library/sqlite3.rst:175 msgid "" -"Now, insert three more rows by calling :meth:`cur.executemany(...) " -"`:" +"Now, insert three more rows by calling :meth:`cur.executemany(...) `:" msgstr "" #: ../../library/sqlite3.rst:178 @@ -304,10 +303,9 @@ msgstr "" #: ../../library/sqlite3.rst:211 msgid "" -"Finally, verify that the database has been written to disk by " -"calling :meth:`con.close() ` to close the existing " -"connection, opening a new one, creating a new cursor, then querying the " -"database:" +"Finally, verify that the database has been written to disk by calling :meth:" +"`con.close() ` to close the existing connection, opening a " +"new one, creating a new cursor, then querying the database:" msgstr "" #: ../../library/sqlite3.rst:216 @@ -396,9 +394,9 @@ msgstr "" #: ../../library/sqlite3.rst:277 msgid "" -"How many seconds the connection should wait before raising " -"an :exc:`OperationalError` when a table is locked. If another connection " -"opens a transaction to modify a table, that table will be locked until the " +"How many seconds the connection should wait before raising an :exc:" +"`OperationalError` when a table is locked. If another connection opens a " +"transaction to modify a table, that table will be locked until the " "transaction is committed. Default five seconds." msgstr "" @@ -407,20 +405,19 @@ msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " "converters registered with :func:`register_converter`. Set it to any " -"combination (using ``|``, bitwise or) of :const:`PARSE_DECLTYPES` " -"and :const:`PARSE_COLNAMES` to enable this. Column names takes precedence " -"over declared types if both flags are set. By default (``0``), type " -"detection is disabled." +"combination (using ``|``, bitwise or) of :const:`PARSE_DECLTYPES` and :const:" +"`PARSE_COLNAMES` to enable this. Column names takes precedence over declared " +"types if both flags are set. By default (``0``), type detection is disabled." msgstr "" #: ../../library/sqlite3.rst:295 msgid "" -"Control legacy transaction handling behaviour. " -"See :attr:`Connection.isolation_level` and :ref:`sqlite3-transaction-control-" -"isolation-level` for more information. Can be ``\"DEFERRED\"`` (default), " -"``\"EXCLUSIVE\"`` or ``\"IMMEDIATE\"``; or ``None`` to disable opening " -"transactions implicitly. Has no effect unless :attr:`Connection.autocommit` " -"is set to :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default)." +"Control legacy transaction handling behaviour. See :attr:`Connection." +"isolation_level` and :ref:`sqlite3-transaction-control-isolation-level` for " +"more information. Can be ``\"DEFERRED\"`` (default), ``\"EXCLUSIVE\"`` or " +"``\"IMMEDIATE\"``; or ``None`` to disable opening transactions implicitly. " +"Has no effect unless :attr:`Connection.autocommit` is set to :const:" +"`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default)." msgstr "" #: ../../library/sqlite3.rst:305 @@ -455,11 +452,11 @@ msgstr "" #: ../../library/sqlite3.rst:332 msgid "" -"Control :pep:`249` transaction handling behaviour. " -"See :attr:`Connection.autocommit` and :ref:`sqlite3-transaction-control-" -"autocommit` for more information. *autocommit* currently defaults " -"to :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL`. The default will change to " -"``False`` in a future Python release." +"Control :pep:`249` transaction handling behaviour. See :attr:`Connection." +"autocommit` and :ref:`sqlite3-transaction-control-autocommit` for more " +"information. *autocommit* currently defaults to :const:`~sqlite3." +"LEGACY_TRANSACTION_CONTROL`. The default will change to ``False`` in a " +"future Python release." msgstr "" #: ../../library/sqlite3.rst:0 @@ -471,8 +468,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -"引發一個附帶引數 ``database`` 的\\ :ref:`稽核事件 ` " -"``sqlite3.connect``。" +"引發一個附帶引數 ``database`` 的\\ :ref:`稽核事件 ` ``sqlite3." +"connect``。" #: ../../library/sqlite3.rst:344 msgid "" @@ -620,8 +617,8 @@ msgstr "" #: ../../library/sqlite3.rst:459 msgid "" -"Generated fields (for example ``MAX(p)``) are returned as :class:`str`. " -"Use :const:`!PARSE_COLNAMES` to enforce types for such queries." +"Generated fields (for example ``MAX(p)``) are returned as :class:`str`. Use :" +"const:`!PARSE_COLNAMES` to enforce types for such queries." msgstr "" #: ../../library/sqlite3.rst:464 @@ -688,8 +685,8 @@ msgstr "" #: ../../library/sqlite3.rst:510 msgid "" -"Version number of the runtime SQLite library as a :class:`tuple` " -"of :class:`integers `." +"Version number of the runtime SQLite library as a :class:`tuple` of :class:" +"`integers `." msgstr "" #: ../../library/sqlite3.rst:515 @@ -806,8 +803,8 @@ msgstr "" #: ../../library/sqlite3.rst:589 msgid "" -"These constants are used for the :meth:`Connection.setconfig` " -"and :meth:`~Connection.getconfig` methods." +"These constants are used for the :meth:`Connection.setconfig` and :meth:" +"`~Connection.getconfig` methods." msgstr "" #: ../../library/sqlite3.rst:592 @@ -831,9 +828,8 @@ msgstr "Connection 物件" #: ../../library/sqlite3.rst:610 msgid "" "Each open SQLite database is represented by a ``Connection`` object, which " -"is created using :func:`sqlite3.connect`. Their main purpose is " -"creating :class:`Cursor` objects, and :ref:`sqlite3-controlling-" -"transactions`." +"is created using :func:`sqlite3.connect`. Their main purpose is creating :" +"class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." msgstr "" #: ../../library/sqlite3.rst:617 @@ -842,8 +838,8 @@ msgstr ":ref:`sqlite3-connection-shortcuts`" #: ../../library/sqlite3.rst:623 msgid "" -"A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before " -"a :class:`!Connection` object is deleted." +"A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before a :" +"class:`!Connection` object is deleted." msgstr "" #: ../../library/sqlite3.rst:626 @@ -853,9 +849,8 @@ msgstr "一個 SQLite 資料庫連線具有以下屬性和方法:" #: ../../library/sqlite3.rst:630 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " -"single optional parameter *factory*. If supplied, this must be " -"a :term:`callable` returning an instance of :class:`Cursor` or its " -"subclasses." +"single optional parameter *factory*. If supplied, this must be a :term:" +"`callable` returning an instance of :class:`Cursor` or its subclasses." msgstr "" #: ../../library/sqlite3.rst:637 @@ -904,17 +899,17 @@ msgstr "" #: ../../library/sqlite3.rst:672 msgid "" "Commit any pending transaction to the database. If :attr:`autocommit` is " -"``True``, or there is no open transaction, this method does nothing. " -"If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened " -"if a pending transaction was committed by this method." +"``True``, or there is no open transaction, this method does nothing. If :" +"attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a " +"pending transaction was committed by this method." msgstr "" #: ../../library/sqlite3.rst:680 msgid "" "Roll back to the start of any pending transaction. If :attr:`autocommit` is " -"``True``, or there is no open transaction, this method does nothing. " -"If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened " -"if a pending transaction was rolled back by this method." +"``True``, or there is no open transaction, this method does nothing. If :" +"attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a " +"pending transaction was rolled back by this method." msgstr "" #: ../../library/sqlite3.rst:688 @@ -1285,17 +1280,17 @@ msgstr "" #: ../../library/sqlite3.rst:953 msgid "" "Call this method from a different thread to abort any queries that might be " -"executing on the connection. Aborted queries will raise " -"an :exc:`OperationalError`." +"executing on the connection. Aborted queries will raise an :exc:" +"`OperationalError`." msgstr "" #: ../../library/sqlite3.rst:960 msgid "" "Register :term:`callable` *authorizer_callback* to be invoked for each " "attempt to access a column of a table in the database. The callback should " -"return one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, " -"or :const:`SQLITE_IGNORE` to signal how access to the column should be " -"handled by the underlying SQLite library." +"return one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:" +"`SQLITE_IGNORE` to signal how access to the column should be handled by the " +"underlying SQLite library." msgstr "" #: ../../library/sqlite3.rst:967 @@ -1367,11 +1362,10 @@ msgstr "" msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " -"that the backend does not only run statements passed to " -"the :meth:`Cursor.execute` methods. Other sources include " -"the :ref:`transaction management ` of " -"the :mod:`!sqlite3` module and the execution of triggers defined in the " -"current database." +"that the backend does not only run statements passed to the :meth:`Cursor." +"execute` methods. Other sources include the :ref:`transaction management " +"` of the :mod:`!sqlite3` module and the " +"execution of triggers defined in the current database." msgstr "" #: ../../library/sqlite3.rst:1020 @@ -1405,8 +1399,8 @@ msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " "are compiled without this feature. To get loadable extension support, you " -"must pass the :option:`--enable-loadable-sqlite-extensions` option " -"to :program:`configure`." +"must pass the :option:`--enable-loadable-sqlite-extensions` option to :" +"program:`configure`." msgstr "" #: ../../library/sqlite3.rst:1053 @@ -1487,8 +1481,8 @@ msgstr "新增 *entrypoint* 參數。" #: ../../library/sqlite3.rst:1120 msgid "" "Return an :term:`iterator` to dump the database as SQL source code. Useful " -"when saving an in-memory database for later restoration. Similar to the " -"``.dump`` command in the :program:`sqlite3` shell." +"when saving an in-memory database for later restoration. Similar to the ``." +"dump`` command in the :program:`sqlite3` shell." msgstr "" #: ../../library/sqlite3.rst:1124 @@ -1615,8 +1609,8 @@ msgstr "" #: ../../library/sqlite3.rst:1232 msgid "" -"Example, query the maximum length of an SQL statement " -"for :class:`Connection` ``con`` (the default is 1000000000):" +"Example, query the maximum length of an SQL statement for :class:" +"`Connection` ``con`` (the default is 1000000000):" msgstr "" #: ../../library/sqlite3.rst:1242 @@ -1701,10 +1695,10 @@ msgstr "" #: ../../library/sqlite3.rst:1336 msgid "" -"Deserialize a :meth:`serialized ` database into " -"a :class:`Connection`. This method causes the database connection to " -"disconnect from database *name*, and reopen *name* as an in-memory database " -"based on the serialization contained in *data*." +"Deserialize a :meth:`serialized ` database into a :class:" +"`Connection`. This method causes the database connection to disconnect from " +"database *name*, and reopen *name* as an in-memory database based on the " +"serialization contained in *data*." msgstr "" #: ../../library/sqlite3.rst:1342 @@ -1743,9 +1737,9 @@ msgstr "" #: ../../library/sqlite3.rst:1371 msgid "" -"``False``: Select :pep:`249`-compliant transaction behaviour, implying " -"that :mod:`!sqlite3` ensures a transaction is always open. " -"Use :meth:`commit` and :meth:`rollback` to close transactions." +"``False``: Select :pep:`249`-compliant transaction behaviour, implying that :" +"mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :" +"meth:`rollback` to close transactions." msgstr "" #: ../../library/sqlite3.rst:1375 @@ -1754,8 +1748,8 @@ msgstr "" #: ../../library/sqlite3.rst:1377 msgid "" -"``True``: Use SQLite's `autocommit mode`_. :meth:`commit` " -"and :meth:`rollback` have no effect in this mode." +"``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:" +"`rollback` have no effect in this mode." msgstr "" #: ../../library/sqlite3.rst:1380 @@ -1780,8 +1774,8 @@ msgstr "更多詳情請見 :ref:`sqlite3-transaction-control-autocommit`。" #: ../../library/sqlite3.rst:1393 msgid "" -"The :attr:`isolation_level` attribute has no effect " -"unless :attr:`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." +"The :attr:`isolation_level` attribute has no effect unless :attr:" +"`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." msgstr "" #: ../../library/sqlite3.rst:1400 @@ -1823,10 +1817,10 @@ msgstr "" #: ../../library/sqlite3.rst:1430 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " -"from this connection. Assigning to this attribute does not affect " -"the :attr:`!row_factory` of existing cursors belonging to this connection, " -"only new ones. Is ``None`` by default, meaning each row is returned as " -"a :class:`tuple`." +"from this connection. Assigning to this attribute does not affect the :attr:" +"`!row_factory` of existing cursors belonging to this connection, only new " +"ones. Is ``None`` by default, meaning each row is returned as a :class:" +"`tuple`." msgstr "" #: ../../library/sqlite3.rst:1437 ../../library/sqlite3.rst:1723 @@ -1859,15 +1853,15 @@ msgstr "Cursor 物件" msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " -"created using :meth:`Connection.cursor`, or by using any of " -"the :ref:`connection shortcut methods `." +"created using :meth:`Connection.cursor`, or by using any of the :ref:" +"`connection shortcut methods `." msgstr "" #: ../../library/sqlite3.rst:1466 msgid "" -"Cursor objects are :term:`iterators `, meaning that if " -"you :meth:`~Cursor.execute` a ``SELECT`` query, you can simply iterate over " -"the cursor to fetch the resulting rows:" +"Cursor objects are :term:`iterators `, meaning that if you :meth:" +"`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " +"to fetch the resulting rows:" msgstr "" #: ../../library/sqlite3.rst:1477 @@ -1884,8 +1878,8 @@ msgstr ":class:`Cursor` 實例具有以下屬性和方法。" #: ../../library/sqlite3.rst:1498 msgid "" -"Execute a single SQL statement, optionally binding Python values " -"using :ref:`placeholders `." +"Execute a single SQL statement, optionally binding Python values using :ref:" +"`placeholders `." msgstr "" #: ../../library/sqlite3.rst:1502 @@ -1905,19 +1899,18 @@ msgstr "" #: ../../library/sqlite3.rst:1515 msgid "" -"If :attr:`~Connection.autocommit` " -"is :data:`LEGACY_TRANSACTION_CONTROL`, :attr:`~Connection.isolation_level` " -"is not ``None``, *sql* is an ``INSERT``, ``UPDATE``, ``DELETE``, or " -"``REPLACE`` statement, and there is no open transaction, a transaction is " -"implicitly opened before executing *sql*." +"If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :" +"attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, " +"``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is no open " +"transaction, a transaction is implicitly opened before executing *sql*." msgstr "" #: ../../library/sqlite3.rst:1524 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of " -"a :class:`dict`. Starting with Python 3.14, :exc:`ProgrammingError` will be " -"raised instead." +"placeholders>` are used and *parameters* is a sequence instead of a :class:" +"`dict`. Starting with Python 3.14, :exc:`ProgrammingError` will be raised " +"instead." msgstr "" #: ../../library/sqlite3.rst:1530 @@ -1982,11 +1975,11 @@ msgstr "" #: ../../library/sqlite3.rst:1586 msgid "" -"Execute the SQL statements in *sql_script*. If " -"the :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and " -"there is a pending transaction, an implicit ``COMMIT`` statement is executed " -"first. No other implicit transaction control is performed; any transaction " -"control must be added to *sql_script*." +"Execute the SQL statements in *sql_script*. If the :attr:`~Connection." +"autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending " +"transaction, an implicit ``COMMIT`` statement is executed first. No other " +"implicit transaction control is performed; any transaction control must be " +"added to *sql_script*." msgstr "" #: ../../library/sqlite3.rst:1594 @@ -2055,9 +2048,9 @@ msgstr "" #: ../../library/sqlite3.rst:1644 msgid "" -"The cursor will be unusable from this point forward; " -"a :exc:`ProgrammingError` exception will be raised if any operation is " -"attempted with the cursor." +"The cursor will be unusable from this point forward; a :exc:" +"`ProgrammingError` exception will be raised if any operation is attempted " +"with the cursor." msgstr "" #: ../../library/sqlite3.rst:1649 ../../library/sqlite3.rst:1653 @@ -2066,17 +2059,17 @@ msgstr "" #: ../../library/sqlite3.rst:1657 msgid "" -"Read/write attribute that controls the number of rows returned " -"by :meth:`fetchmany`. The default value is 1 which means a single row would " -"be fetched per call." +"Read/write attribute that controls the number of rows returned by :meth:" +"`fetchmany`. The default value is 1 which means a single row would be " +"fetched per call." msgstr "" #: ../../library/sqlite3.rst:1662 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " -"belonging to the cursor. A :class:`Cursor` object created by " -"calling :meth:`con.cursor() ` will have " -"a :attr:`connection` attribute that refers to *con*:" +"belonging to the cursor. A :class:`Cursor` object created by calling :meth:" +"`con.cursor() ` will have a :attr:`connection` attribute " +"that refers to *con*:" msgstr "" #: ../../library/sqlite3.rst:1667 @@ -2144,8 +2137,8 @@ msgstr "" #: ../../library/sqlite3.rst:1718 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" -"Cursor` was created. Assigning to this attribute does not " -"affect :attr:`Connection.row_factory` of the parent connection." +"Cursor` was created. Assigning to this attribute does not affect :attr:" +"`Connection.row_factory` of the parent connection." msgstr "" #: ../../library/sqlite3.rst:1734 @@ -2154,10 +2147,10 @@ msgstr "Row 物件" #: ../../library/sqlite3.rst:1738 msgid "" -"A :class:`!Row` instance serves as a highly " -"optimized :attr:`~Connection.row_factory` for :class:`Connection` objects. " -"It supports iteration, equality testing, :func:`len`, and :term:`mapping` " -"access by column name and index." +"A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." +"row_factory` for :class:`Connection` objects. It supports iteration, " +"equality testing, :func:`len`, and :term:`mapping` access by column name and " +"index." msgstr "" #: ../../library/sqlite3.rst:1743 @@ -2169,8 +2162,8 @@ msgstr "" #: ../../library/sqlite3.rst:1750 msgid "" "Return a :class:`list` of column names as :class:`strings `. " -"Immediately after a query, it is the first member of each tuple " -"in :attr:`Cursor.description`." +"Immediately after a query, it is the first member of each tuple in :attr:" +"`Cursor.description`." msgstr "" #: ../../library/sqlite3.rst:1754 @@ -2184,9 +2177,9 @@ msgstr "Blob 物件" #: ../../library/sqlite3.rst:1767 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " -"write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. " -"Call :func:`len(blob) ` to get the size (number of bytes) of the blob. " -"Use indices and :term:`slices ` for direct access to the blob data." +"write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" +"`len(blob) ` to get the size (number of bytes) of the blob. Use indices " +"and :term:`slices ` for direct access to the blob data." msgstr "" #: ../../library/sqlite3.rst:1772 @@ -2223,24 +2216,24 @@ msgstr "" #: ../../library/sqlite3.rst:1805 msgid "" -"The blob will be unusable from this point onward. " -"An :class:`~sqlite3.Error` (or subclass) exception will be raised if any " -"further operation is attempted with the blob." +"The blob will be unusable from this point onward. An :class:`~sqlite3." +"Error` (or subclass) exception will be raised if any further operation is " +"attempted with the blob." msgstr "" #: ../../library/sqlite3.rst:1811 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " -"will be returned. When *length* is not specified, or is " -"negative, :meth:`~Blob.read` will read until the end of the blob." +"will be returned. When *length* is not specified, or is negative, :meth:" +"`~Blob.read` will read until the end of the blob." msgstr "" #: ../../library/sqlite3.rst:1819 msgid "" "Write *data* to the blob at the current offset. This function cannot change " -"the blob length. Writing beyond the end of the blob will " -"raise :exc:`ValueError`." +"the blob length. Writing beyond the end of the blob will raise :exc:" +"`ValueError`." msgstr "" #: ../../library/sqlite3.rst:1825 @@ -2297,8 +2290,8 @@ msgstr "" #: ../../library/sqlite3.rst:1871 msgid "" -"The numeric error code from the `SQLite API `_" +"The numeric error code from the `SQLite API `_" msgstr "" #: ../../library/sqlite3.rst:1878 @@ -2354,8 +2347,8 @@ msgstr "" msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " -"closed :class:`Connection`. ``ProgrammingError`` is a subclass " -"of :exc:`DatabaseError`." +"closed :class:`Connection`. ``ProgrammingError`` is a subclass of :exc:" +"`DatabaseError`." msgstr "" #: ../../library/sqlite3.rst:1932 @@ -2476,8 +2469,8 @@ msgstr "" #: ../../library/sqlite3.rst:2005 msgid "" -"A converter for :ref:`declared ` \"date\" types " -"to :class:`datetime.date` objects." +"A converter for :ref:`declared ` \"date\" types to :" +"class:`datetime.date` objects." msgstr "" #: ../../library/sqlite3.rst:2007 @@ -2763,8 +2756,8 @@ msgstr "" #: ../../library/sqlite3.rst:2238 msgid "" -"Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | " -"sqlite3.PARSE_COLNAMES``. Column names take precedence over declared types." +"Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." +"PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" #: ../../library/sqlite3.rst:2242 @@ -2832,7 +2825,7 @@ msgid "" "\n" "def adapt_datetime_iso(val):\n" " \"\"\"Adapt datetime.datetime to timezone-naive ISO 8601 date.\"\"\"\n" -" return val.isoformat()\n" +" return val.replace(tzinfo=None).isoformat()\n" "\n" "def adapt_datetime_epoch(val):\n" " \"\"\"Adapt datetime.datetime to Unix timestamp.\"\"\"\n" @@ -2865,14 +2858,14 @@ msgstr "" #: ../../library/sqlite3.rst:2361 msgid "" -"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, " -"and :meth:`~Connection.executescript` methods of the :class:`Connection` " -"class, your code can be written more concisely because you don't have to " -"create the (often superfluous) :class:`Cursor` objects explicitly. Instead, " -"the :class:`Cursor` objects are created implicitly and these shortcut " -"methods return the cursor objects. This way, you can execute a ``SELECT`` " -"statement and iterate over it directly using only a single call on " -"the :class:`Connection` object." +"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" +"meth:`~Connection.executescript` methods of the :class:`Connection` class, " +"your code can be written more concisely because you don't have to create the " +"(often superfluous) :class:`Cursor` objects explicitly. Instead, the :class:" +"`Cursor` objects are created implicitly and these shortcut methods return " +"the cursor objects. This way, you can execute a ``SELECT`` statement and " +"iterate over it directly using only a single call on the :class:`Connection` " +"object." msgstr "" #: ../../library/sqlite3.rst:2370 @@ -2925,15 +2918,15 @@ msgstr "" #: ../../library/sqlite3.rst:2420 msgid "" "The context manager neither implicitly opens a new transaction nor closes " -"the connection. If you need a closing context manager, consider " -"using :meth:`contextlib.closing`." +"the connection. If you need a closing context manager, consider using :meth:" +"`contextlib.closing`." msgstr "" #: ../../library/sqlite3.rst:2424 msgid "" "con = sqlite3.connect(\":memory:\")\n" -"con.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)" -"\")\n" +"con.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR " +"UNIQUE)\")\n" "\n" "# Successful, con.commit() is called automatically afterwards\n" "with con:\n" @@ -3037,17 +3030,17 @@ msgstr "" #: ../../library/sqlite3.rst:2505 msgid "" -"By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If " -"a :class:`!tuple` does not suit your needs, you can use " -"the :class:`sqlite3.Row` class or a custom :attr:`~Cursor.row_factory`." +"By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" +"class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." +"Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" #: ../../library/sqlite3.rst:2510 msgid "" -"While :attr:`!row_factory` exists as an attribute both on " -"the :class:`Cursor` and the :class:`Connection`, it is recommended to " -"set :class:`Connection.row_factory`, so all cursors created from the " -"connection will use the same row factory." +"While :attr:`!row_factory` exists as an attribute both on the :class:" +"`Cursor` and the :class:`Connection`, it is recommended to set :class:" +"`Connection.row_factory`, so all cursors created from the connection will " +"use the same row factory." msgstr "" #: ../../library/sqlite3.rst:2515 @@ -3182,9 +3175,9 @@ msgstr "" #: ../../library/sqlite3.rst:2595 msgid "" -"With some adjustments, the above recipe can be adapted to use " -"a :class:`~dataclasses.dataclass`, or any other custom class, instead of " -"a :class:`~collections.namedtuple`." +"With some adjustments, the above recipe can be adapted to use a :class:" +"`~dataclasses.dataclass`, or any other custom class, instead of a :class:" +"`~collections.namedtuple`." msgstr "" #: ../../library/sqlite3.rst:2603 @@ -3195,8 +3188,8 @@ msgstr "" msgid "" "By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with " "the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might " -"fail for other encodings and invalid UTF-8. You can use a " -"custom :attr:`~Connection.text_factory` to handle such cases." +"fail for other encodings and invalid UTF-8. You can use a custom :attr:" +"`~Connection.text_factory` to handle such cases." msgstr "" #: ../../library/sqlite3.rst:2611 @@ -3205,9 +3198,9 @@ msgid "" "table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or " "even arbitrary data. To demonstrate, let's assume we have a database with " "ISO-8859-2 (Latin-2) encoded text, for example a table of Czech-English " -"dictionary entries. Assuming we now have a :class:`Connection` " -"instance :py:data:`!con` connected to this database, we can decode the " -"Latin-2 encoded text using this :attr:`~Connection.text_factory`:" +"dictionary entries. Assuming we now have a :class:`Connection` instance :py:" +"data:`!con` connected to this database, we can decode the Latin-2 encoded " +"text using this :attr:`~Connection.text_factory`:" msgstr "" #: ../../library/sqlite3.rst:2620 @@ -3256,9 +3249,9 @@ msgstr "" #: ../../library/sqlite3.rst:2663 msgid "" -"The recommended way of controlling transaction behaviour is through " -"the :attr:`Connection.autocommit` attribute, which should preferably be set " -"using the *autocommit* parameter of :func:`connect`." +"The recommended way of controlling transaction behaviour is through the :" +"attr:`Connection.autocommit` attribute, which should preferably be set using " +"the *autocommit* parameter of :func:`connect`." msgstr "" #: ../../library/sqlite3.rst:2668 @@ -3269,11 +3262,11 @@ msgstr "" #: ../../library/sqlite3.rst:2672 msgid "" -":mod:`!sqlite3` ensures that a transaction is always open, " -"so :func:`connect`, :meth:`Connection.commit`, " -"and :meth:`Connection.rollback` will implicitly open a new transaction " -"(immediately after closing the pending one, for the latter two). :mod:`!" -"sqlite3` uses ``BEGIN DEFERRED`` statements when opening transactions." +":mod:`!sqlite3` ensures that a transaction is always open, so :func:" +"`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " +"implicitly open a new transaction (immediately after closing the pending " +"one, for the latter two). :mod:`!sqlite3` uses ``BEGIN DEFERRED`` statements " +"when opening transactions." msgstr "" #: ../../library/sqlite3.rst:2677 @@ -3286,8 +3279,8 @@ msgstr "" #: ../../library/sqlite3.rst:2679 msgid "" -"An implicit rollback is performed if the database " -"is :meth:`~Connection.close`-ed with pending changes." +"An implicit rollback is performed if the database is :meth:`~Connection." +"close`-ed with pending changes." msgstr "" #: ../../library/sqlite3.rst:2682 @@ -3295,16 +3288,15 @@ msgid "" "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " "mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " "effect. Note that SQLite's autocommit mode is distinct from the :pep:`249`-" -"compliant :attr:`Connection.autocommit` attribute; " -"use :attr:`Connection.in_transaction` to query the low-level SQLite " -"autocommit mode." +"compliant :attr:`Connection.autocommit` attribute; use :attr:`Connection." +"in_transaction` to query the low-level SQLite autocommit mode." msgstr "" #: ../../library/sqlite3.rst:2690 msgid "" "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " -"control behaviour to the :attr:`Connection.isolation_level` attribute. " -"See :ref:`sqlite3-transaction-control-isolation-level` for more information." +"control behaviour to the :attr:`Connection.isolation_level` attribute. See :" +"ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" #: ../../library/sqlite3.rst:2699 @@ -3313,31 +3305,31 @@ msgstr "" #: ../../library/sqlite3.rst:2703 msgid "" -"The recommended way of controlling transactions is via " -"the :attr:`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-" -"control-autocommit`." +"The recommended way of controlling transactions is via the :attr:" +"`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" +"autocommit`." msgstr "" #: ../../library/sqlite3.rst:2707 msgid "" -"If :attr:`Connection.autocommit` is set " -"to :data:`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour " -"is controlled using the :attr:`Connection.isolation_level` attribute. " +"If :attr:`Connection.autocommit` is set to :data:" +"`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " +"controlled using the :attr:`Connection.isolation_level` attribute. " "Otherwise, :attr:`!isolation_level` has no effect." msgstr "" #: ../../library/sqlite3.rst:2713 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " -"``None``, new transactions are implicitly opened " -"before :meth:`~Cursor.execute` and :meth:`~Cursor.executemany` executes " -"``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statements; for other " -"statements, no implicit transaction handling is performed. Use " -"the :meth:`~Connection.commit` and :meth:`~Connection.rollback` methods to " -"respectively commit and roll back pending transactions. You can choose the " -"underlying `SQLite transaction behaviour`_ — that is, whether and what type " -"of ``BEGIN`` statements :mod:`!sqlite3` implicitly executes – via " -"the :attr:`~Connection.isolation_level` attribute." +"``None``, new transactions are implicitly opened before :meth:`~Cursor." +"execute` and :meth:`~Cursor.executemany` executes ``INSERT``, ``UPDATE``, " +"``DELETE``, or ``REPLACE`` statements; for other statements, no implicit " +"transaction handling is performed. Use the :meth:`~Connection.commit` and :" +"meth:`~Connection.rollback` methods to respectively commit and roll back " +"pending transactions. You can choose the underlying `SQLite transaction " +"behaviour`_ — that is, whether and what type of ``BEGIN`` statements :mod:`!" +"sqlite3` implicitly executes – via the :attr:`~Connection.isolation_level` " +"attribute." msgstr "" #: ../../library/sqlite3.rst:2726 @@ -3346,8 +3338,8 @@ msgid "" "are implicitly opened at all. This leaves the underlying SQLite library in " "`autocommit mode`_, but also allows the user to perform their own " "transaction handling using explicit SQL statements. The underlying SQLite " -"library autocommit mode can be queried using " -"the :attr:`~Connection.in_transaction` attribute." +"library autocommit mode can be queried using the :attr:`~Connection." +"in_transaction` attribute." msgstr "" #: ../../library/sqlite3.rst:2734 @@ -3365,8 +3357,8 @@ msgstr "" #: ../../library/sqlite3.rst:2742 msgid "" -"The recommended way of controlling transactions is now via " -"the :attr:`~Connection.autocommit` attribute." +"The recommended way of controlling transactions is now via the :attr:" +"`~Connection.autocommit` attribute." msgstr "" #: ../../library/sqlite3.rst:1493 diff --git a/library/time.po b/library/time.po index dfd10d6f86..fe0fcd4f6b 100644 --- a/library/time.po +++ b/library/time.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-01 00:18+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: 2024-11-20 15:25+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -264,14 +264,14 @@ msgstr "" #: ../../library/time.rst:153 ../../library/time.rst:165 #: ../../library/time.rst:178 ../../library/time.rst:187 #: ../../library/time.rst:200 ../../library/time.rst:209 -#: ../../library/time.rst:752 ../../library/time.rst:776 -#: ../../library/time.rst:872 ../../library/time.rst:883 -#: ../../library/time.rst:893 ../../library/time.rst:903 -#: ../../library/time.rst:912 ../../library/time.rst:921 -#: ../../library/time.rst:930 ../../library/time.rst:941 -#: ../../library/time.rst:949 ../../library/time.rst:960 -#: ../../library/time.rst:971 ../../library/time.rst:980 -#: ../../library/time.rst:993 +#: ../../library/time.rst:754 ../../library/time.rst:778 +#: ../../library/time.rst:874 ../../library/time.rst:885 +#: ../../library/time.rst:895 ../../library/time.rst:905 +#: ../../library/time.rst:914 ../../library/time.rst:923 +#: ../../library/time.rst:932 ../../library/time.rst:943 +#: ../../library/time.rst:951 ../../library/time.rst:962 +#: ../../library/time.rst:973 ../../library/time.rst:982 +#: ../../library/time.rst:995 msgid "Availability" msgstr "可用性" @@ -474,7 +474,7 @@ msgstr "" "示)。該時鐘不受系統時鐘更新的影響。回傳值的參考點沒有定義,因此只有兩次呼叫" "結果之間的差異才是有效的。" -#: ../../library/time.rst:294 ../../library/time.rst:713 +#: ../../library/time.rst:294 ../../library/time.rst:715 msgid "Clock:" msgstr "時鐘:" @@ -510,30 +510,35 @@ msgid "" msgstr "使用 :func:`monotonic_ns` 以避免 :class:`float` 型別造成的精確度損失。" #: ../../library/time.rst:308 -msgid "The function is now always available and always system-wide." +#, fuzzy +msgid "" +"The function is now always available and the clock is now the same for all " +"processes." msgstr "此函式現在始終可用且涵蓋整個系統。" -#: ../../library/time.rst:311 -msgid "On macOS, the function is now system-wide." +#: ../../library/time.rst:312 +#, fuzzy +msgid "On macOS, the clock is now the same for all processes." msgstr "在 macOS 上,此函式現在涵蓋整個系統。" -#: ../../library/time.rst:317 +#: ../../library/time.rst:318 msgid "Similar to :func:`monotonic`, but return time as nanoseconds." msgstr "類似於 :func:`monotonic`,但回傳以奈秒為單位的時間。" -#: ../../library/time.rst:326 +#: ../../library/time.rst:327 +#, fuzzy msgid "" "Return the value (in fractional seconds) of a performance counter, i.e. a " "clock with the highest available resolution to measure a short duration. It " -"does include time elapsed during sleep and is system-wide. The reference " -"point of the returned value is undefined, so that only the difference " -"between the results of two calls is valid." +"does include time elapsed during sleep. The clock is the same for all " +"processes. The reference point of the returned value is undefined, so that " +"only the difference between the results of two calls is valid." msgstr "" "回傳性能計數器的值(以帶有小數的秒數表示),即具有最高可用解析度來測量短時間" "間隔的時鐘。它包括睡眠時經過的時間,並且涵蓋整個系統。回傳值的參考點沒有定" "義,因此只有兩次呼叫結果之間的差異才是有效的。" -#: ../../library/time.rst:334 +#: ../../library/time.rst:336 msgid "" "On CPython, use the same clock as :func:`time.monotonic` and is a monotonic " "clock, i.e. a clock that cannot go backwards." @@ -541,26 +546,27 @@ msgstr "" "在 CPython 上,使用與 :func:`time.monotonic` 相同的時鐘,且其為單調時鐘(即不" "能倒轉的時鐘)。" -#: ../../library/time.rst:337 +#: ../../library/time.rst:339 msgid "" "Use :func:`perf_counter_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" "使用 :func:`perf_counter_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:342 -msgid "On Windows, the function is now system-wide." +#: ../../library/time.rst:344 +#, fuzzy +msgid "On Windows, the clock is now the same for all processes." msgstr "在 Windows 上,此函式現在涵蓋整個系統。" -#: ../../library/time.rst:345 +#: ../../library/time.rst:347 msgid "Use the same clock as :func:`time.monotonic`." msgstr "使用與 :func:`time.monotonic` 相同的時鐘。" -#: ../../library/time.rst:351 +#: ../../library/time.rst:353 msgid "Similar to :func:`perf_counter`, but return time as nanoseconds." msgstr "類似於 :func:`perf_counter`,但回傳以奈秒為單位的時間。" -#: ../../library/time.rst:363 +#: ../../library/time.rst:365 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current process. It does not include time elapsed during " @@ -572,18 +578,18 @@ msgstr "" "經過的時間。根據定義,它涵蓋整個行程。回傳值的參考點沒有定義,因此只有兩次呼" "叫結果之間的差異才是有效的。" -#: ../../library/time.rst:369 +#: ../../library/time.rst:371 msgid "" "Use :func:`process_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" "使用 :func:`process_time_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:376 +#: ../../library/time.rst:378 msgid "Similar to :func:`process_time` but return time as nanoseconds." msgstr "類似於 :func:`process_time`,但回傳以奈秒為單位的時間。" -#: ../../library/time.rst:382 +#: ../../library/time.rst:384 msgid "" "Suspend execution of the calling thread for the given number of seconds. The " "argument may be a floating-point number to indicate a more precise sleep " @@ -592,7 +598,7 @@ msgstr "" "在一個給定的秒數內暫停呼叫執行緒 (calling thread) 的執行。引數可以是浮點數," "以表示更精確的睡眠時間。" -#: ../../library/time.rst:386 +#: ../../library/time.rst:388 msgid "" "If the sleep is interrupted by a signal and no exception is raised by the " "signal handler, the sleep is restarted with a recomputed timeout." @@ -600,17 +606,17 @@ msgstr "" "如果睡眠被訊號中斷且訊號處理器未引發例外,則睡眠將以重新計算過的逾時 " "(timeout) 重新開始。" -#: ../../library/time.rst:389 +#: ../../library/time.rst:391 msgid "" "The suspension time may be longer than requested by an arbitrary amount, " "because of the scheduling of other activity in the system." msgstr "由於系統中其他活動的調度,暫停時間可能會比請求的時間長任意的量。" -#: ../../library/time.rst:393 +#: ../../library/time.rst:395 msgid "Windows implementation" msgstr "Windows 實作" -#: ../../library/time.rst:394 +#: ../../library/time.rst:396 msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " "time slice to any other thread that is ready to run. If there are no other " @@ -626,34 +632,34 @@ msgstr "" "learn.microsoft.com/windows-hardware/drivers/kernel/high-resolution-" "timers>`_,其解析度為 100 奈秒。如果 *secs* 為零,則使用 ``Sleep(0)``。" -#: ../../library/time.rst:403 +#: ../../library/time.rst:405 msgid "Unix implementation" msgstr "Unix 實作" -#: ../../library/time.rst:404 +#: ../../library/time.rst:406 msgid "Use ``clock_nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "如果可以,使用 ``clock_nanosleep()``\\ (解析度:1 奈秒);" -#: ../../library/time.rst:405 +#: ../../library/time.rst:407 msgid "Or use ``nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "或者使用 ``nanosleep()``\\ (解析度:1 奈秒);" -#: ../../library/time.rst:406 +#: ../../library/time.rst:408 msgid "Or use ``select()`` (resolution: 1 microsecond)." msgstr "或使用 ``select()``\\ (解析度:1 微秒)。" -#: ../../library/time.rst:410 +#: ../../library/time.rst:412 msgid "" "To emulate a \"no-op\", use :keyword:`pass` instead of ``time.sleep(0)``." msgstr "" -#: ../../library/time.rst:412 +#: ../../library/time.rst:414 msgid "" "To voluntarily relinquish the CPU, specify a real-time :ref:`scheduling " "policy ` and use :func:`os.sched_yield` instead." msgstr "" -#: ../../library/time.rst:415 +#: ../../library/time.rst:417 msgid "" "Raises an :ref:`auditing event ` ``time.sleep`` with argument " "``secs``." @@ -661,7 +667,7 @@ msgstr "" "引發一個帶有引數 ``secs`` 的\\ :ref:`稽核事件 (auditing event) ` " "``time.sleep``。" -#: ../../library/time.rst:417 +#: ../../library/time.rst:419 msgid "" "The function now sleeps at least *secs* even if the sleep is interrupted by " "a signal, except if the signal handler raises an exception (see :pep:`475` " @@ -670,7 +676,7 @@ msgstr "" "即使睡眠被訊號中斷,此函式現在至少還是會睡眠 *secs*,除非訊號處理器引發例外" "(理由請參閱 :pep:`475`)。" -#: ../../library/time.rst:422 +#: ../../library/time.rst:424 msgid "" "On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " "used if available. On Windows, a waitable timer is now used." @@ -678,11 +684,11 @@ msgstr "" "在 Unix 上,如果可以的話現在會使用 ``clock_nanosleep()`` 和 ``nanosleep()`` " "函式。在 Windows 上,現在使用可等待的計時器。" -#: ../../library/time.rst:426 +#: ../../library/time.rst:428 msgid "Raises an auditing event." msgstr "引發一個稽核事件。" -#: ../../library/time.rst:434 +#: ../../library/time.rst:436 msgid "" "Convert a tuple or :class:`struct_time` representing a time as returned by :" "func:`gmtime` or :func:`localtime` to a string as specified by the *format* " @@ -695,7 +701,7 @@ msgstr "" "func:`localtime` 回傳的目前時間。*format* 必須是一個字串。如果 *t* 中的任何欄" "位超出允許範圍,將會引發 :exc:`ValueError`。" -#: ../../library/time.rst:440 +#: ../../library/time.rst:442 msgid "" "0 is a legal argument for any position in the time tuple; if it is normally " "illegal the value is forced to a correct one." @@ -703,7 +709,7 @@ msgstr "" "0 在時間元組中的任何位置都是合法引數;如果元組中出現常見的錯誤,該值將被強制" "更改為正確的值。" -#: ../../library/time.rst:443 +#: ../../library/time.rst:445 msgid "" "The following directives can be embedded in the *format* string. They are " "shown without the optional field width and precision specification, and are " @@ -712,151 +718,151 @@ msgstr "" "以下指令可以嵌入在 *format* 字串中。它們顯示時不帶可選的欄位寬度和精度規範," "並在 :func:`strftime` 的結果中被標示的字元替換:" -#: ../../library/time.rst:448 +#: ../../library/time.rst:450 msgid "Directive" msgstr "指令" -#: ../../library/time.rst:448 +#: ../../library/time.rst:450 msgid "Meaning" msgstr "意義" -#: ../../library/time.rst:448 +#: ../../library/time.rst:450 msgid "Notes" msgstr "註解" -#: ../../library/time.rst:450 +#: ../../library/time.rst:452 msgid "``%a``" msgstr "``%a``" -#: ../../library/time.rst:450 +#: ../../library/time.rst:452 msgid "Locale's abbreviated weekday name." msgstr "區域設定的週間日 (weekday) 縮寫名稱。" -#: ../../library/time.rst:453 +#: ../../library/time.rst:455 msgid "``%A``" msgstr "``%A``" -#: ../../library/time.rst:453 +#: ../../library/time.rst:455 msgid "Locale's full weekday name." msgstr "區域設定的完整週間日名稱。" -#: ../../library/time.rst:455 +#: ../../library/time.rst:457 msgid "``%b``" msgstr "``%b``" -#: ../../library/time.rst:455 +#: ../../library/time.rst:457 msgid "Locale's abbreviated month name." msgstr "區域設定的縮寫月份名稱。" -#: ../../library/time.rst:458 +#: ../../library/time.rst:460 msgid "``%B``" msgstr "``%B``" -#: ../../library/time.rst:458 +#: ../../library/time.rst:460 msgid "Locale's full month name." msgstr "區域設定的完整月份名稱。" -#: ../../library/time.rst:460 +#: ../../library/time.rst:462 msgid "``%c``" msgstr "``%c``" -#: ../../library/time.rst:460 +#: ../../library/time.rst:462 msgid "Locale's appropriate date and time representation." msgstr "區域設定的合適的日期和時間的表示法。" -#: ../../library/time.rst:463 +#: ../../library/time.rst:465 msgid "``%d``" msgstr "``%d``" -#: ../../library/time.rst:463 +#: ../../library/time.rst:465 msgid "Day of the month as a decimal number [01,31]." msgstr "月份中的日期,表示為十進位數 [01,31]。" -#: ../../library/time.rst:466 +#: ../../library/time.rst:468 msgid "``%f``" msgstr "``%f``" -#: ../../library/time.rst:466 +#: ../../library/time.rst:468 msgid "Microseconds as a decimal number" msgstr "微秒,表示為十進位數" -#: ../../library/time.rst:467 +#: ../../library/time.rst:469 msgid "[000000,999999]." msgstr "[000000,999999]。" -#: ../../library/time.rst:466 +#: ../../library/time.rst:468 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/time.rst:470 +#: ../../library/time.rst:472 msgid "``%H``" msgstr "``%H``" -#: ../../library/time.rst:470 +#: ../../library/time.rst:472 msgid "Hour (24-hour clock) as a decimal number [00,23]." msgstr "小時(24 小時制),表示為十進位數 [00,23]。" -#: ../../library/time.rst:473 +#: ../../library/time.rst:475 msgid "``%I``" msgstr "``%I``" -#: ../../library/time.rst:473 +#: ../../library/time.rst:475 msgid "Hour (12-hour clock) as a decimal number [01,12]." msgstr "小時(12 小時制),表示為十進位數 [01,12]。" -#: ../../library/time.rst:476 +#: ../../library/time.rst:478 msgid "``%j``" msgstr "``%j``" -#: ../../library/time.rst:476 +#: ../../library/time.rst:478 msgid "Day of the year as a decimal number [001,366]." msgstr "一年中的第幾天,表示為十進位數 [001,366]。" -#: ../../library/time.rst:479 +#: ../../library/time.rst:481 msgid "``%m``" msgstr "``%m``" -#: ../../library/time.rst:479 +#: ../../library/time.rst:481 msgid "Month as a decimal number [01,12]." msgstr "月份,表示為十進位數 [01,12]。" -#: ../../library/time.rst:482 +#: ../../library/time.rst:484 msgid "``%M``" msgstr "``%M``" -#: ../../library/time.rst:482 +#: ../../library/time.rst:484 msgid "Minute as a decimal number [00,59]." msgstr "分鐘,表示為十進位數 [00,59]。" -#: ../../library/time.rst:485 +#: ../../library/time.rst:487 msgid "``%p``" msgstr "``%p``" -#: ../../library/time.rst:485 +#: ../../library/time.rst:487 msgid "Locale's equivalent of either AM or PM." msgstr "區域設定中相當於 AM 或 PM 的表示。" -#: ../../library/time.rst:485 +#: ../../library/time.rst:487 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/time.rst:488 +#: ../../library/time.rst:490 msgid "``%S``" msgstr "``%S``" -#: ../../library/time.rst:488 +#: ../../library/time.rst:490 msgid "Second as a decimal number [00,61]." msgstr "秒,表示為十進位數 [00,61]。" -#: ../../library/time.rst:488 +#: ../../library/time.rst:490 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/time.rst:491 +#: ../../library/time.rst:493 msgid "``%U``" msgstr "``%U``" -#: ../../library/time.rst:491 +#: ../../library/time.rst:493 msgid "" "Week number of the year (Sunday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Sunday are " @@ -865,31 +871,31 @@ msgstr "" "一年中的週數(星期天作為一週的第一天),表示為十進位數 [00,53]。新的一年中," "在第一個星期天之前的所有日子都被認定為第 0 週。" -#: ../../library/time.rst:491 ../../library/time.rst:505 +#: ../../library/time.rst:493 ../../library/time.rst:507 msgid "\\(4)" msgstr "\\(4)" -#: ../../library/time.rst:499 +#: ../../library/time.rst:501 msgid "``%u``" msgstr "``%u``" -#: ../../library/time.rst:499 +#: ../../library/time.rst:501 msgid "Day of the week (Monday is 1; Sunday is 7) as a decimal number [1, 7]." msgstr "一週中的日期(周一為 1;週日為 7),表示為十進位數 [1,7]。" -#: ../../library/time.rst:502 +#: ../../library/time.rst:504 msgid "``%w``" msgstr "``%w``" -#: ../../library/time.rst:502 +#: ../../library/time.rst:504 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "週間日,表示為十進位數 [0(星期天),6]。" -#: ../../library/time.rst:505 +#: ../../library/time.rst:507 msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:505 +#: ../../library/time.rst:507 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Monday are " @@ -898,43 +904,43 @@ msgstr "" "一年中的週數(星期一作為一週的第一天),表示為十進位數 [00,53]。新的一年中," "在第一個星期一之前的所有日子都被認定為第 0 週。" -#: ../../library/time.rst:513 +#: ../../library/time.rst:515 msgid "``%x``" msgstr "``%x``" -#: ../../library/time.rst:513 +#: ../../library/time.rst:515 msgid "Locale's appropriate date representation." msgstr "區域設定的合適的日期表示法。" -#: ../../library/time.rst:516 +#: ../../library/time.rst:518 msgid "``%X``" msgstr "``%X``" -#: ../../library/time.rst:516 +#: ../../library/time.rst:518 msgid "Locale's appropriate time representation." msgstr "區域設定的合適的時間表示法。" -#: ../../library/time.rst:519 +#: ../../library/time.rst:521 msgid "``%y``" msgstr "``%y``" -#: ../../library/time.rst:519 +#: ../../library/time.rst:521 msgid "Year without century as a decimal number [00,99]." msgstr "去掉世紀的年份,表示為十進位數 [00,99]。" -#: ../../library/time.rst:522 +#: ../../library/time.rst:524 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/time.rst:522 +#: ../../library/time.rst:524 msgid "Year with century as a decimal number." msgstr "帶世紀的年份,表示為十進位數。" -#: ../../library/time.rst:525 +#: ../../library/time.rst:527 msgid "``%z``" msgstr "``%z``" -#: ../../library/time.rst:525 +#: ../../library/time.rst:527 msgid "" "Time zone offset indicating a positive or negative time difference from UTC/" "GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M " @@ -943,19 +949,19 @@ msgstr "" "時區偏移量,表示與 UTC/GMT 的正或負時間差,形式為 +HHMM 或 -HHMM,其中 H 代表" "十進位的小時數碼 (digits),M 代表十進位的分鐘數碼 [-23:59, +23:59]。 [1]_" -#: ../../library/time.rst:531 +#: ../../library/time.rst:533 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/time.rst:531 +#: ../../library/time.rst:533 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "時區名稱(如果不存在時區,則無字元)。已被棄用。 [1]_" -#: ../../library/time.rst:534 +#: ../../library/time.rst:536 msgid "``%G``" msgstr "``%G``" -#: ../../library/time.rst:534 +#: ../../library/time.rst:536 msgid "" "ISO 8601 year (similar to ``%Y`` but follows the rules for the ISO 8601 " "calendar year). The year starts with the week that contains the first " @@ -964,11 +970,11 @@ msgstr "" "ISO 8601 年(類似於 ``%Y``,但遵循 ISO 8601 日曆年的規則)。年份從包含該日曆" "年第一個星期四的那一週開始。" -#: ../../library/time.rst:539 +#: ../../library/time.rst:541 msgid "``%V``" msgstr "``%V``" -#: ../../library/time.rst:539 +#: ../../library/time.rst:541 msgid "" "ISO 8601 week number (as a decimal number [01,53]). The first week of the " "year is the one that contains the first Thursday of the year. Weeks start on " @@ -977,19 +983,19 @@ msgstr "" "ISO 8601 週數(以十進位數表示 [01,53])。年份的第一週是包含該年第一個星期四的" "那一週。每週從星期一開始。" -#: ../../library/time.rst:544 +#: ../../library/time.rst:546 msgid "``%%``" msgstr "``%%``" -#: ../../library/time.rst:544 +#: ../../library/time.rst:546 msgid "A literal ``'%'`` character." msgstr "字面意義上的 ``'%'`` 字元。" -#: ../../library/time.rst:547 +#: ../../library/time.rst:549 msgid "Notes:" msgstr "註解:" -#: ../../library/time.rst:550 +#: ../../library/time.rst:552 msgid "" "The ``%f`` format directive only applies to :func:`strptime`, not to :func:" "`strftime`. However, see also :meth:`datetime.datetime.strptime` and :meth:" @@ -1000,7 +1006,7 @@ msgstr "" "在 :meth:`datetime.datetime.strptime` 和 :meth:`datetime.datetime.strftime` " "其中的 ``%f`` 格式的指令\\ :ref:`適用於微秒 `。" -#: ../../library/time.rst:556 +#: ../../library/time.rst:558 msgid "" "When used with the :func:`strptime` function, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " @@ -1009,7 +1015,7 @@ msgstr "" "當與 :func:`strptime` 函式一起使用時,``%p`` 指令僅在使用 ``%I`` 指令剖析小時" "時影響輸出小時的欄位。" -#: ../../library/time.rst:562 +#: ../../library/time.rst:564 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " @@ -1018,7 +1024,7 @@ msgstr "" "範圍確實是從 ``0`` 到 ``61``;數值 ``60`` 在表示 `leap seconds`_ 的時間戳中是" "有效的,而數值 ``61`` 是出於歷史因素而被支援。" -#: ../../library/time.rst:567 +#: ../../library/time.rst:569 msgid "" "When used with the :func:`strptime` function, ``%U`` and ``%W`` are only " "used in calculations when the day of the week and the year are specified." @@ -1026,7 +1032,7 @@ msgstr "" "當與 :func:`strptime` 函式一起使用時,``%U`` 和 ``%W`` 僅在指定週間的某天和年" "份時用於計算中。" -#: ../../library/time.rst:570 +#: ../../library/time.rst:572 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" @@ -1034,7 +1040,7 @@ msgstr "" "以下是一個範例,其為一種與 :rfc:`2822` 網際網路電子郵件標準中指定的日期格式兼" "容的格式。 [1]_: ::" -#: ../../library/time.rst:573 +#: ../../library/time.rst:575 msgid "" ">>> from time import gmtime, strftime\n" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" @@ -1044,7 +1050,7 @@ msgstr "" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" "'Thu, 28 Jun 2001 14:17:15 +0000'" -#: ../../library/time.rst:577 +#: ../../library/time.rst:579 msgid "" "Additional directives may be supported on certain platforms, but only the " "ones listed here have a meaning standardized by ANSI C. To see the full set " @@ -1054,7 +1060,7 @@ msgstr "" "某些平台可能支援額外的指令,但只有這裡列出的指令具有 ANSI C 標準化的意義。要" "查看你的平台上支援的完整格式碼集,請參閱 :manpage:`strftime(3)` 文件。" -#: ../../library/time.rst:582 +#: ../../library/time.rst:584 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -1064,7 +1070,7 @@ msgstr "" "在某些平台上,可選的欄位寬度和精度規範可以以此順序緊跟在指令初始的 ``'%'`` 之" "後;這也是不可攜 (portable) 的。欄位寬度通常為 2,除了 ``%j`` 為 3。" -#: ../../library/time.rst:593 +#: ../../library/time.rst:595 msgid "" "Parse a string representing a time according to a format. The return value " "is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." @@ -1072,7 +1078,7 @@ msgstr "" "根據格式剖析表示時間的字串。回傳值是 :class:`struct_time`,如同由 :func:" "`gmtime` 或 :func:`localtime` 回傳的一樣。" -#: ../../library/time.rst:597 +#: ../../library/time.rst:599 msgid "" "The *format* parameter uses the same directives as those used by :func:" "`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches the " @@ -1088,11 +1094,11 @@ msgstr "" "時,用來填充任何缺失資料的預設值為 ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``。" "*string* 和 *format* 都必須是字串。" -#: ../../library/time.rst:605 +#: ../../library/time.rst:607 msgid "For example:" msgstr "例如:" -#: ../../library/time.rst:612 +#: ../../library/time.rst:614 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -1103,7 +1109,7 @@ msgstr "" "因此,除了識別始終已知的 UTC 和 GMT(且被考慮為非日光節約時區)外,這是特定於" "平台的。" -#: ../../library/time.rst:617 +#: ../../library/time.rst:619 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -1115,7 +1121,7 @@ msgstr "" "提供比列出的還要更多的指令。但是 ``strptime()`` 與任何平台無關,因此不一定支" "援所有未記載為支援的指令。" -#: ../../library/time.rst:626 +#: ../../library/time.rst:628 msgid "" "The type of the time value sequence returned by :func:`gmtime`, :func:" "`localtime`, and :func:`strptime`. It is an object with a :term:`named " @@ -1126,110 +1132,110 @@ msgstr "" "別。它是一個具有 :term:`named tuple` 介面的物件:值可以通過索引和屬性名稱存" "取。包含以下值:" -#: ../../library/time.rst:633 +#: ../../library/time.rst:635 msgid "Index" msgstr "索引" -#: ../../library/time.rst:634 +#: ../../library/time.rst:636 msgid "Attribute" msgstr "屬性" -#: ../../library/time.rst:635 +#: ../../library/time.rst:637 msgid "Values" msgstr "值" -#: ../../library/time.rst:637 +#: ../../library/time.rst:639 msgid "0" msgstr "0" -#: ../../library/time.rst:639 +#: ../../library/time.rst:641 msgid "(for example, 1993)" msgstr "(例如 1993)" -#: ../../library/time.rst:641 +#: ../../library/time.rst:643 msgid "1" msgstr "1" -#: ../../library/time.rst:643 +#: ../../library/time.rst:645 msgid "range [1, 12]" msgstr "範圍 [1, 12]" -#: ../../library/time.rst:645 +#: ../../library/time.rst:647 msgid "2" msgstr "2" -#: ../../library/time.rst:647 +#: ../../library/time.rst:649 msgid "range [1, 31]" msgstr "範圍 [1, 31]" -#: ../../library/time.rst:649 +#: ../../library/time.rst:651 msgid "3" msgstr "3" -#: ../../library/time.rst:651 +#: ../../library/time.rst:653 msgid "range [0, 23]" msgstr "範圍 [0, 23]" -#: ../../library/time.rst:653 +#: ../../library/time.rst:655 msgid "4" msgstr "4" -#: ../../library/time.rst:655 +#: ../../library/time.rst:657 msgid "range [0, 59]" msgstr "範圍 [0, 59]" -#: ../../library/time.rst:657 +#: ../../library/time.rst:659 msgid "5" msgstr "5" -#: ../../library/time.rst:659 +#: ../../library/time.rst:661 msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" "範圍 [0, 61];參見 :func:`strftime` 中的\\ :ref:`註釋 (2) `" -#: ../../library/time.rst:661 +#: ../../library/time.rst:663 msgid "6" msgstr "6" -#: ../../library/time.rst:663 +#: ../../library/time.rst:665 msgid "range [0, 6]; Monday is 0" msgstr "範圍 [0, 6];星期一是 0" -#: ../../library/time.rst:665 +#: ../../library/time.rst:667 msgid "7" msgstr "7" -#: ../../library/time.rst:667 +#: ../../library/time.rst:669 msgid "range [1, 366]" msgstr "範圍 [1, 366]" -#: ../../library/time.rst:669 +#: ../../library/time.rst:671 msgid "8" msgstr "8" -#: ../../library/time.rst:671 +#: ../../library/time.rst:673 msgid "0, 1 or -1; see below" msgstr "0、1 或 -1;見下文" -#: ../../library/time.rst:673 ../../library/time.rst:677 +#: ../../library/time.rst:675 ../../library/time.rst:679 msgid "N/A" msgstr "N/A" -#: ../../library/time.rst:675 +#: ../../library/time.rst:677 msgid "abbreviation of timezone name" msgstr "時區名稱的縮寫" -#: ../../library/time.rst:679 +#: ../../library/time.rst:681 msgid "offset east of UTC in seconds" msgstr "UTC 向東的偏移量(以秒為單位)" -#: ../../library/time.rst:681 +#: ../../library/time.rst:683 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "請注意,與 C 結構不同,月份值的範圍是 [1, 12],而不是 [0, 11]。" -#: ../../library/time.rst:684 +#: ../../library/time.rst:686 msgid "" "In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight " "savings time is in effect, and 0 when it is not. A value of -1 indicates " @@ -1239,7 +1245,7 @@ msgstr "" "在呼叫 :func:`mktime` 時,當日光節約時間生效的時候,:attr:`tm_isdst` 可以設定" "為 1,不生效時設定為 0。值 -1 表示未知是否生效,通常結果會填入正確的狀態。" -#: ../../library/time.rst:688 +#: ../../library/time.rst:690 msgid "" "When a tuple with an incorrect length is passed to a function expecting a :" "class:`struct_time`, or having elements of the wrong type, a :exc:" @@ -1248,7 +1254,7 @@ msgstr "" "當一個長度不正確的元組被傳遞給預期得到 :class:`struct_time` 的函式時,或者其" "中有元素型別錯誤時,將引發 :exc:`TypeError`。" -#: ../../library/time.rst:694 +#: ../../library/time.rst:696 msgid "" "Return the time in seconds since the epoch_ as a floating-point number. The " "handling of `leap seconds`_ is platform dependent. On Windows and most Unix " @@ -1260,7 +1266,7 @@ msgstr "" "關的。在 Windows 和大多數 Unix 系統上,閏秒不計入自 epoch_ 起的秒數中。這通常" "被稱為 `Unix 時間 `_。" -#: ../../library/time.rst:700 +#: ../../library/time.rst:702 msgid "" "Note that even though the time is always returned as a floating-point " "number, not all systems provide time with a better precision than 1 second. " @@ -1272,7 +1278,7 @@ msgstr "" "間。雖然此函式通常回傳非遞減的值,但如果在兩次呼叫之間系統時鐘被回調,則它可" "能回傳比之前呼叫更小的值。" -#: ../../library/time.rst:706 +#: ../../library/time.rst:708 msgid "" "The number returned by :func:`.time` may be converted into a more common " "time format (i.e. year, month, day, hour, etc...) in UTC by passing it to :" @@ -1286,25 +1292,25 @@ msgstr "" "為當地時間。在這兩種情況下都會回傳一個 :class:`struct_time` 物件,從中可以作" "為屬性存取日曆日期的組成部分。" -#: ../../library/time.rst:715 +#: ../../library/time.rst:717 msgid "On Windows, call ``GetSystemTimePreciseAsFileTime()``." msgstr "在 Windows 上,呼叫 ``GetSystemTimePreciseAsFileTime()``。" -#: ../../library/time.rst:716 +#: ../../library/time.rst:718 msgid "Call ``clock_gettime(CLOCK_REALTIME)`` if available." msgstr "如果可以的話,呼叫 ``clock_gettime(CLOCK_REALTIME)``。" -#: ../../library/time.rst:717 +#: ../../library/time.rst:719 msgid "Otherwise, call ``gettimeofday()``." msgstr "否則,呼叫 ``gettimeofday()``。" -#: ../../library/time.rst:719 +#: ../../library/time.rst:721 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "使用 :func:`time_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:724 +#: ../../library/time.rst:726 msgid "" "On Windows, calls ``GetSystemTimePreciseAsFileTime()`` instead of " "``GetSystemTimeAsFileTime()``." @@ -1312,13 +1318,13 @@ msgstr "" "在 Windows 上,呼叫 ``GetSystemTimePreciseAsFileTime()`` 而不是 " "``GetSystemTimeAsFileTime()``。" -#: ../../library/time.rst:730 +#: ../../library/time.rst:732 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "類似於 :func:`~time.time`,但回傳自 epoch_ 起的以奈秒為單位的整數。" -#: ../../library/time.rst:743 +#: ../../library/time.rst:745 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current thread. It does not include time elapsed during " @@ -1330,22 +1336,22 @@ msgstr "" "期間經過的時間。根據定義,這是執行緒特定 (thread-specific) 的。回傳值的參照點" "未定義,因此只有同一執行緒中兩次呼叫結果之間的差異才是有效的。" -#: ../../library/time.rst:749 +#: ../../library/time.rst:751 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" "使用 :func:`thread_time_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:754 +#: ../../library/time.rst:756 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "有支援 ``CLOCK_THREAD_CPUTIME_ID`` 的 Unix 系統。" -#: ../../library/time.rst:761 +#: ../../library/time.rst:763 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "類似於 :func:`thread_time`,但回傳以奈秒為單位的時間。" -#: ../../library/time.rst:768 +#: ../../library/time.rst:770 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1362,7 +1368,7 @@ msgstr "" "``daylight``\\ (如果該時區沒有日光節約時間規則,則設定為 0;如果在過去、現在" "或未來的某個時間有日光節約時間規則,則設置為非零的值)。" -#: ../../library/time.rst:780 +#: ../../library/time.rst:782 msgid "" "Although in many cases, changing the :envvar:`TZ` environment variable may " "affect the output of functions like :func:`localtime` without calling :func:" @@ -1371,30 +1377,30 @@ msgstr "" "雖然在許多情況下,更改 :envvar:`TZ` 環境變數可能會在沒有呼叫 :func:`tzset` 的" "情況下影響 :func:`localtime` 等函式的輸出,但是這種行為是不該被依賴的。" -#: ../../library/time.rst:784 +#: ../../library/time.rst:786 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr ":envvar:`TZ` 環境變數不應包含空格字元。" -#: ../../library/time.rst:786 +#: ../../library/time.rst:788 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" ":envvar:`TZ` 環境變數的標準格式為(為了清楚表達,中間增加了空格字元): ::" -#: ../../library/time.rst:789 +#: ../../library/time.rst:791 msgid "std offset [dst [offset [,start[/time], end[/time]]]]" msgstr "std offset [dst [offset [,start[/time], end[/time]]]]" -#: ../../library/time.rst:791 +#: ../../library/time.rst:793 msgid "Where the components are:" msgstr "其中各個組成部分為:" -#: ../../library/time.rst:793 +#: ../../library/time.rst:795 msgid "``std`` and ``dst``" msgstr "``std`` 和 ``dst``" -#: ../../library/time.rst:794 +#: ../../library/time.rst:796 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" @@ -1402,11 +1408,11 @@ msgstr "" "三個或更多字母與數字 (alphanumerics) 組成的時區縮寫。這些縮寫會被傳播到 time." "tzname 中。" -#: ../../library/time.rst:797 +#: ../../library/time.rst:799 msgid "``offset``" msgstr "``offset``" -#: ../../library/time.rst:798 +#: ../../library/time.rst:800 msgid "" "The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added " "the local time to arrive at UTC. If preceded by a '-', the timezone is east " @@ -1417,22 +1423,22 @@ msgstr "" "果以 '-' 開頭,則表示該時區位於本初子午線以東;否則,位於其西。如果 dst 之後" "沒有偏移量,則假定日光時間比標準時間快一小時。" -#: ../../library/time.rst:803 +#: ../../library/time.rst:805 msgid "``start[/time], end[/time]``" msgstr "``start[/time], end[/time]``" -#: ../../library/time.rst:804 +#: ../../library/time.rst:806 msgid "" "Indicates when to change to and back from DST. The format of the start and " "end dates are one of the following:" msgstr "" "表示何時切換至日光節約時間及何時切換回來。開始和結束日期的格式如以下其一:" -#: ../../library/time.rst:807 +#: ../../library/time.rst:809 msgid ":samp:`J{n}`" msgstr ":samp:`J{n}`" -#: ../../library/time.rst:808 +#: ../../library/time.rst:810 msgid "" "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " "years February 28 is day 59 and March 1 is day 60." @@ -1440,22 +1446,22 @@ msgstr "" "儒略日 (Julian day) *n*(1 <= *n* <= 365)。閏日不計算,因此在所有年份中,2 " "月 28 日是第 59 天,3 月 1 日是第 60 天。" -#: ../../library/time.rst:811 +#: ../../library/time.rst:813 msgid ":samp:`{n}`" msgstr ":samp:`{n}`" -#: ../../library/time.rst:812 +#: ../../library/time.rst:814 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" "從 0 開始的儒略日 (0 <= *n* <= 365)。閏日會計算,因此可以適用至 2 月 29 日。" -#: ../../library/time.rst:815 +#: ../../library/time.rst:817 msgid ":samp:`M{m}.{n}.{d}`" msgstr ":samp:`M{m}.{n}.{d}`" -#: ../../library/time.rst:816 +#: ../../library/time.rst:818 msgid "" "The *d*'th day (0 <= *d* <= 6) of week *n* of month *m* of the year (1 <= " "*n* <= 5, 1 <= *m* <= 12, where week 5 means \"the last *d* day in month " @@ -1466,7 +1472,7 @@ msgstr "" "*m* <= 12,其中 *n* 為 5 表示「該月的最後一個第 *d* 天」,這可能出現在第四或" "第五週)。第 1 週是 *d* 天首次出現的那一週。第零天為星期天。" -#: ../../library/time.rst:822 +#: ../../library/time.rst:824 msgid "" "``time`` has the same format as ``offset`` except that no leading sign ('-' " "or '+') is allowed. The default, if time is not given, is 02:00:00." @@ -1474,7 +1480,7 @@ msgstr "" "``time`` 的格式與 ``offset`` 相同,但不允許出現前導符號('-' 或 '+')。如果未" "指定時間,則預設為 02:00:00。" -#: ../../library/time.rst:827 +#: ../../library/time.rst:829 msgid "" ">>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'\n" ">>> time.tzset()\n" @@ -1494,7 +1500,7 @@ msgstr "" ">>> time.strftime('%X %x %Z')\n" "'16:08:12 05/08/03 AEST'" -#: ../../library/time.rst:836 +#: ../../library/time.rst:838 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1511,7 +1517,7 @@ msgstr "" "Eastern'``、``'Australia/Melbourne'``、``'Egypt'`` 或 ``'Europe/" "Amsterdam'``。 ::" -#: ../../library/time.rst:844 +#: ../../library/time.rst:846 msgid "" ">>> os.environ['TZ'] = 'US/Eastern'\n" ">>> time.tzset()\n" @@ -1531,24 +1537,24 @@ msgstr "" ">>> time.tzname\n" "('EET', 'EEST')" -#: ../../library/time.rst:857 +#: ../../library/time.rst:859 msgid "Clock ID Constants" msgstr "時鐘 ID 常數" -#: ../../library/time.rst:859 +#: ../../library/time.rst:861 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." msgstr "這些常數用作 :func:`clock_getres` 和 :func:`clock_gettime` 的參數。" -#: ../../library/time.rst:864 +#: ../../library/time.rst:866 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" "與 :data:`CLOCK_MONOTONIC` 基本相同,不同之處在於它還包括系統暫停的任何時間。" -#: ../../library/time.rst:867 +#: ../../library/time.rst:869 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " @@ -1559,7 +1565,7 @@ msgstr "" "`CLOCK_REALTIME` 的複雜情況,後者在使用 ``settimeofday()`` 或類似函式更改時間" "時可能會出現不連續的情況。" -#: ../../library/time.rst:879 +#: ../../library/time.rst:881 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " @@ -1568,13 +1574,13 @@ msgstr "" "Solaris 作業系統具有 ``CLOCK_HIGHRES`` 計時器,它嘗試使用最佳的硬體資源,並可" "能提供接近奈秒的解析度。``CLOCK_HIGHRES`` 是不可調整且高解析度的時鐘。" -#: ../../library/time.rst:890 +#: ../../library/time.rst:892 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "該時鐘無法被設定,其表示自某個未指定起點以來的單調時間。" -#: ../../library/time.rst:900 +#: ../../library/time.rst:902 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." @@ -1582,7 +1588,7 @@ msgstr "" "類似於 :data:`CLOCK_MONOTONIC`,但提供對基於硬體的原始時間的存取,此時間不受 " "NTP 調整的影響。" -#: ../../library/time.rst:909 +#: ../../library/time.rst:911 msgid "" "Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the " "system at context switch and hence has less accuracy." @@ -1590,11 +1596,11 @@ msgstr "" "類似於 :data:`CLOCK_MONOTONIC_RAW`,但讀取的是系統在情境切換時快取的值,因此" "精準度較低。" -#: ../../library/time.rst:919 ../../library/time.rst:928 +#: ../../library/time.rst:921 ../../library/time.rst:930 msgid "High-resolution per-process timer from the CPU." msgstr "來自 CPU 的高解析度每個行程的計時器。" -#: ../../library/time.rst:936 +#: ../../library/time.rst:938 msgid "" "`International Atomic Time `_" @@ -1602,18 +1608,18 @@ msgstr "" "`國際原子時間 `_" -#: ../../library/time.rst:938 +#: ../../library/time.rst:940 msgid "" "The system must have a current leap second table in order for this to give " "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" "系統必須擁有目前的閏秒表才能給出正確答案。PTP 或 NTP 軟體可以維護閏秒表。" -#: ../../library/time.rst:947 +#: ../../library/time.rst:949 msgid "Thread-specific CPU-time clock." msgstr "執行緒相關的 CPU 時間時鐘。" -#: ../../library/time.rst:956 +#: ../../library/time.rst:958 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." @@ -1621,7 +1627,7 @@ msgstr "" "表示系統運作且無暫停的絕對時間,提供包括絕對時間 (absolute) 和時間區間 " "(interval) 的精確的正常上線時間 (uptime) 測量。" -#: ../../library/time.rst:967 +#: ../../library/time.rst:969 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " @@ -1630,7 +1636,7 @@ msgstr "" "單調增量的時鐘,從某個任意點開始計時,不受頻率或時間調整影響,並且在系統休眠" "時不增量。" -#: ../../library/time.rst:977 +#: ../../library/time.rst:979 msgid "" "Like :data:`CLOCK_UPTIME_RAW`, but the value is cached by the system at " "context switches and therefore has less accuracy." @@ -1638,23 +1644,24 @@ msgstr "" "類似於 :data:`CLOCK_UPTIME_RAW`,但該值在情境切換時由系統快取,因此精準度較" "低。" -#: ../../library/time.rst:984 +#: ../../library/time.rst:986 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." msgstr "以下常數是唯一可以傳遞給 :func:`clock_settime` 的參數。" -#: ../../library/time.rst:990 +#: ../../library/time.rst:992 +#, fuzzy msgid "" -"System-wide real-time clock. Setting this clock requires appropriate " -"privileges." +"Real-time clock. Setting this clock requires appropriate privileges. The " +"clock is the same for all processes." msgstr "涵蓋整個系統的即時時鐘。設定此時鐘需要適當的權限。" -#: ../../library/time.rst:1001 +#: ../../library/time.rst:1003 msgid "Timezone Constants" msgstr "時區常數" -#: ../../library/time.rst:1005 +#: ../../library/time.rst:1007 msgid "" "The offset of the local DST timezone, in seconds west of UTC, if one is " "defined. This is negative if the local DST timezone is east of UTC (as in " @@ -1665,11 +1672,11 @@ msgstr "" "為單位)。若本地 DST 時區位於 UTC 以東(例如包括英國在內的西歐),則此值為負" "值。僅在 ``daylight`` 為非零時使用此值。詳情請參見下方註釋。" -#: ../../library/time.rst:1011 +#: ../../library/time.rst:1013 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "如果定義了 DST 時區,則為非零值。詳情請參見下方註釋。" -#: ../../library/time.rst:1015 +#: ../../library/time.rst:1017 msgid "" "The offset of the local (non-DST) timezone, in seconds west of UTC (negative " "in most of Western Europe, positive in the US, zero in the UK). See note " @@ -1678,7 +1685,7 @@ msgstr "" "本地(非 DST)時區相對於 UTC 以西的偏移量(以秒為單位),西歐大多數地區為負," "美國為正,英國為零。詳情請參見下方註釋。" -#: ../../library/time.rst:1020 +#: ../../library/time.rst:1022 msgid "" "A tuple of two strings: the first is the name of the local non-DST timezone, " "the second is the name of the local DST timezone. If no DST timezone is " @@ -1687,7 +1694,7 @@ msgstr "" "一個包含兩個字串的元組:第一個是本地非 DST 時區的名稱,第二個是本地 DST 時區" "的名稱。如果沒有定義 DST 時區,則不應使用第二個字串。詳情請參見下方註釋。" -#: ../../library/time.rst:1026 +#: ../../library/time.rst:1028 msgid "" "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" "`timezone`, and :data:`tzname`), the value is determined by the timezone " @@ -1701,19 +1708,19 @@ msgstr "" "決定,且過去的時間可能會不準確。建議使用 :func:`localtime` 回傳的 :attr:" "`~struct_time.tm_gmtoff` 和 :attr:`~struct_time.tm_zone` 來取得時區資訊。" -#: ../../library/time.rst:1035 +#: ../../library/time.rst:1037 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/time.rst:1036 +#: ../../library/time.rst:1038 msgid "More object-oriented interface to dates and times." msgstr "更多物件導向的日期和時間介面。" -#: ../../library/time.rst:1038 +#: ../../library/time.rst:1040 msgid "Module :mod:`locale`" msgstr ":mod:`locale` 模組" -#: ../../library/time.rst:1039 +#: ../../library/time.rst:1041 msgid "" "Internationalization services. The locale setting affects the " "interpretation of many format specifiers in :func:`strftime` and :func:" @@ -1722,11 +1729,11 @@ msgstr "" "國際化服務。區域設定會影響 :func:`strftime` 和 :func:`strptime` 中許多格式指" "定符號 (format specifiers) 的解譯。" -#: ../../library/time.rst:1042 +#: ../../library/time.rst:1044 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/time.rst:1043 +#: ../../library/time.rst:1045 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." @@ -1734,11 +1741,11 @@ msgstr "" "通用的日曆相關函式。:func:`~calendar.timegm` 是本模組中 :func:`gmtime` 的反函" "式。" -#: ../../library/time.rst:1047 +#: ../../library/time.rst:1049 msgid "Footnotes" msgstr "註解" -#: ../../library/time.rst:1048 +#: ../../library/time.rst:1050 msgid "" "The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to " "the preferred hour/minute offset is not supported by all ANSI C libraries. " @@ -1782,24 +1789,24 @@ msgstr "Greenwich Mean Time(格林威治標準時間)" msgid "Daylight Saving Time" msgstr "Daylight Saving Time(日光節約時間)" -#: ../../library/time.rst:323 ../../library/time.rst:358 -#: ../../library/time.rst:738 +#: ../../library/time.rst:324 ../../library/time.rst:360 +#: ../../library/time.rst:740 msgid "benchmarking" msgstr "benchmarking(基準測試)" -#: ../../library/time.rst:358 ../../library/time.rst:738 +#: ../../library/time.rst:360 ../../library/time.rst:740 msgid "CPU time" msgstr "CPU time(CPU 時間)" -#: ../../library/time.rst:358 ../../library/time.rst:738 +#: ../../library/time.rst:360 ../../library/time.rst:740 msgid "processor time" msgstr "processor time(處理器時間)" -#: ../../library/time.rst:429 ../../library/time.rst:588 +#: ../../library/time.rst:431 ../../library/time.rst:590 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/time.rst:429 ../../library/time.rst:588 +#: ../../library/time.rst:431 ../../library/time.rst:590 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 2be2bb9af4..95b4ca04fe 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-07 10:49+0000\n" +"POT-Creation-Date: 2025-07-10 00:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1847,7 +1847,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1141 msgid "" ":func:`codecs.lookup` now normalizes the encoding name the same way as :func:" -"`!encodings.normalize_encoding`, except that :func:`codecs.lookup` also " +"`encodings.normalize_encoding`, except that :func:`codecs.lookup` also " "converts the name to lower case. For example, ``\"latex+latin1\"`` encoding " "name is now normalized to ``\"latex_latin1\"``. (Contributed by Jordon Xu " "in :issue:`37751`.)" From 53c050da9a82729b806c54e12b2486a25885e2b1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 11 Jul 2025 00:18:22 +0000 Subject: [PATCH 4/6] sync with cpython aa3c6421 --- c-api/exceptions.po | 1095 +++++++++++++++++++------------------------ library/codecs.po | 14 +- 2 files changed, 485 insertions(+), 624 deletions(-) diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 925d646e9a..3598f13943 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-07-11 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1037,478 +1037,259 @@ msgid "" msgstr "" #: ../../c-api/exceptions.rst:974 -msgid "Standard Exceptions" -msgstr "" +#, fuzzy +msgid "Exception and warning types" +msgstr "例外處理" #: ../../c-api/exceptions.rst:976 msgid "" -"All standard Python exceptions are available as global variables whose names " -"are ``PyExc_`` followed by the Python exception name. These have the type :" -"c:expr:`PyObject*`; they are all class objects. For completeness, here are " -"all the variables:" +"All standard Python exceptions and warning categories are available as " +"global variables whose names are ``PyExc_`` followed by the Python exception " +"name. These have the type :c:expr:`PyObject*`; they are all class objects." msgstr "" -#: ../../c-api/exceptions.rst:1039 ../../c-api/exceptions.rst:1179 -#: ../../c-api/exceptions.rst:1225 -msgid "C Name" -msgstr "C 名稱" +#: ../../c-api/exceptions.rst:980 +msgid "For completeness, here are all the variables:" +msgstr "" -#: ../../c-api/exceptions.rst:1039 ../../c-api/exceptions.rst:1225 -msgid "Python Name" -msgstr "Python 名稱" +#: ../../c-api/exceptions.rst:983 +#, fuzzy +msgid "Exception types" +msgstr "例外類別" -#: ../../c-api/exceptions.rst:1039 ../../c-api/exceptions.rst:1179 -#: ../../c-api/exceptions.rst:1225 -msgid "Notes" -msgstr "註解" +#: ../../c-api/exceptions.rst:990 ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1166 +msgid "C name" +msgstr "" -#: ../../c-api/exceptions.rst:1041 -msgid ":c:data:`PyExc_BaseException`" -msgstr ":c:data:`PyExc_BaseException`" +#: ../../c-api/exceptions.rst:991 ../../c-api/exceptions.rst:1137 +#: ../../c-api/exceptions.rst:1167 +#, fuzzy +msgid "Python name" +msgstr "Python 名稱" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:993 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1041 ../../c-api/exceptions.rst:1043 -#: ../../c-api/exceptions.rst:1045 ../../c-api/exceptions.rst:1047 -#: ../../c-api/exceptions.rst:1093 ../../c-api/exceptions.rst:1105 -msgid "[1]_" -msgstr "[1]_" - -#: ../../c-api/exceptions.rst:1043 -msgid ":c:data:`PyExc_BaseExceptionGroup`" -msgstr ":c:data:`PyExc_BaseExceptionGroup`" - -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:995 msgid ":exc:`BaseExceptionGroup`" msgstr ":exc:`BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1045 -msgid ":c:data:`PyExc_Exception`" -msgstr ":c:data:`PyExc_Exception`" - -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:997 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1047 -msgid ":c:data:`PyExc_ArithmeticError`" -msgstr ":c:data:`PyExc_ArithmeticError`" - -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:999 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1049 -msgid ":c:data:`PyExc_AssertionError`" -msgstr ":c:data:`PyExc_AssertionError`" - -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1001 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1051 -msgid ":c:data:`PyExc_AttributeError`" -msgstr ":c:data:`PyExc_AttributeError`" - -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1003 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1053 -msgid ":c:data:`PyExc_BlockingIOError`" -msgstr ":c:data:`PyExc_BlockingIOError`" - -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1005 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1055 -msgid ":c:data:`PyExc_BrokenPipeError`" -msgstr ":c:data:`PyExc_BrokenPipeError`" - -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1007 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1057 -msgid ":c:data:`PyExc_BufferError`" -msgstr ":c:data:`PyExc_BufferError`" - -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1009 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1059 -msgid ":c:data:`PyExc_ChildProcessError`" -msgstr ":c:data:`PyExc_ChildProcessError`" - -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1011 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1061 -msgid ":c:data:`PyExc_ConnectionAbortedError`" -msgstr ":c:data:`PyExc_ConnectionAbortedError`" - -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1013 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1063 -msgid ":c:data:`PyExc_ConnectionError`" -msgstr ":c:data:`PyExc_ConnectionError`" - -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1015 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1065 -msgid ":c:data:`PyExc_ConnectionRefusedError`" -msgstr ":c:data:`PyExc_ConnectionRefusedError`" - -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1017 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1067 -msgid ":c:data:`PyExc_ConnectionResetError`" -msgstr ":c:data:`PyExc_ConnectionResetError`" - -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1019 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1069 -msgid ":c:data:`PyExc_EOFError`" -msgstr ":c:data:`PyExc_EOFError`" - -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1021 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1071 -msgid ":c:data:`PyExc_FileExistsError`" -msgstr ":c:data:`PyExc_FileExistsError`" - -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1023 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1073 -msgid ":c:data:`PyExc_FileNotFoundError`" -msgstr ":c:data:`PyExc_FileNotFoundError`" - -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1075 -msgid ":c:data:`PyExc_FloatingPointError`" -msgstr ":c:data:`PyExc_FloatingPointError`" - -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1077 -msgid ":c:data:`PyExc_GeneratorExit`" -msgstr ":c:data:`PyExc_GeneratorExit`" - -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1079 -msgid ":c:data:`PyExc_ImportError`" -msgstr ":c:data:`PyExc_ImportError`" - -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1081 -msgid ":c:data:`PyExc_IndentationError`" -msgstr ":c:data:`PyExc_IndentationError`" - -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1083 -msgid ":c:data:`PyExc_IndexError`" -msgstr ":c:data:`PyExc_IndexError`" - -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1085 -msgid ":c:data:`PyExc_InterruptedError`" -msgstr ":c:data:`PyExc_InterruptedError`" - -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1087 -msgid ":c:data:`PyExc_IsADirectoryError`" -msgstr ":c:data:`PyExc_IsADirectoryError`" - -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1089 -msgid ":c:data:`PyExc_KeyError`" -msgstr ":c:data:`PyExc_KeyError`" - -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1091 -msgid ":c:data:`PyExc_KeyboardInterrupt`" -msgstr ":c:data:`PyExc_KeyboardInterrupt`" - -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1093 -msgid ":c:data:`PyExc_LookupError`" -msgstr ":c:data:`PyExc_LookupError`" - -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1095 -msgid ":c:data:`PyExc_MemoryError`" -msgstr ":c:data:`PyExc_MemoryError`" - -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1047 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1097 -msgid ":c:data:`PyExc_ModuleNotFoundError`" -msgstr ":c:data:`PyExc_ModuleNotFoundError`" - -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1049 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1099 -msgid ":c:data:`PyExc_NameError`" -msgstr ":c:data:`PyExc_NameError`" - -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1051 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1101 -msgid ":c:data:`PyExc_NotADirectoryError`" -msgstr ":c:data:`PyExc_NotADirectoryError`" - -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1053 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1103 -msgid ":c:data:`PyExc_NotImplementedError`" -msgstr ":c:data:`PyExc_NotImplementedError`" - -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1055 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1105 -msgid ":c:data:`PyExc_OSError`" -msgstr ":c:data:`PyExc_OSError`" - -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1057 ../../c-api/exceptions.rst:1140 +#: ../../c-api/exceptions.rst:1143 ../../c-api/exceptions.rst:1146 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1107 -msgid ":c:data:`PyExc_OverflowError`" -msgstr ":c:data:`PyExc_OverflowError`" - -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1059 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1109 -msgid ":c:data:`PyExc_PermissionError`" -msgstr ":c:data:`PyExc_PermissionError`" - -#: ../../c-api/exceptions.rst:1109 +#: ../../c-api/exceptions.rst:1061 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1111 -msgid ":c:data:`PyExc_ProcessLookupError`" -msgstr ":c:data:`PyExc_ProcessLookupError`" - -#: ../../c-api/exceptions.rst:1111 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1113 -msgid ":c:data:`PyExc_PythonFinalizationError`" -msgstr ":c:data:`PyExc_PythonFinalizationError`" - -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`PythonFinalizationError`" msgstr ":exc:`PythonFinalizationError`" -#: ../../c-api/exceptions.rst:1115 -msgid ":c:data:`PyExc_RecursionError`" -msgstr ":c:data:`PyExc_RecursionError`" - -#: ../../c-api/exceptions.rst:1115 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1117 -msgid ":c:data:`PyExc_ReferenceError`" -msgstr ":c:data:`PyExc_ReferenceError`" - -#: ../../c-api/exceptions.rst:1117 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1119 -msgid ":c:data:`PyExc_RuntimeError`" -msgstr ":c:data:`PyExc_RuntimeError`" - -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1121 -msgid ":c:data:`PyExc_StopAsyncIteration`" -msgstr ":c:data:`PyExc_StopAsyncIteration`" - -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1123 -msgid ":c:data:`PyExc_StopIteration`" -msgstr ":c:data:`PyExc_StopIteration`" - -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1125 -msgid ":c:data:`PyExc_SyntaxError`" -msgstr ":c:data:`PyExc_SyntaxError`" - -#: ../../c-api/exceptions.rst:1125 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1127 -msgid ":c:data:`PyExc_SystemError`" -msgstr ":c:data:`PyExc_SystemError`" - -#: ../../c-api/exceptions.rst:1127 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1129 -msgid ":c:data:`PyExc_SystemExit`" -msgstr ":c:data:`PyExc_SystemExit`" - -#: ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1131 -msgid ":c:data:`PyExc_TabError`" -msgstr ":c:data:`PyExc_TabError`" - -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1133 -msgid ":c:data:`PyExc_TimeoutError`" -msgstr ":c:data:`PyExc_TimeoutError`" - -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1135 -msgid ":c:data:`PyExc_TypeError`" -msgstr ":c:data:`PyExc_TypeError`" - -#: ../../c-api/exceptions.rst:1135 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1137 -msgid ":c:data:`PyExc_UnboundLocalError`" -msgstr ":c:data:`PyExc_UnboundLocalError`" - -#: ../../c-api/exceptions.rst:1137 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1139 -msgid ":c:data:`PyExc_UnicodeDecodeError`" -msgstr ":c:data:`PyExc_UnicodeDecodeError`" - -#: ../../c-api/exceptions.rst:1139 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1141 -msgid ":c:data:`PyExc_UnicodeEncodeError`" -msgstr ":c:data:`PyExc_UnicodeEncodeError`" - -#: ../../c-api/exceptions.rst:1141 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1143 -msgid ":c:data:`PyExc_UnicodeError`" -msgstr ":c:data:`PyExc_UnicodeError`" - -#: ../../c-api/exceptions.rst:1143 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1145 -msgid ":c:data:`PyExc_UnicodeTranslateError`" -msgstr ":c:data:`PyExc_UnicodeTranslateError`" - -#: ../../c-api/exceptions.rst:1145 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1147 -msgid ":c:data:`PyExc_ValueError`" -msgstr ":c:data:`PyExc_ValueError`" - -#: ../../c-api/exceptions.rst:1147 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1149 -msgid ":c:data:`PyExc_ZeroDivisionError`" -msgstr ":c:data:`PyExc_ZeroDivisionError`" - -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1152 +#: ../../c-api/exceptions.rst:1103 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1528,180 +1309,108 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1162 +#: ../../c-api/exceptions.rst:1113 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`。" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1116 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`。" -#: ../../c-api/exceptions.rst:1168 +#: ../../c-api/exceptions.rst:1119 msgid ":c:data:`PyExc_BaseExceptionGroup`." msgstr ":c:data:`PyExc_BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1171 -msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" +#: ../../c-api/exceptions.rst:1124 +msgid "OSError aliases" msgstr "" -#: ../../c-api/exceptions.rst:1181 -msgid ":c:data:`!PyExc_EnvironmentError`" -msgstr ":c:data:`!PyExc_EnvironmentError`" - -#: ../../c-api/exceptions.rst:1183 -msgid ":c:data:`!PyExc_IOError`" -msgstr ":c:data:`!PyExc_IOError`" +#: ../../c-api/exceptions.rst:1126 +msgid "The following are a compatibility aliases to :c:data:`PyExc_OSError`." +msgstr "" -#: ../../c-api/exceptions.rst:1185 -msgid ":c:data:`!PyExc_WindowsError`" -msgstr ":c:data:`!PyExc_WindowsError`" +#: ../../c-api/exceptions.rst:1128 +msgid "These aliases used to be separate exception types." +msgstr "" -#: ../../c-api/exceptions.rst:1185 -msgid "[2]_" -msgstr "[2]_" +#: ../../c-api/exceptions.rst:1138 +msgid "Notes" +msgstr "註解" -#: ../../c-api/exceptions.rst:1188 -msgid "These aliases used to be separate exception types." +#: ../../c-api/exceptions.rst:1147 +msgid "[win]_" msgstr "" -#: ../../c-api/exceptions.rst:1191 ../../c-api/exceptions.rst:1258 +#: ../../c-api/exceptions.rst:1149 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1194 -msgid "This is a base class for other standard exceptions." -msgstr "" - -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1152 msgid "" -"Only defined on Windows; protect code that uses this by testing that the " -"preprocessor macro ``MS_WINDOWS`` is defined." -msgstr "" - -#: ../../c-api/exceptions.rst:1203 -msgid "Standard Warning Categories" +":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that " +"uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1205 -msgid "" -"All standard Python warning categories are available as global variables " -"whose names are ``PyExc_`` followed by the Python exception name. These have " -"the type :c:expr:`PyObject*`; they are all class objects. For completeness, " -"here are all the variables:" +#: ../../c-api/exceptions.rst:1159 +msgid "Warning types" msgstr "" -#: ../../c-api/exceptions.rst:1227 -msgid ":c:data:`PyExc_Warning`" -msgstr ":c:data:`PyExc_Warning`" - -#: ../../c-api/exceptions.rst:1227 +#: ../../c-api/exceptions.rst:1169 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1227 -msgid "[3]_" -msgstr "[3]_" - -#: ../../c-api/exceptions.rst:1229 -msgid ":c:data:`PyExc_BytesWarning`" -msgstr ":c:data:`PyExc_BytesWarning`" - -#: ../../c-api/exceptions.rst:1229 +#: ../../c-api/exceptions.rst:1171 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1231 -msgid ":c:data:`PyExc_DeprecationWarning`" -msgstr ":c:data:`PyExc_DeprecationWarning`" - -#: ../../c-api/exceptions.rst:1231 +#: ../../c-api/exceptions.rst:1173 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1233 -msgid ":c:data:`PyExc_EncodingWarning`" -msgstr ":c:data:`PyExc_EncodingWarning`" - -#: ../../c-api/exceptions.rst:1233 +#: ../../c-api/exceptions.rst:1175 msgid ":exc:`EncodingWarning`" msgstr ":exc:`EncodingWarning`" -#: ../../c-api/exceptions.rst:1235 -msgid ":c:data:`PyExc_FutureWarning`" -msgstr ":c:data:`PyExc_FutureWarning`" - -#: ../../c-api/exceptions.rst:1235 +#: ../../c-api/exceptions.rst:1177 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1237 -msgid ":c:data:`PyExc_ImportWarning`" -msgstr ":c:data:`PyExc_ImportWarning`" - -#: ../../c-api/exceptions.rst:1237 +#: ../../c-api/exceptions.rst:1179 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1239 -msgid ":c:data:`PyExc_PendingDeprecationWarning`" -msgstr ":c:data:`PyExc_PendingDeprecationWarning`" - -#: ../../c-api/exceptions.rst:1239 +#: ../../c-api/exceptions.rst:1181 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1241 -msgid ":c:data:`PyExc_ResourceWarning`" -msgstr ":c:data:`PyExc_ResourceWarning`" - -#: ../../c-api/exceptions.rst:1241 +#: ../../c-api/exceptions.rst:1183 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1243 -msgid ":c:data:`PyExc_RuntimeWarning`" -msgstr ":c:data:`PyExc_RuntimeWarning`" - -#: ../../c-api/exceptions.rst:1243 +#: ../../c-api/exceptions.rst:1185 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1245 -msgid ":c:data:`PyExc_SyntaxWarning`" -msgstr ":c:data:`PyExc_SyntaxWarning`" - -#: ../../c-api/exceptions.rst:1245 +#: ../../c-api/exceptions.rst:1187 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1247 -msgid ":c:data:`PyExc_UnicodeWarning`" -msgstr ":c:data:`PyExc_UnicodeWarning`" - -#: ../../c-api/exceptions.rst:1247 +#: ../../c-api/exceptions.rst:1189 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1249 -msgid ":c:data:`PyExc_UserWarning`" -msgstr ":c:data:`PyExc_UserWarning`" - -#: ../../c-api/exceptions.rst:1249 +#: ../../c-api/exceptions.rst:1191 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1252 +#: ../../c-api/exceptions.rst:1193 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1255 +#: ../../c-api/exceptions.rst:1196 msgid ":c:data:`PyExc_EncodingWarning`." msgstr ":c:data:`PyExc_EncodingWarning`" -#: ../../c-api/exceptions.rst:1261 -msgid "This is a base class for other standard warning categories." -msgstr "" - #: ../../c-api/exceptions.rst:183 msgid "strerror (C function)" msgstr "strerror(C 函式)" @@ -1725,282 +1434,434 @@ msgstr "SIGINT(C 巨集)" msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_BaseException (C var)" -msgstr "PyExc_BaseException(C 變數)" +#~ msgid "C Name" +#~ msgstr "C 名稱" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_BaseExceptionGroup (C var)" -msgstr "PyExc_BaseExceptionGroup(C 變數)" +#~ msgid ":c:data:`PyExc_BaseException`" +#~ msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_Exception (C var)" -msgstr "PyExc_Exception(C 變數)" +#~ msgid "[1]_" +#~ msgstr "[1]_" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ArithmeticError (C var)" -msgstr "PyExc_ArithmeticError(C 變數)" +#~ msgid ":c:data:`PyExc_BaseExceptionGroup`" +#~ msgstr ":c:data:`PyExc_BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_AssertionError (C var)" -msgstr "PyExc_AssertionError(C 變數)" +#~ msgid ":c:data:`PyExc_Exception`" +#~ msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_AttributeError (C var)" -msgstr "PyExc_AttributeError(C 變數)" +#~ msgid ":c:data:`PyExc_ArithmeticError`" +#~ msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_BlockingIOError (C var)" -msgstr "PyExc_BlockingIOError(C 變數)" +#~ msgid ":c:data:`PyExc_AssertionError`" +#~ msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_BrokenPipeError (C var)" -msgstr "PyExc_BrokenPipeError(C 變數)" +#~ msgid ":c:data:`PyExc_AttributeError`" +#~ msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_BufferError (C var)" -msgstr "PyExc_BufferError(C 變數)" +#~ msgid ":c:data:`PyExc_BlockingIOError`" +#~ msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ChildProcessError (C var)" -msgstr "PyExc_ChildProcessError(C 變數)" +#~ msgid ":c:data:`PyExc_BrokenPipeError`" +#~ msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ConnectionAbortedError (C var)" -msgstr "PyExc_ConnectionAbortedError(C 變數)" +#~ msgid ":c:data:`PyExc_BufferError`" +#~ msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ConnectionError (C var)" -msgstr "PyExc_ConnectionError(C 變數)" +#~ msgid ":c:data:`PyExc_ChildProcessError`" +#~ msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ConnectionRefusedError (C var)" -msgstr "PyExc_ConnectionRefusedError(C 變數)" +#~ msgid ":c:data:`PyExc_ConnectionAbortedError`" +#~ msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ConnectionResetError (C var)" -msgstr "PyExc_ConnectionResetError(C 變數)" +#~ msgid ":c:data:`PyExc_ConnectionError`" +#~ msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_EOFError (C var)" -msgstr "PyExc_EOFError(C 變數)" +#~ msgid ":c:data:`PyExc_ConnectionRefusedError`" +#~ msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_FileExistsError (C var)" -msgstr "PyExc_FileExistsError(C 變數)" +#~ msgid ":c:data:`PyExc_ConnectionResetError`" +#~ msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_FileNotFoundError (C var)" -msgstr "PyExc_FileNotFoundError(C 變數)" +#~ msgid ":c:data:`PyExc_EOFError`" +#~ msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_FloatingPointError (C var)" -msgstr "PyExc_FloatingPointError(C 變數)" +#~ msgid ":c:data:`PyExc_FileExistsError`" +#~ msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_GeneratorExit (C var)" -msgstr "PyExc_GeneratorExit(C 變數)" +#~ msgid ":c:data:`PyExc_FileNotFoundError`" +#~ msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ImportError (C var)" -msgstr "PyExc_ImportError(C 變數)" +#~ msgid ":c:data:`PyExc_FloatingPointError`" +#~ msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_IndentationError (C var)" -msgstr "PyExc_IndentationError(C 變數)" +#~ msgid ":c:data:`PyExc_GeneratorExit`" +#~ msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_IndexError (C var)" -msgstr "PyExc_IndexError(C 變數)" +#~ msgid ":c:data:`PyExc_ImportError`" +#~ msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_InterruptedError (C var)" -msgstr "PyExc_InterruptedError(C 變數)" +#~ msgid ":c:data:`PyExc_IndentationError`" +#~ msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_IsADirectoryError (C var)" -msgstr "PyExc_IsADirectoryError(C 變數)" +#~ msgid ":c:data:`PyExc_IndexError`" +#~ msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_KeyError (C var)" -msgstr "PyExc_KeyError(C 變數)" +#~ msgid ":c:data:`PyExc_InterruptedError`" +#~ msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_KeyboardInterrupt (C var)" -msgstr "PyExc_KeyboardInterrupt(C 變數)" +#~ msgid ":c:data:`PyExc_IsADirectoryError`" +#~ msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_LookupError (C var)" -msgstr "PyExc_LookupError(C 變數)" +#~ msgid ":c:data:`PyExc_KeyError`" +#~ msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_MemoryError (C var)" -msgstr "PyExc_MemoryError(C 變數)" +#~ msgid ":c:data:`PyExc_KeyboardInterrupt`" +#~ msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ModuleNotFoundError (C var)" -msgstr "PyExc_ModuleNotFoundError(C 變數)" +#~ msgid ":c:data:`PyExc_LookupError`" +#~ msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_NameError (C var)" -msgstr "PyExc_NameError(C 變數)" +#~ msgid ":c:data:`PyExc_MemoryError`" +#~ msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_NotADirectoryError (C var)" -msgstr "PyExc_NotADirectoryError(C 變數)" +#~ msgid ":c:data:`PyExc_ModuleNotFoundError`" +#~ msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_NotImplementedError (C var)" -msgstr "PyExc_NotImplementedError(C 變數)" +#~ msgid ":c:data:`PyExc_NameError`" +#~ msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_OSError (C var)" -msgstr "PyExc_OSError(C 變數)" +#~ msgid ":c:data:`PyExc_NotADirectoryError`" +#~ msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_OverflowError (C var)" -msgstr "PyExc_OverflowError(C 變數)" +#~ msgid ":c:data:`PyExc_NotImplementedError`" +#~ msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_PermissionError (C var)" -msgstr "PyExc_PermissionError(C 變數)" +#~ msgid ":c:data:`PyExc_OSError`" +#~ msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ProcessLookupError (C var)" -msgstr "PyExc_ProcessLookupError(C 變數)" +#~ msgid ":c:data:`PyExc_OverflowError`" +#~ msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_PythonFinalizationError (C var)" -msgstr "PyExc_PythonFinalizationError(C 變數)" +#~ msgid ":c:data:`PyExc_PermissionError`" +#~ msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_RecursionError (C var)" -msgstr "PyExc_RecursionError(C 變數)" +#~ msgid ":c:data:`PyExc_ProcessLookupError`" +#~ msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ReferenceError (C var)" -msgstr "PyExc_ReferenceError(C 變數)" +#~ msgid ":c:data:`PyExc_PythonFinalizationError`" +#~ msgstr ":c:data:`PyExc_PythonFinalizationError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_RuntimeError (C var)" -msgstr "PyExc_RuntimeError(C 變數)" +#~ msgid ":c:data:`PyExc_RecursionError`" +#~ msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_StopAsyncIteration (C var)" -msgstr "PyExc_StopAsyncIteration(C 變數)" +#~ msgid ":c:data:`PyExc_ReferenceError`" +#~ msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_StopIteration (C var)" -msgstr "PyExc_StopIteration(C 變數)" +#~ msgid ":c:data:`PyExc_RuntimeError`" +#~ msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_SyntaxError (C var)" -msgstr "PyExc_SyntaxError(C 變數)" +#~ msgid ":c:data:`PyExc_StopAsyncIteration`" +#~ msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_SystemError (C var)" -msgstr "PyExc_SystemError(C 變數)" +#~ msgid ":c:data:`PyExc_StopIteration`" +#~ msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_SystemExit (C var)" -msgstr "PyExc_SystemExit(C 變數)" +#~ msgid ":c:data:`PyExc_SyntaxError`" +#~ msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_TabError (C var)" -msgstr "PyExc_TabError(C 變數)" +#~ msgid ":c:data:`PyExc_SystemError`" +#~ msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_TimeoutError (C var)" -msgstr "PyExc_TimeoutError(C 變數)" +#~ msgid ":c:data:`PyExc_SystemExit`" +#~ msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_TypeError (C var)" -msgstr "PyExc_TypeError(C 變數)" +#~ msgid ":c:data:`PyExc_TabError`" +#~ msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_UnboundLocalError (C var)" -msgstr "PyExc_UnboundLocalError(C 變數)" +#~ msgid ":c:data:`PyExc_TimeoutError`" +#~ msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_UnicodeDecodeError (C var)" -msgstr "PyExc_UnicodeDecodeError(C 變數)" +#~ msgid ":c:data:`PyExc_TypeError`" +#~ msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_UnicodeEncodeError (C var)" -msgstr "PyExc_UnicodeEncodeError(C 變數)" +#~ msgid ":c:data:`PyExc_UnboundLocalError`" +#~ msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_UnicodeError (C var)" -msgstr "PyExc_UnicodeError(C 變數)" +#~ msgid ":c:data:`PyExc_UnicodeDecodeError`" +#~ msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_UnicodeTranslateError (C var)" -msgstr "PyExc_UnicodeTranslateError(C 變數)" +#~ msgid ":c:data:`PyExc_UnicodeEncodeError`" +#~ msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ValueError (C var)" -msgstr "PyExc_ValueError(C 變數)" +#~ msgid ":c:data:`PyExc_UnicodeError`" +#~ msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:981 -msgid "PyExc_ZeroDivisionError (C var)" -msgstr "PyExc_ZeroDivisionError(C 變數)" +#~ msgid ":c:data:`PyExc_UnicodeTranslateError`" +#~ msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1173 -msgid "PyExc_EnvironmentError (C var)" -msgstr "PyExc_EnvironmentError(C 變數)" +#~ msgid ":c:data:`PyExc_ValueError`" +#~ msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1173 -msgid "PyExc_IOError (C var)" -msgstr "PyExc_IOError(C 變數)" +#~ msgid ":c:data:`PyExc_ZeroDivisionError`" +#~ msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1173 -msgid "PyExc_WindowsError (C var)" -msgstr "PyExc_WindowsError(C 變數)" +#~ msgid ":c:data:`!PyExc_EnvironmentError`" +#~ msgstr ":c:data:`!PyExc_EnvironmentError`" + +#~ msgid ":c:data:`!PyExc_IOError`" +#~ msgstr ":c:data:`!PyExc_IOError`" + +#~ msgid ":c:data:`!PyExc_WindowsError`" +#~ msgstr ":c:data:`!PyExc_WindowsError`" + +#~ msgid "[2]_" +#~ msgstr "[2]_" + +#~ msgid ":c:data:`PyExc_Warning`" +#~ msgstr ":c:data:`PyExc_Warning`" + +#~ msgid "[3]_" +#~ msgstr "[3]_" + +#~ msgid ":c:data:`PyExc_BytesWarning`" +#~ msgstr ":c:data:`PyExc_BytesWarning`" + +#~ msgid ":c:data:`PyExc_DeprecationWarning`" +#~ msgstr ":c:data:`PyExc_DeprecationWarning`" + +#~ msgid ":c:data:`PyExc_EncodingWarning`" +#~ msgstr ":c:data:`PyExc_EncodingWarning`" + +#~ msgid ":c:data:`PyExc_FutureWarning`" +#~ msgstr ":c:data:`PyExc_FutureWarning`" + +#~ msgid ":c:data:`PyExc_ImportWarning`" +#~ msgstr ":c:data:`PyExc_ImportWarning`" + +#~ msgid ":c:data:`PyExc_PendingDeprecationWarning`" +#~ msgstr ":c:data:`PyExc_PendingDeprecationWarning`" + +#~ msgid ":c:data:`PyExc_ResourceWarning`" +#~ msgstr ":c:data:`PyExc_ResourceWarning`" + +#~ msgid ":c:data:`PyExc_RuntimeWarning`" +#~ msgstr ":c:data:`PyExc_RuntimeWarning`" + +#~ msgid ":c:data:`PyExc_SyntaxWarning`" +#~ msgstr ":c:data:`PyExc_SyntaxWarning`" + +#~ msgid ":c:data:`PyExc_UnicodeWarning`" +#~ msgstr ":c:data:`PyExc_UnicodeWarning`" + +#~ msgid ":c:data:`PyExc_UserWarning`" +#~ msgstr ":c:data:`PyExc_UserWarning`" + +#~ msgid "PyExc_BaseException (C var)" +#~ msgstr "PyExc_BaseException(C 變數)" + +#~ msgid "PyExc_BaseExceptionGroup (C var)" +#~ msgstr "PyExc_BaseExceptionGroup(C 變數)" + +#~ msgid "PyExc_Exception (C var)" +#~ msgstr "PyExc_Exception(C 變數)" + +#~ msgid "PyExc_ArithmeticError (C var)" +#~ msgstr "PyExc_ArithmeticError(C 變數)" + +#~ msgid "PyExc_AssertionError (C var)" +#~ msgstr "PyExc_AssertionError(C 變數)" + +#~ msgid "PyExc_AttributeError (C var)" +#~ msgstr "PyExc_AttributeError(C 變數)" + +#~ msgid "PyExc_BlockingIOError (C var)" +#~ msgstr "PyExc_BlockingIOError(C 變數)" + +#~ msgid "PyExc_BrokenPipeError (C var)" +#~ msgstr "PyExc_BrokenPipeError(C 變數)" + +#~ msgid "PyExc_BufferError (C var)" +#~ msgstr "PyExc_BufferError(C 變數)" + +#~ msgid "PyExc_ChildProcessError (C var)" +#~ msgstr "PyExc_ChildProcessError(C 變數)" + +#~ msgid "PyExc_ConnectionAbortedError (C var)" +#~ msgstr "PyExc_ConnectionAbortedError(C 變數)" + +#~ msgid "PyExc_ConnectionError (C var)" +#~ msgstr "PyExc_ConnectionError(C 變數)" + +#~ msgid "PyExc_ConnectionRefusedError (C var)" +#~ msgstr "PyExc_ConnectionRefusedError(C 變數)" + +#~ msgid "PyExc_ConnectionResetError (C var)" +#~ msgstr "PyExc_ConnectionResetError(C 變數)" + +#~ msgid "PyExc_EOFError (C var)" +#~ msgstr "PyExc_EOFError(C 變數)" + +#~ msgid "PyExc_FileExistsError (C var)" +#~ msgstr "PyExc_FileExistsError(C 變數)" + +#~ msgid "PyExc_FileNotFoundError (C var)" +#~ msgstr "PyExc_FileNotFoundError(C 變數)" + +#~ msgid "PyExc_FloatingPointError (C var)" +#~ msgstr "PyExc_FloatingPointError(C 變數)" + +#~ msgid "PyExc_GeneratorExit (C var)" +#~ msgstr "PyExc_GeneratorExit(C 變數)" + +#~ msgid "PyExc_ImportError (C var)" +#~ msgstr "PyExc_ImportError(C 變數)" + +#~ msgid "PyExc_IndentationError (C var)" +#~ msgstr "PyExc_IndentationError(C 變數)" + +#~ msgid "PyExc_IndexError (C var)" +#~ msgstr "PyExc_IndexError(C 變數)" + +#~ msgid "PyExc_InterruptedError (C var)" +#~ msgstr "PyExc_InterruptedError(C 變數)" + +#~ msgid "PyExc_IsADirectoryError (C var)" +#~ msgstr "PyExc_IsADirectoryError(C 變數)" + +#~ msgid "PyExc_KeyError (C var)" +#~ msgstr "PyExc_KeyError(C 變數)" + +#~ msgid "PyExc_KeyboardInterrupt (C var)" +#~ msgstr "PyExc_KeyboardInterrupt(C 變數)" + +#~ msgid "PyExc_LookupError (C var)" +#~ msgstr "PyExc_LookupError(C 變數)" + +#~ msgid "PyExc_MemoryError (C var)" +#~ msgstr "PyExc_MemoryError(C 變數)" + +#~ msgid "PyExc_ModuleNotFoundError (C var)" +#~ msgstr "PyExc_ModuleNotFoundError(C 變數)" + +#~ msgid "PyExc_NameError (C var)" +#~ msgstr "PyExc_NameError(C 變數)" + +#~ msgid "PyExc_NotADirectoryError (C var)" +#~ msgstr "PyExc_NotADirectoryError(C 變數)" + +#~ msgid "PyExc_NotImplementedError (C var)" +#~ msgstr "PyExc_NotImplementedError(C 變數)" + +#~ msgid "PyExc_OSError (C var)" +#~ msgstr "PyExc_OSError(C 變數)" + +#~ msgid "PyExc_OverflowError (C var)" +#~ msgstr "PyExc_OverflowError(C 變數)" + +#~ msgid "PyExc_PermissionError (C var)" +#~ msgstr "PyExc_PermissionError(C 變數)" + +#~ msgid "PyExc_ProcessLookupError (C var)" +#~ msgstr "PyExc_ProcessLookupError(C 變數)" + +#~ msgid "PyExc_PythonFinalizationError (C var)" +#~ msgstr "PyExc_PythonFinalizationError(C 變數)" + +#~ msgid "PyExc_RecursionError (C var)" +#~ msgstr "PyExc_RecursionError(C 變數)" + +#~ msgid "PyExc_ReferenceError (C var)" +#~ msgstr "PyExc_ReferenceError(C 變數)" + +#~ msgid "PyExc_RuntimeError (C var)" +#~ msgstr "PyExc_RuntimeError(C 變數)" + +#~ msgid "PyExc_StopAsyncIteration (C var)" +#~ msgstr "PyExc_StopAsyncIteration(C 變數)" + +#~ msgid "PyExc_StopIteration (C var)" +#~ msgstr "PyExc_StopIteration(C 變數)" + +#~ msgid "PyExc_SyntaxError (C var)" +#~ msgstr "PyExc_SyntaxError(C 變數)" + +#~ msgid "PyExc_SystemError (C var)" +#~ msgstr "PyExc_SystemError(C 變數)" + +#~ msgid "PyExc_SystemExit (C var)" +#~ msgstr "PyExc_SystemExit(C 變數)" + +#~ msgid "PyExc_TabError (C var)" +#~ msgstr "PyExc_TabError(C 變數)" + +#~ msgid "PyExc_TimeoutError (C var)" +#~ msgstr "PyExc_TimeoutError(C 變數)" + +#~ msgid "PyExc_TypeError (C var)" +#~ msgstr "PyExc_TypeError(C 變數)" + +#~ msgid "PyExc_UnboundLocalError (C var)" +#~ msgstr "PyExc_UnboundLocalError(C 變數)" + +#~ msgid "PyExc_UnicodeDecodeError (C var)" +#~ msgstr "PyExc_UnicodeDecodeError(C 變數)" + +#~ msgid "PyExc_UnicodeEncodeError (C var)" +#~ msgstr "PyExc_UnicodeEncodeError(C 變數)" + +#~ msgid "PyExc_UnicodeError (C var)" +#~ msgstr "PyExc_UnicodeError(C 變數)" + +#~ msgid "PyExc_UnicodeTranslateError (C var)" +#~ msgstr "PyExc_UnicodeTranslateError(C 變數)" + +#~ msgid "PyExc_ValueError (C var)" +#~ msgstr "PyExc_ValueError(C 變數)" + +#~ msgid "PyExc_ZeroDivisionError (C var)" +#~ msgstr "PyExc_ZeroDivisionError(C 變數)" + +#~ msgid "PyExc_EnvironmentError (C var)" +#~ msgstr "PyExc_EnvironmentError(C 變數)" + +#~ msgid "PyExc_IOError (C var)" +#~ msgstr "PyExc_IOError(C 變數)" + +#~ msgid "PyExc_WindowsError (C var)" +#~ msgstr "PyExc_WindowsError(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_Warning (C var)" -msgstr "PyExc_Warning(C 變數)" +#~ msgid "PyExc_Warning (C var)" +#~ msgstr "PyExc_Warning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_BytesWarning (C var)" -msgstr "PyExc_BytesWarning(C 變數)" +#~ msgid "PyExc_BytesWarning (C var)" +#~ msgstr "PyExc_BytesWarning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_DeprecationWarning (C var)" -msgstr "PyExc_DeprecationWarning(C 變數)" +#~ msgid "PyExc_DeprecationWarning (C var)" +#~ msgstr "PyExc_DeprecationWarning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_EncodingWarning (C var)" -msgstr "PyExc_EncodingWarning(C 變數)" +#~ msgid "PyExc_EncodingWarning (C var)" +#~ msgstr "PyExc_EncodingWarning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_FutureWarning (C var)" -msgstr "PyExc_FutureWarning(C 變數)" +#~ msgid "PyExc_FutureWarning (C var)" +#~ msgstr "PyExc_FutureWarning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_ImportWarning (C var)" -msgstr "PyExc_ImportWarning(C 變數)" +#~ msgid "PyExc_ImportWarning (C var)" +#~ msgstr "PyExc_ImportWarning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_PendingDeprecationWarning (C var)" -msgstr "PyExc_PendingDeprecationWarning(C 變數)" +#~ msgid "PyExc_PendingDeprecationWarning (C var)" +#~ msgstr "PyExc_PendingDeprecationWarning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_ResourceWarning (C var)" -msgstr "PyExc_ResourceWarning(C 變數)" +#~ msgid "PyExc_ResourceWarning (C var)" +#~ msgstr "PyExc_ResourceWarning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_RuntimeWarning (C var)" -msgstr "PyExc_RuntimeWarning(C 變數)" +#~ msgid "PyExc_RuntimeWarning (C var)" +#~ msgstr "PyExc_RuntimeWarning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_SyntaxWarning (C var)" -msgstr "PyExc_SyntaxWarning(C 變數)" +#~ msgid "PyExc_SyntaxWarning (C var)" +#~ msgstr "PyExc_SyntaxWarning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_UnicodeWarning (C var)" -msgstr "PyExc_UnicodeWarning(C 變數)" +#~ msgid "PyExc_UnicodeWarning (C var)" +#~ msgstr "PyExc_UnicodeWarning(C 變數)" -#: ../../c-api/exceptions.rst:1210 -msgid "PyExc_UserWarning (C var)" -msgstr "PyExc_UserWarning(C 變數)" +#~ msgid "PyExc_UserWarning (C var)" +#~ msgstr "PyExc_UserWarning(C 變數)" diff --git a/library/codecs.po b/library/codecs.po index 5b0752b990..d1330456ac 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-10 00:16+0000\n" +"POT-Creation-Date: 2025-07-11 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -290,9 +290,9 @@ msgstr "" #: ../../library/codecs.rst:241 msgid "" "Uses an incremental encoder to iteratively encode the input provided by " -"*iterator*. This function is a :term:`generator`. The *errors* argument (as " -"well as any other keyword argument) is passed through to the incremental " -"encoder." +"*iterator*. *iterator* must yield :class:`str` objects. This function is a :" +"term:`generator`. The *errors* argument (as well as any other keyword " +"argument) is passed through to the incremental encoder." msgstr "" #: ../../library/codecs.rst:246 @@ -305,9 +305,9 @@ msgstr "" #: ../../library/codecs.rst:253 msgid "" "Uses an incremental decoder to iteratively decode the input provided by " -"*iterator*. This function is a :term:`generator`. The *errors* argument (as " -"well as any other keyword argument) is passed through to the incremental " -"decoder." +"*iterator*. *iterator* must yield :class:`bytes` objects. This function is " +"a :term:`generator`. The *errors* argument (as well as any other keyword " +"argument) is passed through to the incremental decoder." msgstr "" #: ../../library/codecs.rst:258 From 6d46812066c7ab1000cfedd9ab5fc3d4be94c998 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 11 Jul 2025 10:18:26 +0000 Subject: [PATCH 5/6] sync with cpython aa4bb1c6 --- library/email.parser.po | 174 ++++++++++++++++++++-------------------- 1 file changed, 86 insertions(+), 88 deletions(-) diff --git a/library/email.parser.po b/library/email.parser.po index 770ac9a254..c89f7718a9 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-19 00:13+0000\n" +"POT-Creation-Date: 2025-07-11 10:17+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-" @@ -43,35 +43,35 @@ msgid "" "root :class:`~email.message.EmailMessage` instance of the object structure. " "For simple, non-MIME messages the payload of this root object will likely be " "a string containing the text of the message. For MIME messages, the root " -"object will return ``True`` from " -"its :meth:`~email.message.EmailMessage.is_multipart` method, and the " -"subparts can be accessed via the payload manipulation methods, such " -"as :meth:`~email.message.EmailMessage.get_body`, :meth:`~email.message.EmailMessage.iter_parts`, " -"and :meth:`~email.message.EmailMessage.walk`." +"object will return ``True`` from its :meth:`~email.message.EmailMessage." +"is_multipart` method, and the subparts can be accessed via the payload " +"manipulation methods, such as :meth:`~email.message.EmailMessage.get_body`, :" +"meth:`~email.message.EmailMessage.iter_parts`, and :meth:`~email.message." +"EmailMessage.walk`." msgstr "" #: ../../library/email.parser.rst:30 msgid "" -"There are actually two parser interfaces available for use, " -"the :class:`Parser` API and the incremental :class:`FeedParser` API. " -"The :class:`Parser` API is most useful if you have the entire text of the " -"message in memory, or if the entire message lives in a file on the file " -"system. :class:`FeedParser` is more appropriate when you are reading the " -"message from a stream which might block waiting for more input (such as " -"reading an email message from a socket). The :class:`FeedParser` can " -"consume and parse the message incrementally, and only returns the root " -"object when you close the parser." +"There are actually two parser interfaces available for use, the :class:" +"`Parser` API and the incremental :class:`FeedParser` API. The :class:" +"`Parser` API is most useful if you have the entire text of the message in " +"memory, or if the entire message lives in a file on the file system. :class:" +"`FeedParser` is more appropriate when you are reading the message from a " +"stream which might block waiting for more input (such as reading an email " +"message from a socket). The :class:`FeedParser` can consume and parse the " +"message incrementally, and only returns the root object when you close the " +"parser." msgstr "" #: ../../library/email.parser.rst:39 msgid "" "Note that the parser can be extended in limited ways, and of course you can " "implement your own parser completely from scratch. All of the logic that " -"connects the :mod:`email` package's bundled parser and " -"the :class:`~email.message.EmailMessage` class is embodied in " -"the :class:`~email.policy.Policy` class, so a custom parser can create " -"message object trees any way it finds necessary by implementing custom " -"versions of the appropriate :class:`!Policy` methods." +"connects the :mod:`email` package's bundled parser and the :class:`~email." +"message.EmailMessage` class is embodied in the :class:`~email.policy.Policy` " +"class, so a custom parser can create message object trees any way it finds " +"necessary by implementing custom versions of the appropriate :class:`!" +"Policy` methods." msgstr "" #: ../../library/email.parser.rst:49 @@ -80,14 +80,14 @@ msgstr "" #: ../../library/email.parser.rst:51 msgid "" -"The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` " -"module, provides an API that is conducive to incremental parsing of email " -"messages, such as would be necessary when reading the text of an email " -"message from a source that can block (such as a socket). " -"The :class:`BytesFeedParser` can of course be used to parse an email message " -"fully contained in a :term:`bytes-like object`, string, or file, but " -"the :class:`BytesParser` API may be more convenient for such use cases. The " -"semantics and results of the two parser APIs are identical." +"The :class:`BytesFeedParser`, imported from the :mod:`email.parser." +"FeedParser` module, provides an API that is conducive to incremental parsing " +"of email messages, such as would be necessary when reading the text of an " +"email message from a source that can block (such as a socket). The :class:" +"`BytesFeedParser` can of course be used to parse an email message fully " +"contained in a :term:`bytes-like object`, string, or file, but the :class:" +"`BytesParser` API may be more convenient for such use cases. The semantics " +"and results of the two parser APIs are identical." msgstr "" #: ../../library/email.parser.rst:60 @@ -97,10 +97,10 @@ msgid "" "to retrieve the root message object. The :class:`BytesFeedParser` is " "extremely accurate when parsing standards-compliant messages, and it does a " "very good job of parsing non-compliant messages, providing information about " -"how a message was deemed broken. It will populate a message " -"object's :attr:`~email.message.EmailMessage.defects` attribute with a list " -"of any problems it found in a message. See the :mod:`email.errors` module " -"for the list of defects that it can find." +"how a message was deemed broken. It will populate a message object's :attr:" +"`~email.message.EmailMessage.defects` attribute with a list of any problems " +"it found in a message. See the :mod:`email.errors` module for the list of " +"defects that it can find." msgstr "" #: ../../library/email.parser.rst:70 @@ -110,21 +110,21 @@ msgstr "" #: ../../library/email.parser.rst:75 msgid "" "Create a :class:`BytesFeedParser` instance. Optional *_factory* is a no-" -"argument callable; if not specified use " -"the :attr:`~email.policy.Policy.message_factory` from the *policy*. Call " -"*_factory* whenever a new message object is needed." +"argument callable; if not specified use the :attr:`~email.policy.Policy." +"message_factory` from the *policy*. Call *_factory* whenever a new message " +"object is needed." msgstr "" #: ../../library/email.parser.rst:80 msgid "" "If *policy* is specified use the rules it specifies to update the " -"representation of the message. If *policy* is not set, use " -"the :class:`compat32 ` policy, which maintains " -"backward compatibility with the Python 3.2 version of the email package and " -"provides :class:`~email.message.Message` as the default factory. All other " -"policies provide :class:`~email.message.EmailMessage` as the default " -"*_factory*. For more information on what else *policy* controls, see " -"the :mod:`~email.policy` documentation." +"representation of the message. If *policy* is not set, use the :class:" +"`compat32 ` policy, which maintains backward " +"compatibility with the Python 3.2 version of the email package and provides :" +"class:`~email.message.Message` as the default factory. All other policies " +"provide :class:`~email.message.EmailMessage` as the default *_factory*. For " +"more information on what else *policy* controls, see the :mod:`~email." +"policy` documentation." msgstr "" #: ../../library/email.parser.rst:89 ../../library/email.parser.rst:145 @@ -159,10 +159,10 @@ msgstr "" #: ../../library/email.parser.rst:116 msgid "" -"Works like :class:`BytesFeedParser` except that the input to " -"the :meth:`~BytesFeedParser.feed` method must be a string. This is of " -"limited utility, since the only way for such a message to be valid is for it " -"to contain only ASCII text or, if :attr:`~email.policy.Policy.utf8` is " +"Works like :class:`BytesFeedParser` except that the input to the :meth:" +"`~BytesFeedParser.feed` method must be a string. This is of limited " +"utility, since the only way for such a message to be valid is for it to " +"contain only ASCII text or, if :attr:`~email.policy.EmailPolicy.utf8` is " "``True``, no binary attachments." msgstr "" @@ -175,13 +175,13 @@ msgid "" "The :class:`BytesParser` class, imported from the :mod:`email.parser` " "module, provides an API that can be used to parse a message when the " "complete contents of the message are available in a :term:`bytes-like " -"object` or file. The :mod:`email.parser` module also " -"provides :class:`Parser` for parsing strings, and header-only " -"parsers, :class:`BytesHeaderParser` and :class:`HeaderParser`, which can be " -"used if you're only interested in the headers of the " -"message. :class:`BytesHeaderParser` and :class:`HeaderParser` can be much " -"faster in these situations, since they do not attempt to parse the message " -"body, instead setting the payload to the raw body." +"object` or file. The :mod:`email.parser` module also provides :class:" +"`Parser` for parsing strings, and header-only parsers, :class:" +"`BytesHeaderParser` and :class:`HeaderParser`, which can be used if you're " +"only interested in the headers of the message. :class:`BytesHeaderParser` " +"and :class:`HeaderParser` can be much faster in these situations, since they " +"do not attempt to parse the message body, instead setting the payload to the " +"raw body." msgstr "" #: ../../library/email.parser.rst:141 @@ -205,19 +205,19 @@ msgstr "" #: ../../library/email.parser.rst:156 msgid "" "Read all the data from the binary file-like object *fp*, parse the resulting " -"bytes, and return the message object. *fp* must support both " -"the :meth:`~io.IOBase.readline` and the :meth:`~io.IOBase.read` methods." +"bytes, and return the message object. *fp* must support both the :meth:`~io." +"IOBase.readline` and the :meth:`~io.TextIOBase.read` methods." msgstr "" #: ../../library/email.parser.rst:161 msgid "" "The bytes contained in *fp* must be formatted as a block of :rfc:`5322` (or, " -"if :attr:`~email.policy.Policy.utf8` is ``True``, :rfc:`6532`) style headers " -"and header continuation lines, optionally preceded by an envelope header. " -"The header block is terminated either by the end of the data or by a blank " -"line. Following the header block is the body of the message (which may " -"contain MIME-encoded subparts, including subparts with " -"a :mailheader:`Content-Transfer-Encoding` of ``8bit``)." +"if :attr:`~email.policy.EmailPolicy.utf8` is ``True``, :rfc:`6532`) style " +"headers and header continuation lines, optionally preceded by an envelope " +"header. The header block is terminated either by the end of the data or by " +"a blank line. Following the header block is the body of the message (which " +"may contain MIME-encoded subparts, including subparts with a :mailheader:" +"`Content-Transfer-Encoding` of ``8bit``)." msgstr "" #: ../../library/email.parser.rst:169 @@ -230,9 +230,9 @@ msgstr "" #: ../../library/email.parser.rst:176 msgid "" "Similar to the :meth:`parse` method, except it takes a :term:`bytes-like " -"object` instead of a file-like object. Calling this method on " -"a :term:`bytes-like object` is equivalent to wrapping *bytes* in " -"a :class:`~io.BytesIO` instance first and calling :meth:`parse`." +"object` instead of a file-like object. Calling this method on a :term:" +"`bytes-like object` is equivalent to wrapping *bytes* in a :class:`~io." +"BytesIO` instance first and calling :meth:`parse`." msgstr "" #: ../../library/email.parser.rst:181 ../../library/email.parser.rst:221 @@ -266,16 +266,16 @@ msgstr "" #: ../../library/email.parser.rst:210 msgid "" -"Other than the text mode requirement, this method operates " -"like :meth:`BytesParser.parse`." +"Other than the text mode requirement, this method operates like :meth:" +"`BytesParser.parse`." msgstr "" #: ../../library/email.parser.rst:216 msgid "" "Similar to the :meth:`parse` method, except it takes a string object instead " "of a file-like object. Calling this method on a string is equivalent to " -"wrapping *text* in a :class:`~io.StringIO` instance first and " -"calling :meth:`parse`." +"wrapping *text* in a :class:`~io.StringIO` instance first and calling :meth:" +"`parse`." msgstr "" #: ../../library/email.parser.rst:226 @@ -346,39 +346,37 @@ msgstr "" msgid "" "Most non-\\ :mimetype:`multipart` type messages are parsed as a single " "message object with a string payload. These objects will return ``False`` " -"for :meth:`~email.message.EmailMessage.is_multipart`, " -"and :meth:`~email.message.EmailMessage.iter_parts` will yield an empty list." +"for :meth:`~email.message.EmailMessage.is_multipart`, and :meth:`~email." +"message.EmailMessage.iter_parts` will yield an empty list." msgstr "" #: ../../library/email.parser.rst:300 msgid "" "All :mimetype:`multipart` type messages will be parsed as a container " "message object with a list of sub-message objects for their payload. The " -"outer container message will return ``True`` " -"for :meth:`~email.message.EmailMessage.is_multipart`, " -"and :meth:`~email.message.EmailMessage.iter_parts` will yield a list of " -"subparts." +"outer container message will return ``True`` for :meth:`~email.message." +"EmailMessage.is_multipart`, and :meth:`~email.message.EmailMessage." +"iter_parts` will yield a list of subparts." msgstr "" #: ../../library/email.parser.rst:306 msgid "" -"Most messages with a content type of :mimetype:`message/\\*` (such " -"as :mimetype:`message/delivery-status` and :mimetype:`message/rfc822`) will " -"also be parsed as container object containing a list payload of length 1. " -"Their :meth:`~email.message.EmailMessage.is_multipart` method will return " -"``True``. The single element yielded " -"by :meth:`~email.message.EmailMessage.iter_parts` will be a sub-message " -"object." +"Most messages with a content type of :mimetype:`message/\\*` (such as :" +"mimetype:`message/delivery-status` and :mimetype:`message/rfc822`) will also " +"be parsed as container object containing a list payload of length 1. Their :" +"meth:`~email.message.EmailMessage.is_multipart` method will return ``True``. " +"The single element yielded by :meth:`~email.message.EmailMessage.iter_parts` " +"will be a sub-message object." msgstr "" #: ../../library/email.parser.rst:313 msgid "" "Some non-standards-compliant messages may not be internally consistent about " -"their :mimetype:`multipart`\\ -edness. Such messages may have " -"a :mailheader:`Content-Type` header of type :mimetype:`multipart`, but " -"their :meth:`~email.message.EmailMessage.is_multipart` method may return " -"``False``. If such messages were parsed with " -"the :class:`~email.parser.FeedParser`, they will have an instance of " -"the :class:`~email.errors.MultipartInvariantViolationDefect` class in their " -"*defects* attribute list. See :mod:`email.errors` for details." +"their :mimetype:`multipart`\\ -edness. Such messages may have a :mailheader:" +"`Content-Type` header of type :mimetype:`multipart`, but their :meth:`~email." +"message.EmailMessage.is_multipart` method may return ``False``. If such " +"messages were parsed with the :class:`~email.parser.FeedParser`, they will " +"have an instance of the :class:`~email.errors." +"MultipartInvariantViolationDefect` class in their *defects* attribute list. " +"See :mod:`email.errors` for details." msgstr "" From b99e86f2df1041cf0e215a86d018244dc86d53fb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 12 Jul 2025 00:18:16 +0000 Subject: [PATCH 6/6] sync with cpython 01710af4 --- library/codecs.po | 148 +++++++-------- library/functools.po | 213 ++++++++++++---------- library/venv.po | 426 +++++++++++++++++++++++++------------------ 3 files changed, 441 insertions(+), 346 deletions(-) diff --git a/library/codecs.po b/library/codecs.po index d1330456ac..f9462dd6e2 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-11 00:17+0000\n" +"POT-Creation-Date: 2025-07-12 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -396,7 +396,7 @@ msgstr "" #: ../../library/codecs.rst:352 ../../library/codecs.rst:395 #: ../../library/codecs.rst:415 ../../library/codecs.rst:1353 -#: ../../library/codecs.rst:1421 ../../library/codecs.rst:1476 +#: ../../library/codecs.rst:1425 ../../library/codecs.rst:1480 msgid "Meaning" msgstr "含義" @@ -1396,12 +1396,12 @@ msgid "an IBM PC code page, which is ASCII compatible" msgstr "" #: ../../library/codecs.rst:1097 ../../library/codecs.rst:1353 -#: ../../library/codecs.rst:1421 ../../library/codecs.rst:1476 +#: ../../library/codecs.rst:1425 ../../library/codecs.rst:1480 msgid "Codec" msgstr "" #: ../../library/codecs.rst:1097 ../../library/codecs.rst:1353 -#: ../../library/codecs.rst:1421 ../../library/codecs.rst:1476 +#: ../../library/codecs.rst:1425 ../../library/codecs.rst:1480 msgid "Aliases" msgstr "" @@ -2406,200 +2406,204 @@ msgid "undefined" msgstr "" #: ../../library/codecs.rst:1387 +msgid "This Codec should only be used for testing purposes." +msgstr "" + +#: ../../library/codecs.rst:1391 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1392 +#: ../../library/codecs.rst:1396 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1392 +#: ../../library/codecs.rst:1396 msgid "" "Encoding suitable as the contents of a Unicode literal in ASCII-encoded " "Python source code, except that quotes are not escaped. Decode from Latin-1 " "source code. Beware that Python source code actually uses UTF-8 by default." msgstr "" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1415 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1413 +#: ../../library/codecs.rst:1417 msgid "" "The following codecs provide binary transforms: :term:`bytes-like object` " "to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " "(which only produces :class:`str` output)." msgstr "" -#: ../../library/codecs.rst:1421 +#: ../../library/codecs.rst:1425 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1427 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1427 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1427 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1428 +#: ../../library/codecs.rst:1432 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1427 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1434 +#: ../../library/codecs.rst:1438 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1434 +#: ../../library/codecs.rst:1438 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1434 +#: ../../library/codecs.rst:1438 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1434 +#: ../../library/codecs.rst:1438 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1437 +#: ../../library/codecs.rst:1441 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1437 +#: ../../library/codecs.rst:1441 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1437 +#: ../../library/codecs.rst:1441 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1437 +#: ../../library/codecs.rst:1441 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1442 +#: ../../library/codecs.rst:1446 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1442 +#: ../../library/codecs.rst:1446 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1442 +#: ../../library/codecs.rst:1446 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1442 +#: ../../library/codecs.rst:1446 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1450 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1450 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1450 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1449 +#: ../../library/codecs.rst:1453 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1449 +#: ../../library/codecs.rst:1453 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1449 +#: ../../library/codecs.rst:1453 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1449 +#: ../../library/codecs.rst:1453 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1453 +#: ../../library/codecs.rst:1457 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1457 +#: ../../library/codecs.rst:1461 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1460 +#: ../../library/codecs.rst:1464 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1467 +#: ../../library/codecs.rst:1471 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1469 +#: ../../library/codecs.rst:1473 msgid "" "The following codec provides a text transform: a :class:`str` to :class:" "`str` mapping. It is not supported by :meth:`str.encode` (which only " "produces :class:`bytes` output)." msgstr "" -#: ../../library/codecs.rst:1478 +#: ../../library/codecs.rst:1482 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1478 +#: ../../library/codecs.rst:1482 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1478 +#: ../../library/codecs.rst:1482 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1483 +#: ../../library/codecs.rst:1487 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1486 +#: ../../library/codecs.rst:1490 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1491 +#: ../../library/codecs.rst:1495 msgid ":mod:`encodings` --- Encodings package" msgstr "" -#: ../../library/codecs.rst:1496 +#: ../../library/codecs.rst:1500 msgid "This module implements the following functions:" msgstr "" -#: ../../library/codecs.rst:1500 +#: ../../library/codecs.rst:1504 msgid "Normalize encoding name *encoding*." msgstr "" -#: ../../library/codecs.rst:1502 +#: ../../library/codecs.rst:1506 msgid "" "Normalization works as follows: all non-alphanumeric characters except the " "dot used for Python package names are collapsed and replaced with a single " @@ -2607,23 +2611,23 @@ msgid "" "-;#'`` becomes ``'_'``." msgstr "" -#: ../../library/codecs.rst:1507 +#: ../../library/codecs.rst:1511 msgid "Note that *encoding* should be ASCII only." msgstr "" -#: ../../library/codecs.rst:1511 +#: ../../library/codecs.rst:1515 msgid "" "The following function should not be used directly, except for testing " "purposes; :func:`codecs.lookup` should be used instead." msgstr "" -#: ../../library/codecs.rst:1517 +#: ../../library/codecs.rst:1521 msgid "" "Search for the codec module corresponding to the given encoding name " "*encoding*." msgstr "" -#: ../../library/codecs.rst:1520 +#: ../../library/codecs.rst:1524 msgid "" "This function first normalizes the *encoding* using :func:" "`normalize_encoding`, then looks for a corresponding alias. It attempts to " @@ -2633,26 +2637,26 @@ msgid "" "the codec is cached and returned." msgstr "" -#: ../../library/codecs.rst:1527 +#: ../../library/codecs.rst:1531 msgid "" "If the codec module defines a ``getaliases()`` function any returned aliases " "are registered for future use." msgstr "" -#: ../../library/codecs.rst:1531 +#: ../../library/codecs.rst:1535 msgid "This module implements the following exception:" msgstr "" -#: ../../library/codecs.rst:1535 +#: ../../library/codecs.rst:1539 msgid "Raised when a codec is invalid or incompatible." msgstr "" -#: ../../library/codecs.rst:1539 +#: ../../library/codecs.rst:1543 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1545 +#: ../../library/codecs.rst:1549 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2660,13 +2664,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1550 +#: ../../library/codecs.rst:1554 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party :pypi:`idna` module." msgstr "" -#: ../../library/codecs.rst:1553 +#: ../../library/codecs.rst:1557 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " "domain names. A domain name containing non-ASCII characters (such as ``www." @@ -2680,7 +2684,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1564 +#: ../../library/codecs.rst:1568 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2697,14 +2701,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1577 +#: ../../library/codecs.rst:1581 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " "present such host names to the user should decode them to Unicode." msgstr "" -#: ../../library/codecs.rst:1581 +#: ../../library/codecs.rst:1585 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2712,49 +2716,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1589 +#: ../../library/codecs.rst:1593 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1595 +#: ../../library/codecs.rst:1599 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1601 +#: ../../library/codecs.rst:1605 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1605 +#: ../../library/codecs.rst:1609 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: ../../library/codecs.rst:1610 +#: ../../library/codecs.rst:1614 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1612 +#: ../../library/codecs.rst:1616 msgid "Availability" msgstr "可用性" -#: ../../library/codecs.rst:1614 +#: ../../library/codecs.rst:1618 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1618 +#: ../../library/codecs.rst:1622 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1623 +#: ../../library/codecs.rst:1627 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1629 +#: ../../library/codecs.rst:1633 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " diff --git a/library/functools.po b/library/functools.po index af426e5f3d..b5a0db4633 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-28 00:13+0000\n" +"POT-Creation-Date: 2025-07-12 00:16+0000\n" "PO-Revision-Date: 2024-05-11 16:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,7 +61,7 @@ msgstr "" "裝器。因為它永遠不需要丟棄舊值,所以這比有大小限制的 :func:`lru_cache` 更小、" "更快。" -#: ../../library/functools.rst:39 ../../library/functools.rst:291 +#: ../../library/functools.rst:39 ../../library/functools.rst:297 msgid "For example::" msgstr "舉例來說: ::" @@ -111,7 +111,7 @@ msgstr "" "屬性外實質上幾乎是不可變 (immutable) 的實例,針對其所需要繁重計算會很有用。" #: ../../library/functools.rst:70 ../../library/functools.rst:142 -#: ../../library/functools.rst:383 +#: ../../library/functools.rst:389 msgid "Example::" msgstr "範例: ::" @@ -352,10 +352,11 @@ msgstr "" "的 :class:`dict` 以顯示 *maxsize* 和 *typed* 的值。這僅能顯示資訊,改變其值不" "會有任何效果。" -#: ../../library/functools.rst:202 +#: ../../library/functools.rst:205 +#, fuzzy msgid "" "To help measure the effectiveness of the cache and tune the *maxsize* " -"parameter, the wrapped function is instrumented with a :func:`cache_info` " +"parameter, the wrapped function is instrumented with a :func:`!cache_info` " "function that returns a :term:`named tuple` showing *hits*, *misses*, " "*maxsize* and *currsize*." msgstr "" @@ -363,13 +364,14 @@ msgstr "" "`cache_info` 函式來做檢測,該函式會回傳一個\\ :term:`附名元組 `\\ 來顯示 *hits*、*misses*、*maxsize* 和 *currsize*。" -#: ../../library/functools.rst:207 +#: ../../library/functools.rst:213 +#, fuzzy msgid "" -"The decorator also provides a :func:`cache_clear` function for clearing or " +"The decorator also provides a :func:`!cache_clear` function for clearing or " "invalidating the cache." msgstr "裝飾器還提供了一個 :func:`cache_clear` 函式來清除或使快取失效。" -#: ../../library/functools.rst:210 +#: ../../library/functools.rst:216 msgid "" "The original underlying function is accessible through the :attr:" "`__wrapped__` attribute. This is useful for introspection, for bypassing " @@ -378,14 +380,14 @@ msgstr "" "原本的底層函式可以透過 :attr:`__wrapped__` 屬性存取。這對於要自我檢查 " "(introspection)、繞過快取或使用不同的快取重新包裝函式時非常有用。" -#: ../../library/functools.rst:214 +#: ../../library/functools.rst:220 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 "" "快取會保留對引數和回傳值的參照,直到快取過時 (age out) 或快取被清除為止。" -#: ../../library/functools.rst:217 +#: ../../library/functools.rst:223 msgid "" "If a method is cached, the ``self`` instance argument is included in the " "cache. See :ref:`faq-cache-method-calls`" @@ -393,7 +395,7 @@ msgstr "" "如果方法被快取起來,則 ``self`` 實例引數將包含在快取中。請參閱\\ :ref:`faq-" "cache-method-calls`" -#: ../../library/functools.rst:220 +#: ../../library/functools.rst:226 msgid "" "An `LRU (least recently used) cache `_ works best when the " @@ -408,7 +410,7 @@ msgstr "" "能發揮最好的效果。快取的大小限制可確保快取不會在長時間運行的行程(例如 Web 伺" "服器)上無限制地成長。" -#: ../../library/functools.rst:227 +#: ../../library/functools.rst:233 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 " @@ -420,11 +422,11 @@ msgstr "" "side-effects 的函式、需要在每次呼叫時建立不同可變物件的函式(例如產生器和非同" "步函式)或不純函式(impure function,例如 time() 或 random())是沒有意義的。" -#: ../../library/functools.rst:233 +#: ../../library/functools.rst:239 msgid "Example of an LRU cache for static web content::" msgstr "靜態網頁內容的 LRU 快取範例: ::" -#: ../../library/functools.rst:235 +#: ../../library/functools.rst:241 msgid "" "@lru_cache(maxsize=32)\n" "def get_pep(num):\n" @@ -444,7 +446,7 @@ msgid "" "CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)" msgstr "" -#: ../../library/functools.rst:252 +#: ../../library/functools.rst:258 msgid "" "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " @@ -454,7 +456,7 @@ msgstr "" "wiki/Dynamic_programming>`_ 技法以有效率地計算\\ `費波那契數 (Fibonacci " "numbers) `_ 的範例: ::" -#: ../../library/functools.rst:258 +#: ../../library/functools.rst:264 msgid "" "@lru_cache(maxsize=None)\n" "def fib(n):\n" @@ -469,19 +471,19 @@ msgid "" "CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)" msgstr "" -#: ../../library/functools.rst:272 +#: ../../library/functools.rst:278 msgid "Added the *typed* option." msgstr "新增 *typed* 選項。" -#: ../../library/functools.rst:275 +#: ../../library/functools.rst:281 msgid "Added the *user_function* option." msgstr "新增 *user_function* 選項。" -#: ../../library/functools.rst:278 +#: ../../library/functools.rst:284 msgid "Added the function :func:`!cache_parameters`" msgstr "新增 :func:`!cache_parameters` 函式。" -#: ../../library/functools.rst:283 +#: ../../library/functools.rst:289 msgid "" "Given a class defining one or more rich comparison ordering methods, this " "class decorator supplies the rest. This simplifies the effort involved in " @@ -490,16 +492,17 @@ msgstr "" "給定一個定義一個或多個 rich comparison 排序方法的類別,該類別裝飾器會提供其餘" "部分。這簡化了指定所有可能的 rich comparison 操作所涉及的工作:" -#: ../../library/functools.rst:287 +#: ../../library/functools.rst:293 +#, fuzzy 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." +"The class must define one of :meth:`~object.__lt__`, :meth:`~object." +"__le__`, :meth:`~object.__gt__`, or :meth:`~object.__ge__`. In addition, the " +"class should supply an :meth:`~object.__eq__` method." msgstr "" "類別必須定義 :meth:`__lt__`、:meth:`__le__`、:meth:`__gt__` 或 :meth:" "`__ge__` 其中之一。此外,該類別應該提供 :meth:`__eq__` 方法。" -#: ../../library/functools.rst:293 +#: ../../library/functools.rst:299 msgid "" "@total_ordering\n" "class Student:\n" @@ -533,7 +536,7 @@ msgstr "" " return ((self.lastname.lower(), self.firstname.lower()) <\n" " (other.lastname.lower(), other.firstname.lower()))" -#: ../../library/functools.rst:311 +#: ../../library/functools.rst:317 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 " @@ -546,7 +549,7 @@ msgstr "" "其代價。如果效能基準測試顯示這是給定應用程式的效能瓶頸,那麼實作全部六種 " "rich comparison 方法通常能輕鬆地提升速度。" -#: ../../library/functools.rst:320 +#: ../../library/functools.rst:326 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 " @@ -557,13 +560,13 @@ msgstr "" "如果超類別定義了比較運算子,*total_ordering* 將不會再次實作它,即使原始方法是" "抽象的。" -#: ../../library/functools.rst:327 +#: ../../library/functools.rst:333 msgid "" "Returning ``NotImplemented`` from the underlying comparison function for " "unrecognised types is now supported." msgstr "現在支援從底層對於未識別型別的比較函式回傳 ``NotImplemented``。" -#: ../../library/functools.rst:333 +#: ../../library/functools.rst:339 msgid "" "Return a new :ref:`partial object` which when called will " "behave like *func* called with the positional arguments *args* and keyword " @@ -576,7 +579,7 @@ msgstr "" "引數,它們將被附加到 *args*。如果提供了額外的關鍵字引數,它們會擴充並覆寫 " "*keywords*。大致相當於: ::" -#: ../../library/functools.rst:340 +#: ../../library/functools.rst:346 msgid "" "def partial(func, /, *args, **keywords):\n" " def newfunc(*fargs, **fkeywords):\n" @@ -596,7 +599,7 @@ msgstr "" " newfunc.keywords = keywords\n" " return newfunc" -#: ../../library/functools.rst:349 +#: ../../library/functools.rst:355 msgid "" "The :func:`partial` is used for partial function application which " "\"freezes\" some portion of a function's arguments and/or keywords resulting " @@ -608,7 +611,7 @@ msgstr "" "分,從而產生具有簡化簽名的新物件。例如,:func:`partial` 可用來建立可呼叫函" "式,其行為類似於 :func:`int` 函式,其中 *base* 引數預設為 2:" -#: ../../library/functools.rst:364 +#: ../../library/functools.rst:370 msgid "" "Return a new :class:`partialmethod` descriptor which behaves like :class:" "`partial` except that it is designed to be used as a method definition " @@ -617,7 +620,7 @@ msgstr "" "回傳一個新的 :class:`partialmethod` 描述器 (descriptor),其行為類似於 :class:" "`partial`,只不過它被設計為用於方法定義而不能直接呼叫。" -#: ../../library/functools.rst:368 +#: ../../library/functools.rst:374 msgid "" "*func* must be a :term:`descriptor` or a callable (objects which are both, " "like normal functions, are handled as descriptors)." @@ -625,10 +628,11 @@ msgstr "" "*func* 必須是一個 :term:`descriptor` 或可呼叫物件(兩者兼具的物件,就像普通函" "式一樣,會被當作描述器處理)。" -#: ../../library/functools.rst:371 +#: ../../library/functools.rst:377 +#, fuzzy msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" -"`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " +"`classmethod`, :func:`staticmethod`, :func:`~abc.abstractmethod` or another " "instance of :class:`partialmethod`), calls to ``__get__`` are delegated to " "the underlying descriptor, and an appropriate :ref:`partial object` returned as the result." @@ -638,7 +642,7 @@ msgstr "" "例),對 ``__get__`` 的呼叫將被委託 (delegated) 給底層描述器,且一個適當的 :" "ref:`partial 物件 `\\ 會被作為結果回傳。" -#: ../../library/functools.rst:377 +#: ../../library/functools.rst:383 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 " @@ -651,7 +655,7 @@ msgstr "" "*self* 引數將作為第一個位置引數插入,甚至會在提供給 :class:`partialmethod` 建" "構函式的 *args* 和 *keywords* 的前面。" -#: ../../library/functools.rst:385 +#: ../../library/functools.rst:391 msgid "" ">>> class Cell:\n" "... def __init__(self):\n" @@ -689,7 +693,7 @@ msgstr "" ">>> c.alive\n" "True" -#: ../../library/functools.rst:408 +#: ../../library/functools.rst:414 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 " @@ -708,11 +712,11 @@ msgstr "" "物件的項目之前,並在可疊代物件為空時作為預設值。如果未給定 *initial* 且 " "*iterable* 僅包含一個項目,則回傳第一個項目。" -#: ../../library/functools.rst:417 +#: ../../library/functools.rst:423 msgid "Roughly equivalent to::" msgstr "大致相當於: ::" -#: ../../library/functools.rst:419 +#: ../../library/functools.rst:425 msgid "" "initial_missing = object()\n" "\n" @@ -738,7 +742,7 @@ msgstr "" " value = function(value, element)\n" " return value" -#: ../../library/functools.rst:431 +#: ../../library/functools.rst:437 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." @@ -746,7 +750,7 @@ msgstr "" "請參閱 :func:`itertools.accumulate` 以了解產生 (yield) 所有中間值 " "(intermediate value) 的疊代器。" -#: ../../library/functools.rst:436 +#: ../../library/functools.rst:442 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." @@ -754,7 +758,7 @@ msgstr "" "將函式轉換為\\ :term:`單一調度 `\\ :term:`泛型函式 `。" -#: ../../library/functools.rst:439 +#: ../../library/functools.rst:445 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. When defining a function using ``@singledispatch``, note that the " @@ -764,7 +768,7 @@ msgstr "" "``@singledispatch`` 定義函式時,分派調度 (dispatch) 是發生在第一個引數的型別" "上: ::" -#: ../../library/functools.rst:443 +#: ../../library/functools.rst:449 msgid "" ">>> from functools import singledispatch\n" ">>> @singledispatch\n" @@ -780,9 +784,10 @@ msgstr "" "... print(\"Let me just say,\", end=\" \")\n" "... print(arg)" -#: ../../library/functools.rst:450 +#: ../../library/functools.rst:459 +#, fuzzy msgid "" -"To add overloaded implementations to the function, use the :func:`register` " +"To add overloaded implementations to the function, use the :func:`!register` " "attribute of the generic function, which can be used as a decorator. For " "functions annotated with types, the decorator will infer the type of the " "first argument automatically::" @@ -790,7 +795,7 @@ msgstr "" "若要為函式新增過載實作,請使用泛型函式的 :func:`register` 屬性,該屬性可用作" "裝飾器。對於以型別來註釋的函式,裝飾器將自動推斷第一個引數的型別: ::" -#: ../../library/functools.rst:455 +#: ../../library/functools.rst:464 msgid "" ">>> @fun.register\n" "... def _(arg: int, verbose=False):\n" @@ -818,11 +823,11 @@ msgstr "" "... for i, elem in enumerate(arg):\n" "... print(i, elem)" -#: ../../library/functools.rst:468 +#: ../../library/functools.rst:477 msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" msgstr "也可以使用 :data:`types.UnionType` 和 :data:`typing.Union`: ::" -#: ../../library/functools.rst:470 +#: ../../library/functools.rst:479 msgid "" ">>> @fun.register\n" "... def _(arg: int | float, verbose=False):\n" @@ -854,14 +859,14 @@ msgstr "" "... print(i, elem)\n" "..." -#: ../../library/functools.rst:485 +#: ../../library/functools.rst:494 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:488 +#: ../../library/functools.rst:497 msgid "" ">>> @fun.register(complex)\n" "... def _(arg, verbose=False):\n" @@ -877,7 +882,7 @@ msgstr "" "... print(arg.real, arg.imag)\n" "..." -#: ../../library/functools.rst:495 +#: ../../library/functools.rst:504 msgid "" "For code that dispatches on a collections type (e.g., ``list``), but wants " "to typehint the items of the collection (e.g., ``list[int]``), the dispatch " @@ -885,7 +890,7 @@ msgid "" "going into the function definition::" msgstr "" -#: ../../library/functools.rst:500 +#: ../../library/functools.rst:509 msgid "" ">>> @fun.register(list)\n" "... def _(arg: list[int], verbose=False):\n" @@ -901,7 +906,7 @@ msgstr "" "... for i, elem in enumerate(arg):\n" "... print(i, elem)" -#: ../../library/functools.rst:509 +#: ../../library/functools.rst:518 msgid "" "At runtime the function will dispatch on an instance of a list regardless of " "the type contained within the list i.e. ``[1,2,3]`` will be dispatched the " @@ -909,15 +914,17 @@ msgid "" "example is for static type checkers only and has no runtime impact." msgstr "" -#: ../../library/functools.rst:515 +#: ../../library/functools.rst:524 +#, fuzzy msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " -"the :func:`register` attribute can also be used in a functional form::" +"the :func:`~singledispatch.register` attribute can also be used in a " +"functional form::" msgstr "" "若要啟用註冊 :term:`lambdas` 和預先存在的函式,:func:`register` 屬性" "也能以函式形式使用: ::" -#: ../../library/functools.rst:518 +#: ../../library/functools.rst:527 msgid "" ">>> def nothing(arg, verbose=False):\n" "... print(\"Nothing.\")\n" @@ -929,16 +936,17 @@ msgstr "" "...\n" ">>> fun.register(type(None), nothing)" -#: ../../library/functools.rst:523 +#: ../../library/functools.rst:532 +#, fuzzy 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::" +"The :func:`~singledispatch.register` attribute returns the undecorated " +"function. This enables decorator stacking, :mod:`pickling`, and the " +"creation of unit tests for each variant independently::" msgstr "" ":func:`register` 屬性回傳未加裝飾器的函式。這讓使得裝飾器堆疊 (decorator " "stacking)、:mod:`pickling` 以及為每個變體獨立建立單元測試成為可能:" -#: ../../library/functools.rst:527 +#: ../../library/functools.rst:536 msgid "" ">>> @fun.register(float)\n" "... @fun.register(Decimal)\n" @@ -960,13 +968,13 @@ msgstr "" ">>> fun_num is fun\n" "False" -#: ../../library/functools.rst:537 +#: ../../library/functools.rst:546 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "呼叫時,泛型函式會分派第一個引數的型別: ::" -#: ../../library/functools.rst:540 +#: ../../library/functools.rst:549 msgid "" ">>> fun(\"Hello, world.\")\n" "Hello, world.\n" @@ -1002,7 +1010,7 @@ msgstr "" ">>> fun(1.23)\n" "0.615" -#: ../../library/functools.rst:557 +#: ../../library/functools.rst:566 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 " @@ -1014,7 +1022,7 @@ msgstr "" "尋找更通用的實作。用 ``@singledispatch`` 裝飾的原始函式是為基底 :class:" "`object` 型別註冊的,這意味著如果沒有找到更好的實作就會使用它。" -#: ../../library/functools.rst:563 +#: ../../library/functools.rst:572 msgid "" "If an implementation is registered to an :term:`abstract base class`, " "virtual subclasses of the base class will be dispatched to that " @@ -1023,7 +1031,7 @@ msgstr "" "如果一個實作有被註冊到一個\\ :term:`抽象基底類別 `,則基" "底類別的虛擬子類別將被分派到該實作: ::" -#: ../../library/functools.rst:567 +#: ../../library/functools.rst:576 msgid "" ">>> from collections.abc import Mapping\n" ">>> @fun.register\n" @@ -1047,14 +1055,14 @@ msgstr "" ">>> fun({\"a\": \"b\"})\n" "a => b" -#: ../../library/functools.rst:578 +#: ../../library/functools.rst:587 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" "若要檢查泛型函式將為給定型別選擇哪種實作,請使用 ``dispatch()`` 屬性: ::" -#: ../../library/functools.rst:581 +#: ../../library/functools.rst:590 msgid "" ">>> fun.dispatch(float)\n" "\n" @@ -1062,13 +1070,13 @@ msgid "" "" msgstr "" -#: ../../library/functools.rst:586 +#: ../../library/functools.rst:595 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "若要存取所有已註冊的實作,請使用唯讀 ``registry`` 屬性: ::" -#: ../../library/functools.rst:589 +#: ../../library/functools.rst:598 msgid "" ">>> fun.registry.keys()\n" "dict_keys([, , ,\n" @@ -1088,19 +1096,23 @@ msgstr "" ">>> fun.registry[object]\n" "" -#: ../../library/functools.rst:600 -msgid "The :func:`register` attribute now supports using type annotations." +#: ../../library/functools.rst:609 +#, fuzzy +msgid "" +"The :func:`~singledispatch.register` attribute now supports using type " +"annotations." msgstr ":func:`register` 屬性現在支援使用型別註釋。" -#: ../../library/functools.rst:603 +#: ../../library/functools.rst:612 +#, fuzzy msgid "" -"The :func:`register` attribute now supports :data:`types.UnionType` and :" -"data:`typing.Union` as type annotations." +"The :func:`~singledispatch.register` attribute now supports :data:`types." +"UnionType` and :data:`typing.Union` as type annotations." msgstr "" ":func:`register` 屬性現在支援以 :data:`types.UnionType` 和 :data:`typing." "Union` 作為型別註釋。" -#: ../../library/functools.rst:610 +#: ../../library/functools.rst:619 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." @@ -1108,7 +1120,7 @@ msgstr "" "將方法轉換為\\ :term:`單一調度 `\\ :term:`泛型函式 `。" -#: ../../library/functools.rst:613 +#: ../../library/functools.rst:622 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a function using ``@singledispatchmethod``, note " @@ -1119,7 +1131,7 @@ msgstr "" "用 ``@singledispatchmethod`` 定義函式時,分派調度是發生在第一個非 *self* 或" "非 *cls* 引數的型別上: ::" -#: ../../library/functools.rst:618 +#: ../../library/functools.rst:627 msgid "" "class Negator:\n" " @singledispatchmethod\n" @@ -1147,7 +1159,7 @@ msgstr "" " def _(self, arg: bool):\n" " return not arg" -#: ../../library/functools.rst:631 +#: ../../library/functools.rst:640 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "func:`@classmethod`. Note that to allow for ``dispatcher." @@ -1160,7 +1172,7 @@ msgstr "" "``singledispatchmethod`` 必須是\\ *最外面的*\\ 裝飾器。以下範例是 " "``Negator`` 類別,其 ``neg`` 方法繫結到該類別,而不是該類別的實例: ::" -#: ../../library/functools.rst:637 +#: ../../library/functools.rst:646 msgid "" "class Negator:\n" " @singledispatchmethod\n" @@ -1194,7 +1206,7 @@ msgstr "" " def _(cls, arg: bool):\n" " return not arg" -#: ../../library/functools.rst:653 +#: ../../library/functools.rst:662 msgid "" "The same pattern can be used for other similar decorators: :func:" "`@staticmethod`, :func:`@abstractmethod`, " @@ -1203,7 +1215,7 @@ msgstr "" "相同的模式可用於其他類似的裝飾器::func:`@staticmethod`、:func:" "`@abstractmethod` 等。" -#: ../../library/functools.rst:662 +#: ../../library/functools.rst:671 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -1227,7 +1239,7 @@ msgstr "" "`~function.__doc__` 文件字串 (docstring))和 ``WRAPPER_UPDATES``\\ (更新包" "裝器函式的 :attr:`~function.__dict__`,即實例字典)。" -#: ../../library/functools.rst:674 +#: ../../library/functools.rst:683 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -1238,7 +1250,7 @@ msgstr "" "飾器,如 :func:`lru_cache`),此函式會自動向包裝器新增 ``__wrapped__`` 屬性," "該包裝器參照被包裝的函式。" -#: ../../library/functools.rst:679 +#: ../../library/functools.rst:688 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 " @@ -1250,7 +1262,7 @@ msgstr "" "裝器函式未更新,則回傳函式的元資料 (metadata) 將反映包裝器定義而非原始函式定" "義,這通常不太會有幫助。" -#: ../../library/functools.rst:685 +#: ../../library/functools.rst:694 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 " @@ -1263,7 +1275,7 @@ msgstr "" "器函式上設定它們)。如果包裝函式本身缺少 *updated* 中指定的任何屬性,仍然會引" "發 :exc:`AttributeError`。" -#: ../../library/functools.rst:691 +#: ../../library/functools.rst:700 msgid "" "The ``__wrapped__`` attribute is now automatically added. The :attr:" "`~function.__annotations__` attribute is now copied by default. Missing " @@ -1272,7 +1284,7 @@ msgstr "" "現在會自動新增 ``__wrapped__`` 屬性。現在預設會複製 :attr:`~function." "__annotations__` 屬性。缺少的屬性不再觸發 :exc:`AttributeError`。" -#: ../../library/functools.rst:696 +#: ../../library/functools.rst:705 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" @@ -1281,12 +1293,12 @@ msgstr "" "``__wrapped__`` 屬性現在都會參照包裝函式,即便函式有定義 ``__wrapped__`` 屬" "性。(參見 :issue:`17482`)" -#: ../../library/functools.rst:701 +#: ../../library/functools.rst:710 msgid "" "The :attr:`~function.__type_params__` attribute is now copied by default." msgstr "現在預設會複製 :attr:`~function.__type_params__` 屬性。" -#: ../../library/functools.rst:707 +#: ../../library/functools.rst:716 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -1297,7 +1309,7 @@ msgstr "" "式裝飾器。它相當於 ``partial(update_wrapper, wrapped=wrapped, " "assigned=assigned, updated=updated)``。例如: ::" -#: ../../library/functools.rst:712 +#: ../../library/functools.rst:721 msgid "" ">>> from functools import wraps\n" ">>> def my_decorator(f):\n" @@ -1321,20 +1333,21 @@ msgid "" "'Docstring'" msgstr "" -#: ../../library/functools.rst:733 +#: ../../library/functools.rst:742 +#, fuzzy 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." +"would have been ``'wrapper'``, and the docstring of the original :func:`!" +"example` would have been lost." msgstr "" "如果不使用這個裝飾器工廠 (decorator factory),範例函式的名稱將會是 " "``'wrapper'``,並且原始 :func:`example` 的文件字串將會遺失。" -#: ../../library/functools.rst:741 +#: ../../library/functools.rst:750 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:743 +#: ../../library/functools.rst:752 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" @@ -1342,7 +1355,7 @@ msgstr "" ":class:`partial` 物件是由 :func:`partial` 所建立的可呼叫物件。它們有三個唯讀" "屬性:" -#: ../../library/functools.rst:749 +#: ../../library/functools.rst:758 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." @@ -1350,7 +1363,7 @@ msgstr "" "一個可呼叫的物件或函式。對 :class:`partial` 物件的呼叫將被轉送到帶有新引數和" "關鍵字的 :attr:`func`。" -#: ../../library/functools.rst:755 +#: ../../library/functools.rst:764 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." @@ -1358,13 +1371,13 @@ msgstr "" "最左邊的位置引數將會被加入到提供給 :class:`partial` 物件呼叫的位置引數的前" "面。" -#: ../../library/functools.rst:761 +#: ../../library/functools.rst:770 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "呼叫 :class:`partial` 物件時將提供的關鍵字引數。" -#: ../../library/functools.rst:764 +#: ../../library/functools.rst:773 msgid "" ":class:`partial` objects are like :ref:`function objects ` in that they are callable, weak referenceable, and can have " diff --git a/library/venv.po b/library/venv.po index 6ee64fe52b..659bbd17f1 100644 --- a/library/venv.po +++ b/library/venv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2025-07-12 00:16+0000\n" "PO-Revision-Date: 2025-05-23 10:20+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,13 +30,13 @@ msgstr "**原始碼:**\\ :source:`Lib/venv/`" #: ../../library/venv.rst:21 msgid "" -"The :mod:`!venv` module supports creating lightweight \"virtual environments" -"\", each with their own independent set of Python packages installed in " -"their :mod:`site` directories. A virtual environment is created on top of an " -"existing Python installation, known as the virtual environment's \"base\" " -"Python, and may optionally be isolated from the packages in the base " -"environment, so only those explicitly installed in the virtual environment " -"are available." +"The :mod:`!venv` module supports creating lightweight \"virtual " +"environments\", each with their own independent set of Python packages " +"installed in their :mod:`site` directories. A virtual environment is created " +"on top of an existing Python installation, known as the virtual " +"environment's \"base\" Python, and may optionally be isolated from the " +"packages in the base environment, so only those explicitly installed in the " +"virtual environment are available." msgstr "" ":mod:`!venv` 模組支援建立輕量級的「虛擬環境」,每個虛擬環境都有獨立安裝在其 :" "mod:`site` 目錄中的一組 Python 套件。虛擬環境是建立在既有的 Python 安裝上(稱" @@ -187,80 +187,71 @@ msgid "" "\n" "Creates virtual Python environments in one or more target directories.\n" "\n" -"positional arguments:\n" -" ENV_DIR A directory to create the environment in.\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --system-site-packages\n" -" Give the virtual environment access to the system\n" -" site-packages dir.\n" -" --symlinks Try to use symlinks rather than copies, when\n" -" symlinks are not the default for the platform.\n" -" --copies Try to use copies rather than symlinks, even when\n" -" symlinks are the default for the platform.\n" -" --clear Delete the contents of the environment directory\n" -" if it already exists, before environment creation.\n" -" --upgrade Upgrade the environment directory to use this\n" -" version of Python, assuming Python has been\n" -" upgraded in-place.\n" -" --without-pip Skips installing or upgrading pip in the virtual\n" -" environment (pip is bootstrapped by default)\n" -" --prompt PROMPT Provides an alternative prompt prefix for this\n" -" environment.\n" -" --upgrade-deps Upgrade core dependencies (pip) to the latest\n" -" version in PyPI\n" -" --without-scm-ignore-files\n" -" Skips adding SCM ignore files to the environment\n" -" directory (Git is supported by default).\n" -"\n" "Once an environment has been created, you may wish to activate it, e.g. by\n" "sourcing an activate script in its bin directory." msgstr "" -"usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]\n" -" [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-deps]\n" -" [--without-scm-ignore-files]\n" -" ENV_DIR [ENV_DIR ...]\n" -"\n" -"Creates virtual Python environments in one or more target directories.\n" -"\n" -"positional arguments:\n" -" ENV_DIR A directory to create the environment in.\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --system-site-packages\n" -" Give the virtual environment access to the system\n" -" site-packages dir.\n" -" --symlinks Try to use symlinks rather than copies, when\n" -" symlinks are not the default for the platform.\n" -" --copies Try to use copies rather than symlinks, even when\n" -" symlinks are the default for the platform.\n" -" --clear Delete the contents of the environment directory\n" -" if it already exists, before environment creation.\n" -" --upgrade Upgrade the environment directory to use this\n" -" version of Python, assuming Python has been\n" -" upgraded in-place.\n" -" --without-pip Skips installing or upgrading pip in the virtual\n" -" environment (pip is bootstrapped by default)\n" -" --prompt PROMPT Provides an alternative prompt prefix for this\n" -" environment.\n" -" --upgrade-deps Upgrade core dependencies (pip) to the latest\n" -" version in PyPI\n" -" --without-scm-ignore-files\n" -" Skips adding SCM ignore files to the environment\n" -" directory (Git is supported by default).\n" -"\n" -"Once an environment has been created, you may wish to activate it, e.g. by\n" -"sourcing an activate script in its bin directory." -#: ../../library/venv.rst:136 +#: ../../library/venv.rst:113 +msgid "" +"A required argument specifying the directory to create the environment in." +msgstr "" + +#: ../../library/venv.rst:117 +msgid "" +"Give the virtual environment access to the system site-packages directory." +msgstr "" + +#: ../../library/venv.rst:121 +msgid "" +"Try to use symlinks rather than copies, when symlinks are not the default " +"for the platform." +msgstr "" + +#: ../../library/venv.rst:125 +msgid "" +"Try to use copies rather than symlinks, even when symlinks are the default " +"for the platform." +msgstr "" + +#: ../../library/venv.rst:129 +msgid "" +"Delete the contents of the environment directory if it already exists, " +"before environment creation." +msgstr "" + +#: ../../library/venv.rst:133 +msgid "" +"Upgrade the environment directory to use this version of Python, assuming " +"Python has been upgraded in-place." +msgstr "" + +#: ../../library/venv.rst:137 +msgid "" +"Skips installing or upgrading pip in the virtual environment (pip is " +"bootstrapped by default)." +msgstr "" + +#: ../../library/venv.rst:141 +msgid "Provides an alternative prompt prefix for this environment." +msgstr "" + +#: ../../library/venv.rst:145 +msgid "Upgrade core dependencies (pip) to the latest version in PyPI." +msgstr "" + +#: ../../library/venv.rst:149 +msgid "" +"Skips adding SCM ignore files to the environment directory (Git is supported " +"by default)." +msgstr "" + +#: ../../library/venv.rst:152 msgid "" "Installs pip by default, added the ``--without-pip`` and ``--copies`` " "options." msgstr "預設會安裝 pip,並新增了 ``--without-pip`` 和 ``--copies`` 選項" -#: ../../library/venv.rst:140 +#: ../../library/venv.rst:156 msgid "" "In earlier versions, if the target directory already existed, an error was " "raised, unless the ``--clear`` or ``--upgrade`` option was provided." @@ -268,26 +259,26 @@ msgstr "" "在較早的版本中,如果目標目錄已存在,除非提供了 ``--clear`` 或 ``--upgrade`` " "選項,否則會引發錯誤。" -#: ../../library/venv.rst:144 +#: ../../library/venv.rst:160 msgid "" "Add ``--upgrade-deps`` option to upgrade pip + setuptools to the latest on " "PyPI." msgstr "" "新增 ``--upgrade-deps`` 選項以將 pip 和 setuptools 升級至 PyPI 上的最新版本" -#: ../../library/venv.rst:149 +#: ../../library/venv.rst:165 msgid "``setuptools`` is no longer a core venv dependency." msgstr "``setuptools`` 不再是 venv 的核心相依套件。" -#: ../../library/venv.rst:153 +#: ../../library/venv.rst:169 msgid "Added the ``--without-scm-ignore-files`` option." msgstr "新增 ``--without-scm-ignore-files`` 選項" -#: ../../library/venv.rst:154 +#: ../../library/venv.rst:170 msgid "``venv`` now creates a :file:`.gitignore` file for Git by default." msgstr "``venv`` 現在預設會為 Git 建立 :file:`.gitignore` 檔案。" -#: ../../library/venv.rst:158 +#: ../../library/venv.rst:174 msgid "" "While symlinks are supported on Windows, they are not recommended. Of " "particular note is that double-clicking ``python.exe`` in File Explorer will " @@ -296,7 +287,7 @@ msgstr "" "雖然在 Windows 上支援符號連結,但並不建議使用。特別需要注意的是,在檔案總管中" "按兩下 ``python.exe`` 會急切地解析符號連結並忽略虛擬環境。" -#: ../../library/venv.rst:163 +#: ../../library/venv.rst:179 msgid "" "On Microsoft Windows, it may be required to enable the ``Activate.ps1`` " "script by setting the execution policy for the user. You can do this by " @@ -305,13 +296,13 @@ msgstr "" "在 Microsoft Windows 上,可能需要通過設置使用者的執行策略來啟用 ``Activate." "ps1`` 腳本。你可以發出以下 PowerShell 命令來執行此操作:" -#: ../../library/venv.rst:167 +#: ../../library/venv.rst:183 msgid "" "PS C:\\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" msgstr "" "PS C:\\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" -#: ../../library/venv.rst:171 +#: ../../library/venv.rst:187 msgid "" "See `About Execution Policies `_ for more information." @@ -319,7 +310,7 @@ msgstr "" "有關更多資訊,請參閱\\ `關於執行策略 `_。" -#: ../../library/venv.rst:175 +#: ../../library/venv.rst:191 msgid "" "The created :file:`pyvenv.cfg` file also includes the ``include-system-site-" "packages`` key, set to ``true`` if ``venv`` is run with the ``--system-site-" @@ -329,7 +320,7 @@ msgstr "" "鍵,如果使用 ``venv`` 執行時帶有 ``--system-site-packages`` 選項,則設置為 " "``true``,否則設置為 ``false``。" -#: ../../library/venv.rst:179 +#: ../../library/venv.rst:195 msgid "" "Unless the ``--without-pip`` option is given, :mod:`ensurepip` will be " "invoked to bootstrap ``pip`` into the virtual environment." @@ -337,7 +328,7 @@ msgstr "" "除非 ``--without-pip`` 選項被提供,否則將叫用 :mod:`ensurepip` 來啟動 " "``pip`` 到虛擬環境中。" -#: ../../library/venv.rst:182 +#: ../../library/venv.rst:198 msgid "" "Multiple paths can be given to ``venv``, in which case an identical virtual " "environment will be created, according to the given options, at each " @@ -346,11 +337,11 @@ msgstr "" "可以向 ``venv`` 提供多個路徑,這樣每個提供的路徑都將根據給定的選項建立一個相" "同的虛擬環境。" -#: ../../library/venv.rst:189 +#: ../../library/venv.rst:205 msgid "How venvs work" msgstr "虛擬環境如何運作" -#: ../../library/venv.rst:191 +#: ../../library/venv.rst:207 msgid "" "When a Python interpreter is running from a virtual environment, :data:`sys." "prefix` and :data:`sys.exec_prefix` point to the directories of the virtual " @@ -364,7 +355,7 @@ msgstr "" "base_exec_prefix` 會指向建立虛擬環境的基礎 Python 的目錄。檢查 ``sys.prefix !" "= sys.base_prefix`` 就可以確定目前的直譯器是否跑在虛擬環境中。" -#: ../../library/venv.rst:200 +#: ../../library/venv.rst:216 msgid "" "A virtual environment may be \"activated\" using a script in its binary " "directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " @@ -380,85 +371,85 @@ msgstr "" "用完整的路徑。啟動腳本的方式因平台而異(:samp:`{}` 需要替換成包含虛擬環" "境的目錄路徑)" -#: ../../library/venv.rst:210 +#: ../../library/venv.rst:226 msgid "Platform" msgstr "平台" -#: ../../library/venv.rst:210 +#: ../../library/venv.rst:226 msgid "Shell" msgstr "Shell" -#: ../../library/venv.rst:210 +#: ../../library/venv.rst:226 msgid "Command to activate virtual environment" msgstr "啟動虛擬環境的指令" -#: ../../library/venv.rst:212 +#: ../../library/venv.rst:228 msgid "POSIX" msgstr "POSIX" -#: ../../library/venv.rst:212 +#: ../../library/venv.rst:228 msgid "bash/zsh" msgstr "bash/zsh" -#: ../../library/venv.rst:212 +#: ../../library/venv.rst:228 msgid ":samp:`$ source {}/bin/activate`" msgstr ":samp:`$ source {}/bin/activate`" -#: ../../library/venv.rst:214 +#: ../../library/venv.rst:230 msgid "fish" msgstr "fish" -#: ../../library/venv.rst:214 +#: ../../library/venv.rst:230 msgid ":samp:`$ source {}/bin/activate.fish`" msgstr ":samp:`$ source {}/bin/activate.fish`" -#: ../../library/venv.rst:216 +#: ../../library/venv.rst:232 msgid "csh/tcsh" msgstr "csh/tcsh" -#: ../../library/venv.rst:216 +#: ../../library/venv.rst:232 msgid ":samp:`$ source {}/bin/activate.csh`" msgstr ":samp:`$ source {}/bin/activate.csh`" -#: ../../library/venv.rst:218 +#: ../../library/venv.rst:234 msgid "pwsh" msgstr "pwsh" -#: ../../library/venv.rst:218 +#: ../../library/venv.rst:234 msgid ":samp:`$ {}/bin/Activate.ps1`" msgstr ":samp:`$ {}/bin/Activate.ps1`" -#: ../../library/venv.rst:220 +#: ../../library/venv.rst:236 msgid "Windows" msgstr "Windows" -#: ../../library/venv.rst:220 +#: ../../library/venv.rst:236 msgid "cmd.exe" msgstr "cmd.exe" -#: ../../library/venv.rst:220 +#: ../../library/venv.rst:236 msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" -#: ../../library/venv.rst:222 +#: ../../library/venv.rst:238 msgid "PowerShell" msgstr "PowerShell" -#: ../../library/venv.rst:222 +#: ../../library/venv.rst:238 msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" -#: ../../library/venv.rst:225 +#: ../../library/venv.rst:241 msgid ":program:`fish` and :program:`csh` activation scripts." msgstr ":program:`fish` 和 :program:`csh` 啟動腳本。" -#: ../../library/venv.rst:228 +#: ../../library/venv.rst:244 msgid "" "PowerShell activation scripts installed under POSIX for PowerShell Core " "support." msgstr "PowerShell 的啟動腳本安裝在 POSIX 上支援 PowerShell Core。" -#: ../../library/venv.rst:232 +#: ../../library/venv.rst:248 msgid "" "You don't specifically *need* to activate a virtual environment, as you can " "just specify the full path to that environment's Python interpreter when " @@ -469,7 +460,7 @@ msgstr "" "整路徑。此外,所有安裝在環境裡的腳本都應該都可以在未啟用虛擬環境的情況下運" "行。" -#: ../../library/venv.rst:238 +#: ../../library/venv.rst:254 msgid "" "In order to achieve this, scripts installed into virtual environments have a " "\"shebang\" line which points to the environment's Python interpreter, :samp:" @@ -487,7 +478,7 @@ msgstr "" "Explorer)中雙擊已安裝的腳本,應該可以在沒有啟用環境或將其加入 :envvar:" "`PATH` 的情況下正確地運行。" -#: ../../library/venv.rst:247 +#: ../../library/venv.rst:263 msgid "" "When a virtual environment has been activated, the :envvar:`!VIRTUAL_ENV` " "environment variable is set to the path of the environment. Since explicitly " @@ -499,7 +490,7 @@ msgstr "" "於不需要明確啟用虛擬環境才能使用它。因此,無法依賴 :envvar:`!VIRTUAL_ENV` 來" "判斷是否正在使用虛擬環境。" -#: ../../library/venv.rst:253 +#: ../../library/venv.rst:269 msgid "" "Because scripts installed in environments should not expect the environment " "to be activated, their shebang lines contain the absolute paths to their " @@ -522,7 +513,7 @@ msgstr "" "位置重新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應" "該在新位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" -#: ../../library/venv.rst:267 +#: ../../library/venv.rst:283 msgid "" "You can deactivate a virtual environment by typing ``deactivate`` in your " "shell. The exact mechanism is platform-specific and is an internal " @@ -531,11 +522,11 @@ msgstr "" "你可以在 shell 輸入 ``deactivate`` 來關閉虛擬環境。具體的使用方式因平台而異," "是內部實作的細節(通常會使用腳本或是 shell 函式)" -#: ../../library/venv.rst:275 +#: ../../library/venv.rst:291 msgid "API" msgstr "API" -#: ../../library/venv.rst:279 +#: ../../library/venv.rst:295 msgid "" "The high-level method described above makes use of a simple API which " "provides mechanisms for third-party virtual environment creators to " @@ -545,13 +536,13 @@ msgstr "" "上述提到的高階 method(方法)透過簡單的 API 使用, 為第三方虛擬環境建立者提供" "可以依據他們需求來建立環境的客製化機制: :class:`EnvBuilder` class。" -#: ../../library/venv.rst:288 +#: ../../library/venv.rst:304 msgid "" "The :class:`EnvBuilder` class accepts the following keyword arguments on " "instantiation:" msgstr "進行實例化時,class :class:`EnvBuilder` 接受下列的關鍵字引數:" -#: ../../library/venv.rst:291 +#: ../../library/venv.rst:307 msgid "" "*system_site_packages* -- a boolean value indicating that the system Python " "site-packages should be available to the environment (defaults to ``False``)." @@ -559,7 +550,7 @@ msgstr "" "*system_site_packages* -- 為一個 boolean (布林值),並表明系統的 Python " "site-packages 是否可以在環境中可用(預設為 ``False`` )。" -#: ../../library/venv.rst:294 +#: ../../library/venv.rst:310 msgid "" "*clear* -- a boolean value which, if true, will delete the contents of any " "existing target directory, before creating the environment." @@ -567,7 +558,7 @@ msgstr "" "*clear* -- 為一個 boolean,如果為 true,則在建立環境之前,刪除目標目錄內所有" "存在的內容。" -#: ../../library/venv.rst:297 +#: ../../library/venv.rst:313 msgid "" "*symlinks* -- a boolean value indicating whether to attempt to symlink the " "Python binary rather than copying." @@ -575,7 +566,7 @@ msgstr "" "*symlinks* -- 為一個 boolean,並表明是否嘗試與 Python 二進位檔案建立符號連結" "而不是複製該檔案。" -#: ../../library/venv.rst:300 +#: ../../library/venv.rst:316 msgid "" "*upgrade* -- a boolean value which, if true, will upgrade an existing " "environment with the running Python - for use when that Python has been " @@ -584,7 +575,7 @@ msgstr "" "*upgrade* -- 為一個 boolean,若為 true,則會在執行 Python 時為現有的環境進行" "升級。目的是讓 Python 可以升級到位(預設為 ``False``)。" -#: ../../library/venv.rst:304 +#: ../../library/venv.rst:320 msgid "" "*with_pip* -- a boolean value which, if true, ensures pip is installed in " "the virtual environment. This uses :mod:`ensurepip` with the ``--default-" @@ -593,7 +584,7 @@ msgstr "" "*with_pip* -- 為一個 boolean,若為 true,則確保 pip 有安裝至虛擬環境之中。當" "有 ``--default-pip`` 的選項時,會使用 :mod:`ensurepip`。" -#: ../../library/venv.rst:308 +#: ../../library/venv.rst:324 msgid "" "*prompt* -- a string to be used after virtual environment is activated " "(defaults to ``None`` which means directory name of the environment would be " @@ -604,11 +595,11 @@ msgstr "" "``None``,代表該環境的目錄名稱會被使用)倘若出現特殊字串 ``\".\"`` ,則目前目" "錄的 basename 會做為提示路徑使用。" -#: ../../library/venv.rst:313 +#: ../../library/venv.rst:329 msgid "*upgrade_deps* -- Update the base venv modules to the latest on PyPI" msgstr "*upgrade_deps* -- 更新基礎 venv 模組至 PyPI 的最新版本" -#: ../../library/venv.rst:315 +#: ../../library/venv.rst:331 msgid "" "*scm_ignore_files* -- Create ignore files based for the specified source " "control managers (SCM) in the iterable. Support is defined by having a " @@ -619,27 +610,27 @@ msgstr "" "檔。支援情況取決於是否有名為 ``create_{scm}_ignore_file`` 的方法。預設唯一支" "援的值是 ``\"git\"``,透過 :meth:`create_git_ignore_file` 方法提供支援。" -#: ../../library/venv.rst:321 +#: ../../library/venv.rst:337 msgid "Added the ``with_pip`` parameter" msgstr "新增 ``with_pip`` 參數" -#: ../../library/venv.rst:324 +#: ../../library/venv.rst:340 msgid "Added the ``prompt`` parameter" msgstr "新增 ``prompt`` 參數" -#: ../../library/venv.rst:327 +#: ../../library/venv.rst:343 msgid "Added the ``upgrade_deps`` parameter" msgstr "新增 ``upgrade_deps`` 參數" -#: ../../library/venv.rst:330 +#: ../../library/venv.rst:346 msgid "Added the ``scm_ignore_files`` parameter" msgstr "新增 ``scm_ignore_files`` 參數" -#: ../../library/venv.rst:333 +#: ../../library/venv.rst:349 msgid ":class:`EnvBuilder` may be used as a base class." msgstr ":class:`EnvBuilder` 可以被用作為基底類別。" -#: ../../library/venv.rst:337 +#: ../../library/venv.rst:353 msgid "" "Create a virtual environment by specifying the target directory (absolute or " "relative to the current directory) which is to contain the virtual " @@ -650,7 +641,7 @@ msgstr "" "目錄),也就是在該目錄中容納虛擬環境。``create`` method 將會在指定的目錄下建" "立環境,或是觸發適當的例外。" -#: ../../library/venv.rst:343 +#: ../../library/venv.rst:359 msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" @@ -658,7 +649,7 @@ msgstr "" ":class:`EnvBuilder` class 的 ``create`` method 會闡述可用的 Hooks 以客製化 " "subclass (子類別)::" -#: ../../library/venv.rst:346 +#: ../../library/venv.rst:362 msgid "" "def create(self, env_dir):\n" " \"\"\"\n" @@ -684,7 +675,7 @@ msgstr "" " self.setup_scripts(context)\n" " self.post_setup(context)" -#: ../../library/venv.rst:358 +#: ../../library/venv.rst:374 msgid "" "Each of the methods :meth:`ensure_directories`, :meth:" "`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" @@ -693,7 +684,7 @@ msgstr "" "每個 methods :meth:`ensure_directories`、:meth:`create_configuration`、:meth:" "`setup_python`、:meth:`setup_scripts` 及 :meth:`post_setup` 都可以被覆寫。" -#: ../../library/venv.rst:364 +#: ../../library/venv.rst:380 msgid "" "Creates the environment directory and all necessary subdirectories that " "don't already exist, and returns a context object. This context object is " @@ -707,7 +698,7 @@ msgstr "" "class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內容將" "被清空,以及所有必要的子目錄將被重新建立。" -#: ../../library/venv.rst:371 +#: ../../library/venv.rst:387 msgid "" "The returned context object is a :class:`types.SimpleNamespace` with the " "following attributes:" @@ -715,7 +706,7 @@ msgstr "" "回傳的情境物件(context object)其型別會是 :class:`types.SimpleNamespace`,並" "包含以下屬性:" -#: ../../library/venv.rst:374 +#: ../../library/venv.rst:390 msgid "" "``env_dir`` - The location of the virtual environment. Used for " "``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." @@ -723,7 +714,7 @@ msgstr "" "``env_dir`` —— 虛擬環境的位置。用於啟用腳本中的 ``__VENV_DIR__``\\ (參見 :" "meth:`install_scripts`)。" -#: ../../library/venv.rst:377 +#: ../../library/venv.rst:393 msgid "" "``env_name`` - The name of the virtual environment. Used for " "``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." @@ -731,15 +722,15 @@ msgstr "" "``env_name`` —— 虛擬環境的名稱。用於啟用腳本中的 ``__VENV_NAME__``\\ (參見 :" "meth:`install_scripts`)。" -#: ../../library/venv.rst:380 +#: ../../library/venv.rst:396 msgid "" "``prompt`` - The prompt to be used by the activation scripts. Used for " "``__VENV_PROMPT__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -"``prompt`` —— 啟用腳本所使用的提示字元。用於啟用腳本中的 ``__VENV_PROMPT__``" -"\\ (參見 :meth:`install_scripts`)。" +"``prompt`` —— 啟用腳本所使用的提示字元。用於啟用腳本中的 " +"``__VENV_PROMPT__``\\ (參見 :meth:`install_scripts`)。" -#: ../../library/venv.rst:383 +#: ../../library/venv.rst:399 msgid "" "``executable`` - The underlying Python executable used by the virtual " "environment. This takes into account the case where a virtual environment is " @@ -748,19 +739,19 @@ msgstr "" "``executable`` —— 虛擬環境所使用的底層 Python 執行檔。在從其他虛擬環境建立虛" "擬環境的情況下,也會一併考慮該情境。" -#: ../../library/venv.rst:387 +#: ../../library/venv.rst:403 msgid "``inc_path`` - The include path for the virtual environment." msgstr "``inc_path`` —— 虛擬環境的 include 路徑。" -#: ../../library/venv.rst:389 +#: ../../library/venv.rst:405 msgid "``lib_path`` - The purelib path for the virtual environment." msgstr "``lib_path`` —— 虛擬環境的 purelib 路徑。" -#: ../../library/venv.rst:391 +#: ../../library/venv.rst:407 msgid "``bin_path`` - The script path for the virtual environment." msgstr "``bin_path`` —— 虛擬環境的腳本路徑。" -#: ../../library/venv.rst:393 +#: ../../library/venv.rst:409 msgid "" "``bin_name`` - The name of the script path relative to the virtual " "environment location. Used for ``__VENV_BIN_NAME__`` in activation scripts " @@ -769,7 +760,7 @@ msgstr "" "``bin_name`` —— 相對於虛擬環境位置的腳本路徑名稱。用於啟用腳本中的 " "``__VENV_BIN_NAME__``\\ (參見 :meth:`install_scripts`)。" -#: ../../library/venv.rst:397 +#: ../../library/venv.rst:413 msgid "" "``env_exe`` - The name of the Python interpreter in the virtual environment. " "Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" @@ -778,7 +769,7 @@ msgstr "" "``env_exe`` —— 虛擬環境中 Python 直譯器的名稱。用於啟用腳本中的 " "``__VENV_PYTHON__``\\ (參見 :meth:`install_scripts`)。" -#: ../../library/venv.rst:401 +#: ../../library/venv.rst:417 msgid "" "``env_exec_cmd`` - The name of the Python interpreter, taking into account " "filesystem redirections. This can be used to run Python in the virtual " @@ -787,7 +778,7 @@ msgstr "" "``env_exec_cmd`` —— Python 直譯器名稱,會將檔案系統重新導向後納入考慮。可用於" "在虛擬環境中執行 Python。" -#: ../../library/venv.rst:406 +#: ../../library/venv.rst:422 msgid "" "The *venv* :ref:`sysconfig installation scheme ` is used " "to construct the paths of the created directories." @@ -795,17 +786,17 @@ msgstr "" "*venv* 使用 :ref:`sysconfig 安裝配置方案 ` 來建構所建立目" "錄的路徑。" -#: ../../library/venv.rst:411 +#: ../../library/venv.rst:427 msgid "" "The attribute ``lib_path`` was added to the context, and the context object " "was documented." msgstr "``lib_path`` 屬性已新增至情境中,且情境物件已加入文件說明。" -#: ../../library/venv.rst:417 +#: ../../library/venv.rst:433 msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." msgstr "在環境中建立 ``pyvenv.cfg`` 設定檔。" -#: ../../library/venv.rst:421 +#: ../../library/venv.rst:437 msgid "" "Creates a copy or symlink to the Python executable in the environment. On " "POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " @@ -816,13 +807,13 @@ msgstr "" "``python3.x`` 執行檔,將建立指向該執行檔的 ``python`` 與 ``python3`` 符號連結" "(除非這些名稱的檔案已存在)。" -#: ../../library/venv.rst:428 +#: ../../library/venv.rst:444 msgid "" "Installs activation scripts appropriate to the platform into the virtual " "environment." msgstr "將符合平台的啟用腳本安裝到虛擬環境中。" -#: ../../library/venv.rst:433 +#: ../../library/venv.rst:449 msgid "" "Upgrades the core venv dependency packages (currently :pypi:`pip`) in the " "environment. This is done by shelling out to the ``pip`` executable in the " @@ -831,11 +822,11 @@ msgstr "" "更新虛擬環境中的核心 venv 相依套件(目前為 :pypi:`pip`)。此動作會透過執行虛" "擬環境中的 ``pip`` 執行檔來完成。" -#: ../../library/venv.rst:440 +#: ../../library/venv.rst:456 msgid ":pypi:`setuptools` is no longer a core venv dependency." msgstr ":pypi:`setuptools` 不再是核心 venv 的相依項目。" -#: ../../library/venv.rst:444 +#: ../../library/venv.rst:460 msgid "" "A placeholder method which can be overridden in third party implementations " "to pre-install packages in the virtual environment or perform other post-" @@ -844,7 +835,7 @@ msgstr "" "此佔位方法在虛擬環境中預先安裝套件,或執行其他建立後的動作,可由第三方實作覆" "寫。" -#: ../../library/venv.rst:450 +#: ../../library/venv.rst:466 msgid "" "This method can be called from :meth:`setup_scripts` or :meth:`post_setup` " "in subclasses to assist in installing custom scripts into the virtual " @@ -853,7 +844,7 @@ msgstr "" "此方法可由子類別中的 :meth:`setup_scripts` 或 :meth:`post_setup` 呼叫,協助將" "自訂腳本安裝到虛擬環境中。" -#: ../../library/venv.rst:454 +#: ../../library/venv.rst:470 msgid "" "*path* is the path to a directory that should contain subdirectories " "``common``, ``posix``, ``nt``; each containing scripts destined for the " @@ -865,19 +856,19 @@ msgstr "" "每個子目錄中都包含指向環境中 ``bin`` 目錄的腳本。在執行部分佔位符文字替換後," "將會複製 ``common`` 及與 :data:`os.name` 對應的目錄的內容:" -#: ../../library/venv.rst:460 +#: ../../library/venv.rst:476 msgid "" "``__VENV_DIR__`` is replaced with the absolute path of the environment " "directory." msgstr "``__VENV_DIR__`` 會被替換為環境目錄的絕對路徑。" -#: ../../library/venv.rst:463 +#: ../../library/venv.rst:479 msgid "" "``__VENV_NAME__`` is replaced with the environment name (final path segment " "of environment directory)." msgstr "``__VENV_NAME__`` 會被替換為環境的名稱(即該環境目錄路徑的最後一段)。" -#: ../../library/venv.rst:466 +#: ../../library/venv.rst:482 msgid "" "``__VENV_PROMPT__`` is replaced with the prompt (the environment name " "surrounded by parentheses and with a following space)" @@ -885,7 +876,7 @@ msgstr "" "``__VENV_PROMPT__`` 會被替換為提示字元(即以括號包裹的環境名稱,並附帶一個空" "格)。" -#: ../../library/venv.rst:469 +#: ../../library/venv.rst:485 msgid "" "``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " "``bin`` or ``Scripts``)." @@ -893,26 +884,26 @@ msgstr "" "``__VENV_BIN_NAME__`` 會被替換為 bin 目錄的名稱(可能是 ``bin`` 或 " "``Scripts``)。" -#: ../../library/venv.rst:472 +#: ../../library/venv.rst:488 msgid "" "``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " "executable." msgstr "``__VENV_PYTHON__`` 會被替換為環境中 Python 執行檔的絕對路徑。" -#: ../../library/venv.rst:475 +#: ../../library/venv.rst:491 msgid "" "The directories are allowed to exist (for when an existing environment is " "being upgraded)." msgstr "允許這些目錄存在(例如當更新既有環境時)。" -#: ../../library/venv.rst:480 +#: ../../library/venv.rst:496 msgid "" "Creates a ``.gitignore`` file within the virtual environment that causes the " "entire directory to be ignored by the Git source control manager." msgstr "" "在虛擬環境中建立一個 ``.gitignore`` 檔案,讓 Git 原始碼控管工具忽略整個目錄。" -#: ../../library/venv.rst:485 +#: ../../library/venv.rst:501 msgid "" "Windows now uses redirector scripts for ``python[w].exe`` instead of copying " "the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " @@ -922,7 +913,7 @@ msgstr "" "檔。在 3.7.2 中,只有當從原始碼樹中建構時,:meth:`setup_python` 才會執行操" "作。" -#: ../../library/venv.rst:490 +#: ../../library/venv.rst:506 msgid "" "Windows copies the redirector scripts as part of :meth:`setup_python` " "instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " @@ -932,11 +923,11 @@ msgstr "" "`setup_scripts` 中進行。這在 3.7.2 中並非如此。若使用符號連結,則會連結至原始" "的可執行檔。" -#: ../../library/venv.rst:495 +#: ../../library/venv.rst:511 msgid "There is also a module-level convenience function:" msgstr "也有一個方便的模組層級的函式:" -#: ../../library/venv.rst:501 +#: ../../library/venv.rst:517 msgid "" "Create an :class:`EnvBuilder` with the given keyword arguments, and call " "its :meth:`~EnvBuilder.create` method with the *env_dir* argument." @@ -944,27 +935,27 @@ msgstr "" "使用提供的關鍵字引數建立一個 :class:`EnvBuilder`,並以 *env_dir* 作為引數呼叫" "其 :meth:`~EnvBuilder.create` 方法。" -#: ../../library/venv.rst:506 +#: ../../library/venv.rst:522 msgid "Added the *with_pip* parameter" msgstr "新增 *with_pip* 參數" -#: ../../library/venv.rst:509 +#: ../../library/venv.rst:525 msgid "Added the *prompt* parameter" msgstr "新增 *prompt* 參數" -#: ../../library/venv.rst:512 +#: ../../library/venv.rst:528 msgid "Added the *upgrade_deps* parameter" msgstr "新增 *upgrade_deps* 參數" -#: ../../library/venv.rst:515 +#: ../../library/venv.rst:531 msgid "Added the *scm_ignore_files* parameter" msgstr "新增 *scm_ignore_files* 參數" -#: ../../library/venv.rst:519 +#: ../../library/venv.rst:535 msgid "An example of extending ``EnvBuilder``" msgstr "一個擴展 ``EnvBuilder`` 的範例" -#: ../../library/venv.rst:521 +#: ../../library/venv.rst:537 msgid "" "The following script shows how to extend :class:`EnvBuilder` by implementing " "a subclass which installs setuptools and pip into a created virtual " @@ -973,7 +964,7 @@ msgstr "" "以下的腳本展示了如何透過實作子類別來擴充 :class:`EnvBuilder`,並在建立的虛擬" "環境中安裝 setuptools 與 pip: ::" -#: ../../library/venv.rst:524 +#: ../../library/venv.rst:540 msgid "" "import os\n" "import os.path\n" @@ -1392,7 +1383,7 @@ msgstr "" " print('Error: %s' % e, file=sys.stderr)\n" " sys.exit(rc)" -#: ../../library/venv.rst:732 +#: ../../library/venv.rst:748 msgid "" "This script is also available for download `online `_." @@ -1406,3 +1397,90 @@ msgstr "Environments (環境)" #: ../../library/venv.rst:14 msgid "virtual" msgstr "virtual (虛擬)" + +#~ msgid "" +#~ "usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--" +#~ "clear]\n" +#~ " [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-" +#~ "deps]\n" +#~ " [--without-scm-ignore-files]\n" +#~ " ENV_DIR [ENV_DIR ...]\n" +#~ "\n" +#~ "Creates virtual Python environments in one or more target directories.\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " ENV_DIR A directory to create the environment in.\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --system-site-packages\n" +#~ " Give the virtual environment access to the " +#~ "system\n" +#~ " site-packages dir.\n" +#~ " --symlinks Try to use symlinks rather than copies, when\n" +#~ " symlinks are not the default for the platform.\n" +#~ " --copies Try to use copies rather than symlinks, even " +#~ "when\n" +#~ " symlinks are the default for the platform.\n" +#~ " --clear Delete the contents of the environment directory\n" +#~ " if it already exists, before environment " +#~ "creation.\n" +#~ " --upgrade Upgrade the environment directory to use this\n" +#~ " version of Python, assuming Python has been\n" +#~ " upgraded in-place.\n" +#~ " --without-pip Skips installing or upgrading pip in the virtual\n" +#~ " environment (pip is bootstrapped by default)\n" +#~ " --prompt PROMPT Provides an alternative prompt prefix for this\n" +#~ " environment.\n" +#~ " --upgrade-deps Upgrade core dependencies (pip) to the latest\n" +#~ " version in PyPI\n" +#~ " --without-scm-ignore-files\n" +#~ " Skips adding SCM ignore files to the environment\n" +#~ " directory (Git is supported by default).\n" +#~ "\n" +#~ "Once an environment has been created, you may wish to activate it, e.g. " +#~ "by\n" +#~ "sourcing an activate script in its bin directory." +#~ msgstr "" +#~ "usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--" +#~ "clear]\n" +#~ " [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-" +#~ "deps]\n" +#~ " [--without-scm-ignore-files]\n" +#~ " ENV_DIR [ENV_DIR ...]\n" +#~ "\n" +#~ "Creates virtual Python environments in one or more target directories.\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " ENV_DIR A directory to create the environment in.\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --system-site-packages\n" +#~ " Give the virtual environment access to the " +#~ "system\n" +#~ " site-packages dir.\n" +#~ " --symlinks Try to use symlinks rather than copies, when\n" +#~ " symlinks are not the default for the platform.\n" +#~ " --copies Try to use copies rather than symlinks, even " +#~ "when\n" +#~ " symlinks are the default for the platform.\n" +#~ " --clear Delete the contents of the environment directory\n" +#~ " if it already exists, before environment " +#~ "creation.\n" +#~ " --upgrade Upgrade the environment directory to use this\n" +#~ " version of Python, assuming Python has been\n" +#~ " upgraded in-place.\n" +#~ " --without-pip Skips installing or upgrading pip in the virtual\n" +#~ " environment (pip is bootstrapped by default)\n" +#~ " --prompt PROMPT Provides an alternative prompt prefix for this\n" +#~ " environment.\n" +#~ " --upgrade-deps Upgrade core dependencies (pip) to the latest\n" +#~ " version in PyPI\n" +#~ " --without-scm-ignore-files\n" +#~ " Skips adding SCM ignore files to the environment\n" +#~ " directory (Git is supported by default).\n" +#~ "\n" +#~ "Once an environment has been created, you may wish to activate it, e.g. " +#~ "by\n" +#~ "sourcing an activate script in its bin directory."